summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/chrome_browser_main.cc4
-rw-r--r--chrome/browser/chrome_browser_main_mac.mm2
-rw-r--r--chrome/browser/chromeos/offline/offline_load_page.cc3
-rw-r--r--chrome/browser/debugger/browser_list_tabcontents_provider.cc4
-rw-r--r--chrome/browser/extensions/component_loader.cc7
-rw-r--r--chrome/browser/extensions/extension_host.cc3
-rw-r--r--chrome/browser/extensions/extension_protocols.cc6
-rw-r--r--chrome/browser/first_run/first_run_win.cc4
-rw-r--r--chrome/browser/history/top_sites.cc4
-rw-r--r--chrome/browser/icon_loader_chromeos.cc3
-rw-r--r--chrome/browser/notifications/desktop_notification_service.cc3
-rw-r--r--chrome/browser/plugin_finder.cc3
-rw-r--r--chrome/browser/printing/cloud_print/cloud_print_setup_source.cc13
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_blocking_page.cc10
-rw-r--r--chrome/browser/ssl/ssl_blocking_page.cc4
-rw-r--r--chrome/browser/themes/browser_theme_pack.cc2
-rw-r--r--chrome/browser/themes/theme_service.cc3
-rw-r--r--chrome/browser/translate/translate_manager.cc4
-rw-r--r--chrome/browser/ui/pdf/pdf_unsupported_feature.cc4
-rw-r--r--chrome/browser/ui/webui/about_ui.cc20
-rw-r--r--chrome/browser/ui/webui/bookmarks_ui.cc6
-rw-r--r--chrome/browser/ui/webui/chrome_web_ui_data_source.cc4
-rw-r--r--chrome/browser/ui/webui/chromeos/login/oobe_ui.cc4
-rw-r--r--chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc3
-rw-r--r--chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc3
-rw-r--r--chrome/browser/ui/webui/chromeos/register_page_ui.cc4
-rw-r--r--chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc3
-rw-r--r--chrome/browser/ui/webui/chromeos/system_info_ui.cc3
-rw-r--r--chrome/browser/ui/webui/conflicts_ui.cc3
-rw-r--r--chrome/browser/ui/webui/crashes_ui.cc4
-rw-r--r--chrome/browser/ui/webui/devtools_ui.cc3
-rw-r--r--chrome/browser/ui/webui/downloads_ui.cc4
-rw-r--r--chrome/browser/ui/webui/extensions/extension_icon_source.cc6
-rw-r--r--chrome/browser/ui/webui/favicon_source.cc8
-rw-r--r--chrome/browser/ui/webui/flags_ui.cc5
-rw-r--r--chrome/browser/ui/webui/history_ui.cc4
-rw-r--r--chrome/browser/ui/webui/ntp/new_tab_ui.cc4
-rw-r--r--chrome/browser/ui/webui/ntp/ntp_resource_cache.cc10
-rw-r--r--chrome/browser/ui/webui/ntp/ntp_resource_cache_android.cc6
-rw-r--r--chrome/browser/ui/webui/options2/chromeos/wallpaper_thumbnail_source2.cc4
-rw-r--r--chrome/browser/ui/webui/options2/options_ui2.cc8
-rw-r--r--chrome/browser/ui/webui/plugins_ui.cc5
-rw-r--r--chrome/browser/ui/webui/sessions_ui.cc4
-rw-r--r--chrome/browser/ui/webui/shared_resources_data_source.cc2
-rw-r--r--chrome/browser/ui/webui/theme_source.cc61
-rw-r--r--chrome/browser/ui/webui/theme_source.h5
-rw-r--r--chrome/browser/ui/webui/web_ui_browsertest.cc2
-rw-r--r--chrome/browser/ui/webui/web_ui_util.cc4
-rw-r--r--chrome/common/chrome_content_client.cc16
-rw-r--r--chrome/common/chrome_content_client.h6
-rw-r--r--chrome/common/extensions/api/extension_api.cc4
-rw-r--r--chrome/common/extensions/simple_feature_provider.cc3
-rw-r--r--chrome/common/jstemplate_builder.cc9
-rw-r--r--chrome/common/net/net_resource_provider.cc8
-rw-r--r--chrome/common/web_apps.cc6
-rw-r--r--chrome/renderer/chrome_content_renderer_client.cc6
-rw-r--r--chrome/renderer/extensions/extension_dispatcher.cc4
-rw-r--r--chrome/renderer/extensions/json_schema_unittest.cc3
-rw-r--r--chrome/renderer/extensions/user_script_slave.cc7
-rw-r--r--chrome/renderer/plugins/plugin_placeholder.cc18
-rw-r--r--chrome/renderer/resource_bundle_source_map.cc4
-rw-r--r--chrome/test/base/chrome_test_suite.cc2
-rw-r--r--chrome/test/base/module_system_test.cc4
-rw-r--r--chrome/tools/mac_helpers/infoplist_strings_util.mm2
64 files changed, 126 insertions, 264 deletions
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 5f81728..c068a56 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -427,7 +427,7 @@ void InitializeGpuDataManager(const CommandLine& parsed_command_line) {
const base::StringPiece gpu_blacklist_json(
ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_GPU_BLACKLIST, ui::SCALE_FACTOR_NONE));
+ IDR_GPU_BLACKLIST));
GpuBlacklist* gpu_blacklist = GpuBlacklist::GetInstance();
bool succeed = gpu_blacklist->LoadGpuBlacklist(
gpu_blacklist_json.as_string(), GpuBlacklist::kCurrentOsOnly);
@@ -1303,7 +1303,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() {
FilePath resources_pack_path;
PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path);
ResourceBundle::GetSharedInstance().AddDataPack(
- resources_pack_path, ui::SCALE_FACTOR_100P);
+ resources_pack_path, ui::ResourceHandle::kScaleFactor100x);
#endif // defined(OS_MACOSX)
}
diff --git a/chrome/browser/chrome_browser_main_mac.mm b/chrome/browser/chrome_browser_main_mac.mm
index 54560b1..718c86f 100644
--- a/chrome/browser/chrome_browser_main_mac.mm
+++ b/chrome/browser/chrome_browser_main_mac.mm
@@ -138,7 +138,7 @@ void ChromeBrowserMainPartsMac::PreMainMessageLoopStart() {
FilePath resources_pack_path;
PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path);
ResourceBundle::GetSharedInstance().AddDataPack(
- resources_pack_path, ui::SCALE_FACTOR_100P);
+ resources_pack_path, ui::ResourceHandle::kScaleFactor100x);
}
// This is a no-op if the KeystoneRegistration framework is not present.
diff --git a/chrome/browser/chromeos/offline/offline_load_page.cc b/chrome/browser/chromeos/offline/offline_load_page.cc
index 126f6dd..ac107da 100644
--- a/chrome/browser/chromeos/offline/offline_load_page.cc
+++ b/chrome/browser/chromeos/offline/offline_load_page.cc
@@ -33,7 +33,6 @@
#include "grit/generated_resources.h"
#include "net/base/escape.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
using content::BrowserThread;
@@ -113,7 +112,7 @@ std::string OfflineLoadPage::GetHTMLContents() {
base::StringPiece html(
ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_OFFLINE_LOAD_HTML, ui::SCALE_FACTOR_NONE));
+ IDR_OFFLINE_LOAD_HTML));
return jstemplate_builder::GetI18nTemplateHtml(html, &strings);
}
diff --git a/chrome/browser/debugger/browser_list_tabcontents_provider.cc b/chrome/browser/debugger/browser_list_tabcontents_provider.cc
index f29c647..260eefa 100644
--- a/chrome/browser/debugger/browser_list_tabcontents_provider.cc
+++ b/chrome/browser/debugger/browser_list_tabcontents_provider.cc
@@ -11,7 +11,6 @@
#include "content/public/browser/browser_thread.h"
#include "grit/devtools_discovery_page_resources.h"
#include "net/url_request/url_request_context_getter.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
using content::DevToolsHttpHandlerDelegate;
@@ -42,8 +41,7 @@ std::string BrowserListTabContentsProvider::GetDiscoveryPageHTML() {
}
}
return ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_DEVTOOLS_DISCOVERY_PAGE_HTML,
- ui::SCALE_FACTOR_NONE).as_string();
+ IDR_DEVTOOLS_DISCOVERY_PAGE_HTML).as_string();
}
bool BrowserListTabContentsProvider::BundlesFrontendResources() {
diff --git a/chrome/browser/extensions/component_loader.cc b/chrome/browser/extensions/component_loader.cc
index 36ee3e0..b077315 100644
--- a/chrome/browser/extensions/component_loader.cc
+++ b/chrome/browser/extensions/component_loader.cc
@@ -24,7 +24,6 @@
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
#include "grit/browser_resources.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#if defined(OFFICIAL_BUILD)
@@ -90,8 +89,7 @@ const Extension* ComponentLoader::Add(
const FilePath& root_directory) {
std::string manifest_contents =
ResourceBundle::GetSharedInstance().GetRawDataResource(
- manifest_resource_id,
- ui::SCALE_FACTOR_NONE).as_string();
+ manifest_resource_id).as_string();
return Add(manifest_contents, root_directory);
}
@@ -251,8 +249,7 @@ void ComponentLoader::AddOrReloadEnterpriseWebStore() {
if (!enterprise_webstore_url.empty()) {
std::string manifest_contents =
ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_ENTERPRISE_WEBSTORE_MANIFEST,
- ui::SCALE_FACTOR_NONE).as_string();
+ IDR_ENTERPRISE_WEBSTORE_MANIFEST).as_string();
// The manifest is missing some values that are provided by policy.
DictionaryValue* manifest = ParseManifest(manifest_contents);
diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc
index a4582e5..722f279 100644
--- a/chrome/browser/extensions/extension_host.cc
+++ b/chrome/browser/extensions/extension_host.cc
@@ -49,7 +49,6 @@
#include "grit/generated_resources.h"
#include "ui/base/keycodes/keyboard_codes.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#if defined(TOOLKIT_VIEWS)
@@ -328,7 +327,7 @@ void ExtensionHost::InsertInfobarCSS() {
static const base::StringPiece css(
ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_EXTENSIONS_INFOBAR_CSS, ui::SCALE_FACTOR_NONE));
+ IDR_EXTENSIONS_INFOBAR_CSS));
render_view_host()->InsertCSS(string16(), css.as_string());
}
diff --git a/chrome/browser/extensions/extension_protocols.cc b/chrome/browser/extensions/extension_protocols.cc
index ed7416e..67e92a7 100644
--- a/chrome/browser/extensions/extension_protocols.cc
+++ b/chrome/browser/extensions/extension_protocols.cc
@@ -27,12 +27,11 @@
#include "grit/component_extension_resources_map.h"
#include "net/base/mime_util.h"
#include "net/base/net_errors.h"
-#include "net/http/http_response_headers.h"
#include "net/http/http_response_info.h"
+#include "net/http/http_response_headers.h"
#include "net/url_request/url_request_error_job.h"
#include "net/url_request/url_request_file_job.h"
#include "net/url_request/url_request_simple_job.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
using content::ResourceRequestInfo;
@@ -74,8 +73,7 @@ class URLRequestResourceBundleJob : public net::URLRequestSimpleJob {
std::string* charset,
std::string* data) const OVERRIDE {
const ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- *data = rb.GetRawDataResource(
- resource_id_, ui::SCALE_FACTOR_NONE).as_string();
+ *data = rb.GetRawDataResource(resource_id_).as_string();
// Requests should not block on the disk! On Windows this goes to the
// registry.
diff --git a/chrome/browser/first_run/first_run_win.cc b/chrome/browser/first_run/first_run_win.cc
index a66fd8c..bd3aafe 100644
--- a/chrome/browser/first_run/first_run_win.cc
+++ b/chrome/browser/first_run/first_run_win.cc
@@ -48,7 +48,6 @@
#include "grit/generated_resources.h"
#include "grit/locale_settings.h"
#include "grit/theme_resources.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_switches.h"
@@ -175,8 +174,7 @@ bool LaunchSetupWithParam(const std::string& param,
// true if successful.
bool WriteEULAtoTempFile(FilePath* eula_path) {
base::StringPiece terms =
- ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_TERMS_HTML, ui::SCALE_FACTOR_NONE);
+ ResourceBundle::GetSharedInstance().GetRawDataResource(IDR_TERMS_HTML);
if (terms.empty())
return false;
FILE *file = file_util::CreateAndOpenTemporaryFile(eula_path);
diff --git a/chrome/browser/history/top_sites.cc b/chrome/browser/history/top_sites.cc
index 779fe3b..9dab604 100644
--- a/chrome/browser/history/top_sites.cc
+++ b/chrome/browser/history/top_sites.cc
@@ -39,7 +39,6 @@
#include "grit/locale_settings.h"
#include "grit/theme_resources.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/image_util.h"
@@ -255,8 +254,7 @@ bool TopSites::GetPageThumbnail(const GURL& url,
for (size_t i = 0; i < arraysize(kPrepopulatedPages); i++) {
if (url.spec() == l10n_util::GetStringUTF8(kPrepopulatedPages[i].url_id)) {
*bytes = ResourceBundle::GetSharedInstance().LoadDataResourceBytes(
- kPrepopulatedPages[i].thumbnail_id,
- ui::SCALE_FACTOR_100P);
+ kPrepopulatedPages[i].thumbnail_id);
return true;
}
}
diff --git a/chrome/browser/icon_loader_chromeos.cc b/chrome/browser/icon_loader_chromeos.cc
index fbd87ad..cc4739f 100644
--- a/chrome/browser/icon_loader_chromeos.cc
+++ b/chrome/browser/icon_loader_chromeos.cc
@@ -16,7 +16,6 @@
#include "grit/component_extension_resources.h"
#include "skia/ext/image_operations.h"
#include "third_party/skia/include/core/SkBitmap.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/codec/png_codec.h"
@@ -198,7 +197,7 @@ void IconLoader::ReadIcon() {
int idr = icon_mapper.Get().Lookup(group_, icon_size_);
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
scoped_refptr<base::RefCountedStaticMemory> bytes(
- rb.LoadDataResourceBytes(idr, ui::SCALE_FACTOR_100P));
+ rb.LoadDataResourceBytes(idr));
DCHECK(bytes.get());
SkBitmap bitmap;
if (!gfx::PNGCodec::Decode(bytes->front(), bytes->size(), &bitmap))
diff --git a/chrome/browser/notifications/desktop_notification_service.cc b/chrome/browser/notifications/desktop_notification_service.cc
index 9ab605e..ff35176 100644
--- a/chrome/browser/notifications/desktop_notification_service.cc
+++ b/chrome/browser/notifications/desktop_notification_service.cc
@@ -41,7 +41,6 @@
#include "net/base/escape.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
using content::BrowserThread;
@@ -206,7 +205,7 @@ string16 DesktopNotificationService::CreateDataUrl(
int resource, const std::vector<std::string>& subst) {
const base::StringPiece template_html(
ResourceBundle::GetSharedInstance().GetRawDataResource(
- resource, ui::SCALE_FACTOR_NONE));
+ resource));
if (template_html.empty()) {
NOTREACHED() << "unable to load template. ID: " << resource;
diff --git a/chrome/browser/plugin_finder.cc b/chrome/browser/plugin_finder.cc
index 6b3da59fa..2456169 100644
--- a/chrome/browser/plugin_finder.cc
+++ b/chrome/browser/plugin_finder.cc
@@ -16,7 +16,6 @@
#include "content/public/browser/browser_thread.h"
#include "googleurl/src/gurl.h"
#include "grit/browser_resources.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
using base::DictionaryValue;
@@ -45,7 +44,7 @@ DictionaryValue* PluginFinder::LoadPluginList() {
#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
base::StringPiece json_resource(
ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_PLUGIN_DB_JSON, ui::SCALE_FACTOR_NONE));
+ IDR_PLUGIN_DB_JSON));
std::string error_str;
scoped_ptr<base::Value> value(base::JSONReader::ReadAndReturnError(
json_resource.as_string(),
diff --git a/chrome/browser/printing/cloud_print/cloud_print_setup_source.cc b/chrome/browser/printing/cloud_print/cloud_print_setup_source.cc
index e4f0b4e..9398bf8 100644
--- a/chrome/browser/printing/cloud_print/cloud_print_setup_source.cc
+++ b/chrome/browser/printing/cloud_print/cloud_print_setup_source.cc
@@ -17,7 +17,6 @@
#include "grit/locale_settings.h"
#include "grit/ui_resources.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
// Define the values of standard URLs.
@@ -68,8 +67,7 @@ void CloudPrintSetupSource::StartDataRequest(const std::string& path_raw,
AddString(dict, "sharingexplain", IDS_CLOUD_PRINT_SETUP_SHARING_EXPLAIN);
static const base::StringPiece html(ResourceBundle::GetSharedInstance()
- .GetRawDataResource(IDR_CLOUD_PRINT_SETUP_LOGIN_HTML,
- ui::SCALE_FACTOR_NONE));
+ .GetRawDataResource(IDR_CLOUD_PRINT_SETUP_LOGIN_HTML));
SetFontAndTextDirection(dict);
response = jstemplate_builder::GetI18nTemplateHtml(html, dict);
} else if (path_raw == kCloudPrintGaiaLoginPath) {
@@ -105,8 +103,7 @@ void CloudPrintSetupSource::StartDataRequest(const std::string& path_raw,
AddString(dict, "getaccesscodeurl", IDS_SYNC_GET_ACCESS_CODE_URL);
static const base::StringPiece html(ResourceBundle::GetSharedInstance()
- .GetRawDataResource(IDR_GAIA_LOGIN_HTML,
- ui::SCALE_FACTOR_NONE));
+ .GetRawDataResource(IDR_GAIA_LOGIN_HTML));
SetFontAndTextDirection(dict);
response = jstemplate_builder::GetI18nTemplateHtml(html, dict);
} else if (path_raw == kCloudPrintSetupDonePath) {
@@ -114,15 +111,13 @@ void CloudPrintSetupSource::StartDataRequest(const std::string& path_raw,
AddString(dict, "success", IDS_SYNC_SUCCESS);
AddString(dict, "okay", IDS_SYNC_SETUP_OK_BUTTON_LABEL);
static const base::StringPiece html(ResourceBundle::GetSharedInstance()
- .GetRawDataResource(IDR_CLOUD_PRINT_SETUP_DONE_HTML,
- ui::SCALE_FACTOR_NONE));
+ .GetRawDataResource(IDR_CLOUD_PRINT_SETUP_DONE_HTML));
SetFontAndTextDirection(dict);
response = jstemplate_builder::GetI18nTemplateHtml(html, dict);
} else if (path_raw == kCloudPrintSetupFlowPath) {
static const base::StringPiece html(
ResourceBundle::GetSharedInstance()
- .GetRawDataResource(IDR_CLOUD_PRINT_SETUP_FLOW_HTML,
- ui::SCALE_FACTOR_NONE));
+ .GetRawDataResource(IDR_CLOUD_PRINT_SETUP_FLOW_HTML));
response = html.as_string();
}
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
index 1e9f7be..dd3c3b2 100644
--- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
@@ -38,7 +38,6 @@
#include "grit/locale_settings.h"
#include "net/base/escape.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
using content::BrowserThread;
@@ -196,23 +195,20 @@ std::string SafeBrowsingBlockingPage::GetHTMLContents() {
if (unsafe_resources_.size() > 1) {
PopulateMultipleThreatStringDictionary(&strings);
html = rb.GetRawDataResource(
- IDR_SAFE_BROWSING_MULTIPLE_THREAT_BLOCK,
- ui::SCALE_FACTOR_NONE).as_string();
+ IDR_SAFE_BROWSING_MULTIPLE_THREAT_BLOCK).as_string();
} else {
SafeBrowsingService::UrlCheckResult threat_type =
unsafe_resources_[0].threat_type;
if (threat_type == SafeBrowsingService::URL_MALWARE) {
PopulateMalwareStringDictionary(&strings);
html = rb.GetRawDataResource(
- IDR_SAFE_BROWSING_MALWARE_BLOCK,
- ui::SCALE_FACTOR_NONE).as_string();
+ IDR_SAFE_BROWSING_MALWARE_BLOCK).as_string();
} else { // Phishing.
DCHECK(threat_type == SafeBrowsingService::URL_PHISHING ||
threat_type == SafeBrowsingService::CLIENT_SIDE_PHISHING_URL);
PopulatePhishingStringDictionary(&strings);
html = rb.GetRawDataResource(
- IDR_SAFE_BROWSING_PHISHING_BLOCK,
- ui::SCALE_FACTOR_NONE).as_string();
+ IDR_SAFE_BROWSING_PHISHING_BLOCK).as_string();
}
}
diff --git a/chrome/browser/ssl/ssl_blocking_page.cc b/chrome/browser/ssl/ssl_blocking_page.cc
index e5bc81d..3b301be 100644
--- a/chrome/browser/ssl/ssl_blocking_page.cc
+++ b/chrome/browser/ssl/ssl_blocking_page.cc
@@ -26,7 +26,6 @@
#include "grit/browser_resources.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
using content::InterstitialPage;
@@ -121,8 +120,7 @@ std::string SSLBlockingPage::GetHTMLContents() {
strings.SetString("textdirection", base::i18n::IsRTL() ? "rtl" : "ltr");
base::StringPiece html(
- ResourceBundle::GetSharedInstance().GetRawDataResource(
- resource_id, ui::SCALE_FACTOR_NONE));
+ ResourceBundle::GetSharedInstance().GetRawDataResource(resource_id));
return jstemplate_builder::GetI18nTemplateHtml(html, &strings);
}
diff --git a/chrome/browser/themes/browser_theme_pack.cc b/chrome/browser/themes/browser_theme_pack.cc
index 2e8e9bd..b5f17eb 100644
--- a/chrome/browser/themes/browser_theme_pack.cc
+++ b/chrome/browser/themes/browser_theme_pack.cc
@@ -384,7 +384,7 @@ scoped_refptr<BrowserThemePack> BrowserThemePack::BuildFromDataPack(
base::ThreadRestrictions::ScopedAllowIO allow_io;
scoped_refptr<BrowserThemePack> pack(new BrowserThemePack);
pack->data_pack_.reset(
- new ui::DataPack(ui::SCALE_FACTOR_100P));
+ new ui::DataPack(ui::ResourceHandle::kScaleFactor100x));
if (!pack->data_pack_->Load(path)) {
LOG(ERROR) << "Failed to load theme data pack.";
diff --git a/chrome/browser/themes/theme_service.cc b/chrome/browser/themes/theme_service.cc
index 5a75aa6..f9be837 100644
--- a/chrome/browser/themes/theme_service.cc
+++ b/chrome/browser/themes/theme_service.cc
@@ -21,7 +21,6 @@
#include "grit/theme_resources.h"
#include "grit/theme_resources_standard.h"
#include "grit/ui_resources.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/image_skia.h"
@@ -325,7 +324,7 @@ base::RefCountedMemory* ThemeService::GetRawData(int id) const {
if (theme_pack_.get())
data = theme_pack_->GetRawData(id);
if (!data)
- data = rb_.LoadDataResourceBytes(id, ui::SCALE_FACTOR_100P);
+ data = rb_.LoadDataResourceBytes(id);
return data;
}
diff --git a/chrome/browser/translate/translate_manager.cc b/chrome/browser/translate/translate_manager.cc
index acf05e0..21565cf 100644
--- a/chrome/browser/translate/translate_manager.cc
+++ b/chrome/browser/translate/translate_manager.cc
@@ -50,7 +50,6 @@
#include "net/base/escape.h"
#include "net/base/load_flags.h"
#include "net/url_request/url_request_status.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#ifdef FILE_MANAGER_EXTENSION
@@ -428,8 +427,7 @@ void TranslateManager::OnURLFetchComplete(const net::URLFetcher* source) {
translate_script_request_pending_.release());
if (!error) {
base::StringPiece str = ResourceBundle::GetSharedInstance().
- GetRawDataResource(IDR_TRANSLATE_JS,
- ui::SCALE_FACTOR_NONE);
+ GetRawDataResource(IDR_TRANSLATE_JS);
DCHECK(translate_script_.empty());
str.CopyToString(&translate_script_);
std::string data;
diff --git a/chrome/browser/ui/pdf/pdf_unsupported_feature.cc b/chrome/browser/ui/pdf/pdf_unsupported_feature.cc
index 8924fcc..340dba0 100644
--- a/chrome/browser/ui/pdf/pdf_unsupported_feature.cc
+++ b/chrome/browser/ui/pdf/pdf_unsupported_feature.cc
@@ -31,7 +31,6 @@
#include "grit/generated_resources.h"
#include "grit/theme_resources_standard.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/image.h"
#include "webkit/plugins/npapi/plugin_group.h"
@@ -205,8 +204,7 @@ class PDFUnsupportedFeatureInterstitial
l10n_util::GetStringUTF16(IDS_READER_OUT_OF_DATE_BLOCKING_PAGE_CANCEL));
base::StringPiece html(ResourceBundle::GetSharedInstance().
- GetRawDataResource(IDR_READER_OUT_OF_DATE_HTML,
- ui::SCALE_FACTOR_NONE));
+ GetRawDataResource(IDR_READER_OUT_OF_DATE_HTML));
return jstemplate_builder::GetI18nTemplateHtml(html, &strings);
}
diff --git a/chrome/browser/ui/webui/about_ui.cc b/chrome/browser/ui/webui/about_ui.cc
index 6d7d77c..89fd4fa 100644
--- a/chrome/browser/ui/webui/about_ui.cc
+++ b/chrome/browser/ui/webui/about_ui.cc
@@ -65,7 +65,6 @@
#include "net/base/escape.h"
#include "net/base/net_util.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#include "v8/include/v8.h"
#include "webkit/glue/user_agent.h"
@@ -73,8 +72,8 @@
#include "webkit/plugins/webplugininfo.h"
#if defined(OS_LINUX) || defined(OS_OPENBSD)
-#include "content/public/browser/zygote_host_linux.h"
#include "content/public/common/sandbox_linux.h"
+#include "content/public/browser/zygote_host_linux.h"
#endif
#if defined(OS_WIN)
@@ -247,7 +246,7 @@ class ChromeOSTermsHandler
// Do nothing if OEM EULA load failed.
if (contents_.empty() && path_ != chrome::kOemEulaURLPath) {
contents_ = ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_TERMS_HTML, ui::SCALE_FACTOR_NONE).as_string();
+ IDR_TERMS_HTML).as_string();
}
source_->FinishDataRequest(contents_, request_id_);
}
@@ -840,8 +839,7 @@ void FinishMemoryDataRequest(const std::string& path,
source->FinishDataRequest(
ResourceBundle::GetSharedInstance().GetRawDataResource(
path == kMemoryJsPath ? IDR_ABOUT_MEMORY_JS :
- IDR_ABOUT_MEMORY_HTML,
- ui::SCALE_FACTOR_NONE).as_string(), request_id);
+ IDR_ABOUT_MEMORY_HTML).as_string(), request_id);
}
}
@@ -992,8 +990,8 @@ std::string AboutStats(const std::string& query) {
} else {
// Get about_stats.html/js from resource bundle.
data = ResourceBundle::GetSharedInstance().GetRawDataResource(
- (query == kStatsJsPath ? IDR_ABOUT_STATS_JS : IDR_ABOUT_STATS_HTML),
- ui::SCALE_FACTOR_NONE).as_string();
+ (query == kStatsJsPath ? IDR_ABOUT_STATS_JS : IDR_ABOUT_STATS_HTML)).
+ as_string();
if (query != kStatsJsPath) {
// Clear the timer list since we stored the data in the timers list
@@ -1088,7 +1086,7 @@ std::string AboutVersionStaticContent(const std::string& query) {
return ResourceBundle::GetSharedInstance().GetRawDataResource(
query == kVersionJsPath ?
IDR_ABOUT_VERSION_JS :
- IDR_ABOUT_VERSION_HTML, ui::SCALE_FACTOR_NONE).as_string();
+ IDR_ABOUT_VERSION_HTML).as_string();
}
std::string AboutVersionStrings(DictionaryValue* localized_strings,
@@ -1389,7 +1387,7 @@ void AboutUIHTMLSource::StartDataRequest(const std::string& path,
} else if (host == chrome::kChromeUICreditsHost) {
int idr = (path == kCreditsJsPath) ? IDR_CREDITS_JS : IDR_CREDITS_HTML;
response = ResourceBundle::GetSharedInstance().GetRawDataResource(
- idr, ui::SCALE_FACTOR_NONE).as_string();
+ idr).as_string();
#if defined(OS_CHROMEOS)
} else if (host == chrome::kChromeUICryptohomeHost) {
FinishCryptohomeDataRequest(this, path, request_id);
@@ -1420,7 +1418,7 @@ void AboutUIHTMLSource::StartDataRequest(const std::string& path,
response = AboutNetwork(path);
} else if (host == chrome::kChromeUIOSCreditsHost) {
response = ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_OS_CREDITS_HTML, ui::SCALE_FACTOR_NONE).as_string();
+ IDR_OS_CREDITS_HTML).as_string();
#endif
#if defined(OS_LINUX) || defined(OS_OPENBSD)
} else if (host == chrome::kChromeUISandboxHost) {
@@ -1434,7 +1432,7 @@ void AboutUIHTMLSource::StartDataRequest(const std::string& path,
return;
#else
response = ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_TERMS_HTML, ui::SCALE_FACTOR_NONE).as_string();
+ IDR_TERMS_HTML).as_string();
#endif
} else if (host == chrome::kChromeUIVersionHost) {
if (path == kStringsJsPath) {
diff --git a/chrome/browser/ui/webui/bookmarks_ui.cc b/chrome/browser/ui/webui/bookmarks_ui.cc
index de67b3e..8154368 100644
--- a/chrome/browser/ui/webui/bookmarks_ui.cc
+++ b/chrome/browser/ui/webui/bookmarks_ui.cc
@@ -19,11 +19,10 @@
#include "chrome/common/url_constants.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
-#include "googleurl/src/gurl.h"
#include "grit/theme_resources.h"
#include "grit/theme_resources_standard.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
+#include "googleurl/src/gurl.h"
using content::WebContents;
@@ -71,6 +70,5 @@ BookmarksUI::BookmarksUI(content::WebUI* web_ui) : WebUIController(web_ui) {
// static
base::RefCountedMemory* BookmarksUI::GetFaviconResourceBytes() {
return ResourceBundle::GetSharedInstance().
- LoadDataResourceBytes(IDR_BOOKMARKS_FAVICON,
- ui::SCALE_FACTOR_100P);
+ LoadDataResourceBytes(IDR_BOOKMARKS_FAVICON);
}
diff --git a/chrome/browser/ui/webui/chrome_web_ui_data_source.cc b/chrome/browser/ui/webui/chrome_web_ui_data_source.cc
index 1fa1457..d4a1c67 100644
--- a/chrome/browser/ui/webui/chrome_web_ui_data_source.cc
+++ b/chrome/browser/ui/webui/chrome_web_ui_data_source.cc
@@ -10,7 +10,6 @@
#include "base/string_util.h"
#include "chrome/common/jstemplate_builder.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
ChromeWebUIDataSource::ChromeWebUIDataSource(const std::string& source_name)
@@ -87,7 +86,6 @@ void ChromeWebUIDataSource::SendLocalizedStringsAsJSON(int request_id) {
void ChromeWebUIDataSource::SendFromResourceBundle(int request_id, int idr) {
scoped_refptr<base::RefCountedStaticMemory> response(
- ResourceBundle::GetSharedInstance().LoadDataResourceBytes(
- idr, ui::SCALE_FACTOR_NONE));
+ ResourceBundle::GetSharedInstance().LoadDataResourceBytes(idr));
SendResponse(request_id, response);
}
diff --git a/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc b/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
index 0b36cd9..eda42a7 100644
--- a/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
@@ -35,7 +35,6 @@
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "grit/browser_resources.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
using content::WebContents;
@@ -108,8 +107,7 @@ void OobeUIHTMLSource::StartDataRequest(const std::string& path,
std::string OobeUIHTMLSource::GetDataResource(int resource_id) const {
const base::StringPiece html(
- ResourceBundle::GetSharedInstance().GetRawDataResource(
- resource_id, ui::SCALE_FACTOR_NONE));
+ ResourceBundle::GetSharedInstance().GetRawDataResource(resource_id));
return jstemplate_builder::GetI18nTemplateHtml(html,
localized_strings_.get());
}
diff --git a/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc b/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc
index bf875d7..98dd59a 100644
--- a/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc
@@ -44,7 +44,6 @@
#include "grit/generated_resources.h"
#include "grit/locale_settings.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
using content::BrowserThread;
@@ -484,7 +483,7 @@ void MobileSetupUIHTMLSource::StartDataRequest(const std::string& path,
static const base::StringPiece html(
ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_MOBILE_SETUP_PAGE_HTML, ui::SCALE_FACTOR_NONE));
+ IDR_MOBILE_SETUP_PAGE_HTML));
std::string full_html = jstemplate_builder::GetI18nTemplateHtml(html,
&strings);
diff --git a/chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc b/chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc
index ebd296b..4a4d7c9 100644
--- a/chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/proxy_settings_ui.cc
@@ -20,7 +20,6 @@
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_message_handler.h"
#include "grit/browser_resources.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
using content::WebContents;
@@ -60,7 +59,7 @@ void ProxySettingsHTMLSource::StartDataRequest(const std::string& path,
static const base::StringPiece html(
ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_PROXY_SETTINGS_HTML, ui::SCALE_FACTOR_NONE));
+ IDR_PROXY_SETTINGS_HTML));
std::string full_html = jstemplate_builder::GetI18nTemplateHtml(
html, localized_strings_.get());
diff --git a/chrome/browser/ui/webui/chromeos/register_page_ui.cc b/chrome/browser/ui/webui/chromeos/register_page_ui.cc
index ca1889a..394a928 100644
--- a/chrome/browser/ui/webui/chromeos/register_page_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/register_page_ui.cc
@@ -31,7 +31,6 @@
#include "content/public/browser/web_ui_message_handler.h"
#include "googleurl/src/gurl.h"
#include "grit/browser_resources.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
using content::WebContents;
@@ -168,8 +167,7 @@ void RegisterPageUIHTMLSource::StartDataRequest(const std::string& path,
scoped_refptr<base::RefCountedMemory> html_bytes(
ResourceBundle::GetSharedInstance().LoadDataResourceBytes(
- IDR_HOST_REGISTRATION_PAGE_HTML,
- ui::SCALE_FACTOR_NONE));
+ IDR_HOST_REGISTRATION_PAGE_HTML));
SendResponse(request_id, html_bytes);
}
diff --git a/chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc b/chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc
index ea7825e..a097d71 100644
--- a/chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc
@@ -30,7 +30,6 @@
#include "grit/browser_resources.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
using content::BrowserThread;
@@ -306,7 +305,7 @@ void SimUnlockUIHTMLSource::StartDataRequest(const std::string& path,
static const base::StringPiece html(
ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_SIM_UNLOCK_HTML, ui::SCALE_FACTOR_NONE));
+ IDR_SIM_UNLOCK_HTML));
std::string full_html = jstemplate_builder::GetI18nTemplateHtml(html,
&strings);
diff --git a/chrome/browser/ui/webui/chromeos/system_info_ui.cc b/chrome/browser/ui/webui/chromeos/system_info_ui.cc
index 8b3b599..0109bc4 100644
--- a/chrome/browser/ui/webui/chromeos/system_info_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/system_info_ui.cc
@@ -34,7 +34,6 @@
#include "net/base/directory_lister.h"
#include "net/base/escape.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
using content::WebContents;
@@ -147,7 +146,7 @@ void SystemInfoUIHTMLSource::SyslogsComplete(
}
static const base::StringPiece systeminfo_html(
ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_ABOUT_SYS_HTML, ui::SCALE_FACTOR_NONE));
+ IDR_ABOUT_SYS_HTML));
std::string full_html = jstemplate_builder::GetTemplatesHtml(
systeminfo_html, &strings, "t" /* template root node id */);
diff --git a/chrome/browser/ui/webui/conflicts_ui.cc b/chrome/browser/ui/webui/conflicts_ui.cc
index d5e8ed9..75c1816 100644
--- a/chrome/browser/ui/webui/conflicts_ui.cc
+++ b/chrome/browser/ui/webui/conflicts_ui.cc
@@ -33,7 +33,6 @@
#include "grit/theme_resources.h"
#include "grit/theme_resources_standard.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
using content::UserMetricsAction;
@@ -175,7 +174,7 @@ ConflictsUI::ConflictsUI(content::WebUI* web_ui) : WebUIController(web_ui) {
base::RefCountedMemory* ConflictsUI::GetFaviconResourceBytes() {
return static_cast<base::RefCountedMemory*>(
ResourceBundle::GetSharedInstance().LoadDataResourceBytes(
- IDR_CONFLICT_FAVICON, ui::SCALE_FACTOR_NONE));
+ IDR_CONFLICT_FAVICON));
}
#endif
diff --git a/chrome/browser/ui/webui/crashes_ui.cc b/chrome/browser/ui/webui/crashes_ui.cc
index bf68b06..f8c5760 100644
--- a/chrome/browser/ui/webui/crashes_ui.cc
+++ b/chrome/browser/ui/webui/crashes_ui.cc
@@ -30,7 +30,6 @@
#include "grit/theme_resources.h"
#include "grit/theme_resources_standard.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#if defined(OS_CHROMEOS)
@@ -173,8 +172,7 @@ CrashesUI::CrashesUI(content::WebUI* web_ui) : WebUIController(web_ui) {
// static
base::RefCountedMemory* CrashesUI::GetFaviconResourceBytes() {
return ResourceBundle::GetSharedInstance().
- LoadDataResourceBytes(IDR_SAD_FAVICON,
- ui::SCALE_FACTOR_NONE);
+ LoadDataResourceBytes(IDR_SAD_FAVICON);
}
// static
diff --git a/chrome/browser/ui/webui/devtools_ui.cc b/chrome/browser/ui/webui/devtools_ui.cc
index a58de6a..14b04f4 100644
--- a/chrome/browser/ui/webui/devtools_ui.cc
+++ b/chrome/browser/ui/webui/devtools_ui.cc
@@ -19,7 +19,6 @@
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
using content::BrowserThread;
@@ -67,7 +66,7 @@ void DevToolsDataSource::StartDataRequest(const std::string& path,
" with --debug-devtools.";
const ResourceBundle& rb = ResourceBundle::GetSharedInstance();
scoped_refptr<base::RefCountedStaticMemory> bytes(rb.LoadDataResourceBytes(
- resource_id, ui::SCALE_FACTOR_NONE));
+ resource_id));
SendResponse(request_id, bytes);
}
diff --git a/chrome/browser/ui/webui/downloads_ui.cc b/chrome/browser/ui/webui/downloads_ui.cc
index 57b7f7a..efc035b 100644
--- a/chrome/browser/ui/webui/downloads_ui.cc
+++ b/chrome/browser/ui/webui/downloads_ui.cc
@@ -24,7 +24,6 @@
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
#include "grit/theme_resources_standard.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
using content::DownloadManager;
@@ -104,6 +103,5 @@ DownloadsUI::DownloadsUI(content::WebUI* web_ui) : WebUIController(web_ui) {
// static
base::RefCountedMemory* DownloadsUI::GetFaviconResourceBytes() {
return ResourceBundle::GetSharedInstance().
- LoadDataResourceBytes(IDR_DOWNLOADS_FAVICON,
- ui::SCALE_FACTOR_NONE);
+ LoadDataResourceBytes(IDR_DOWNLOADS_FAVICON);
}
diff --git a/chrome/browser/ui/webui/extensions/extension_icon_source.cc b/chrome/browser/ui/webui/extensions/extension_icon_source.cc
index 519832d..a8bbec6 100644
--- a/chrome/browser/ui/webui/extensions/extension_icon_source.cc
+++ b/chrome/browser/ui/webui/extensions/extension_icon_source.cc
@@ -19,11 +19,10 @@
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_resource.h"
#include "chrome/common/url_constants.h"
-#include "googleurl/src/gurl.h"
#include "grit/component_extension_resources_map.h"
#include "grit/theme_resources.h"
+#include "googleurl/src/gurl.h"
#include "skia/ext/image_operations.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/color_utils.h"
@@ -91,8 +90,7 @@ GURL ExtensionIconSource::GetIconURL(const Extension* extension,
// static
SkBitmap* ExtensionIconSource::LoadImageByResourceId(int resource_id) {
std::string contents = ResourceBundle::GetSharedInstance()
- .GetRawDataResource(resource_id,
- ui::SCALE_FACTOR_100P).as_string();
+ .GetRawDataResource(resource_id).as_string();
// Convert and return it.
const unsigned char* data =
diff --git a/chrome/browser/ui/webui/favicon_source.cc b/chrome/browser/ui/webui/favicon_source.cc
index 6fa19b9..4a1b3c0 100644
--- a/chrome/browser/ui/webui/favicon_source.cc
+++ b/chrome/browser/ui/webui/favicon_source.cc
@@ -12,7 +12,6 @@
#include "grit/locale_settings.h"
#include "grit/ui_resources.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
FaviconSource::FaviconSource(Profile* profile, IconType type)
@@ -97,8 +96,7 @@ void FaviconSource::StartDataRequest(const std::string& path,
request_size_map_.erase(request_id);
SendResponse(request_id,
ResourceBundle::GetSharedInstance().LoadDataResourceBytes(
- history::kPrepopulatedPages[i].favicon_id,
- ui::SCALE_FACTOR_100P));
+ history::kPrepopulatedPages[i].favicon_id));
return;
}
}
@@ -150,14 +148,14 @@ void FaviconSource::SendDefaultResponse(int request_id) {
if (!default_favicon_large_.get()) {
default_favicon_large_ =
ResourceBundle::GetSharedInstance().LoadDataResourceBytes(
- IDR_DEFAULT_LARGE_FAVICON, ui::SCALE_FACTOR_100P);
+ IDR_DEFAULT_LARGE_FAVICON);
}
bytes = default_favicon_large_;
} else {
if (!default_favicon_.get()) {
default_favicon_ =
ResourceBundle::GetSharedInstance().LoadDataResourceBytes(
- IDR_DEFAULT_FAVICON, ui::SCALE_FACTOR_100P);
+ IDR_DEFAULT_FAVICON);
}
bytes = default_favicon_;
}
diff --git a/chrome/browser/ui/webui/flags_ui.cc b/chrome/browser/ui/webui/flags_ui.cc
index 42bf58b..2e7da67 100644
--- a/chrome/browser/ui/webui/flags_ui.cc
+++ b/chrome/browser/ui/webui/flags_ui.cc
@@ -26,10 +26,9 @@
#include "grit/browser_resources.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
-#include "grit/theme_resources.h"
#include "grit/theme_resources_standard.h"
+#include "grit/theme_resources.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#if defined(OS_CHROMEOS)
@@ -170,7 +169,7 @@ FlagsUI::FlagsUI(content::WebUI* web_ui) : WebUIController(web_ui) {
// static
base::RefCountedMemory* FlagsUI::GetFaviconResourceBytes() {
return ResourceBundle::GetSharedInstance().
- LoadDataResourceBytes(IDR_FLAGS, ui::SCALE_FACTOR_100P);
+ LoadDataResourceBytes(IDR_FLAGS);
}
// static
diff --git a/chrome/browser/ui/webui/history_ui.cc b/chrome/browser/ui/webui/history_ui.cc
index 158e976..1f3c0fa 100644
--- a/chrome/browser/ui/webui/history_ui.cc
+++ b/chrome/browser/ui/webui/history_ui.cc
@@ -45,7 +45,6 @@
#include "grit/theme_resources_standard.h"
#include "net/base/escape.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
using content::UserMetricsAction;
@@ -486,6 +485,5 @@ const GURL HistoryUI::GetHistoryURLWithSearchText(const string16& text) {
// static
base::RefCountedMemory* HistoryUI::GetFaviconResourceBytes() {
return ResourceBundle::GetSharedInstance().
- LoadDataResourceBytes(IDR_HISTORY_FAVICON,
- ui::SCALE_FACTOR_100P);
+ LoadDataResourceBytes(IDR_HISTORY_FAVICON);
}
diff --git a/chrome/browser/ui/webui/ntp/new_tab_ui.cc b/chrome/browser/ui/webui/ntp/new_tab_ui.cc
index 1a4f5e8..2ad684e 100644
--- a/chrome/browser/ui/webui/ntp/new_tab_ui.cc
+++ b/chrome/browser/ui/webui/ntp/new_tab_ui.cc
@@ -53,8 +53,6 @@
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/layout.h"
-#include "ui/base/resource/resource_bundle.h"
#if !defined(OS_ANDROID)
#include "chrome/browser/ui/webui/ntp/app_launcher_handler.h"
@@ -357,7 +355,7 @@ void NewTabUI::NewTabHTMLSource::StartDataRequest(const std::string& path,
scoped_refptr<base::RefCountedStaticMemory> resource_bytes(
it->second.second ?
ResourceBundle::GetSharedInstance().LoadDataResourceBytes(
- it->second.second, ui::SCALE_FACTOR_NONE) :
+ it->second.second) :
new base::RefCountedStaticMemory);
SendResponse(request_id, resource_bytes);
return;
diff --git a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
index 034fc9f..fd46886 100644
--- a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
@@ -45,7 +45,6 @@
#include "grit/theme_resources.h"
#include "ui/base/animation/animation.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/theme_provider.h"
#include "ui/gfx/color_utils.h"
@@ -292,7 +291,7 @@ void NTPResourceCache::CreateNewTabIncognitoHTML() {
static const base::StringPiece incognito_tab_html(
ResourceBundle::GetSharedInstance().GetRawDataResource(
- new_tab_html_idr, ui::SCALE_FACTOR_NONE));
+ new_tab_html_idr));
std::string full_html = jstemplate_builder::GetI18nTemplateHtml(
incognito_tab_html, &localized_strings);
@@ -428,8 +427,7 @@ void NTPResourceCache::CreateNewTabHTML() {
// Load the new tab page appropriate for this build
base::StringPiece new_tab_html(ResourceBundle::GetSharedInstance().
- GetRawDataResource(IDR_NEW_TAB_4_HTML,
- ui::SCALE_FACTOR_NONE));
+ GetRawDataResource(IDR_NEW_TAB_4_HTML));
jstemplate_builder::UseVersion2 version2;
std::string full_html =
jstemplate_builder::GetI18nTemplateHtml(new_tab_html, &load_time_data);
@@ -460,7 +458,7 @@ void NTPResourceCache::CreateNewTabIncognitoCSS() {
// Get our template.
static const base::StringPiece new_tab_theme_css(
ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_NEW_INCOGNITO_TAB_THEME_CSS, ui::SCALE_FACTOR_NONE));
+ IDR_NEW_INCOGNITO_TAB_THEME_CSS));
// Create the string from our template and the replacements.
std::string full_css = ReplaceStringPlaceholders(
@@ -555,7 +553,7 @@ void NTPResourceCache::CreateNewTabCSS() {
// Get our template.
static const base::StringPiece new_tab_theme_css(
ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_NEW_TAB_4_THEME_CSS, ui::SCALE_FACTOR_NONE));
+ IDR_NEW_TAB_4_THEME_CSS));
// Create the string from our template and the replacements.
std::string css_string;
diff --git a/chrome/browser/ui/webui/ntp/ntp_resource_cache_android.cc b/chrome/browser/ui/webui/ntp/ntp_resource_cache_android.cc
index 61d6230..db8d468 100644
--- a/chrome/browser/ui/webui/ntp/ntp_resource_cache_android.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache_android.cc
@@ -4,11 +4,11 @@
#include "chrome/browser/ui/webui/ntp/ntp_resource_cache.h"
-#include "base/memory/ref_counted_memory.h"
#include "base/string16.h"
#include "base/string_piece.h"
#include "base/utf_string_conversions.h"
#include "base/values.h"
+#include "base/memory/ref_counted_memory.h"
#include "chrome/browser/google/google_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/chrome_url_data_manager.h"
@@ -19,7 +19,6 @@
#include "grit/browser_resources.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
using content::BrowserThread;
@@ -74,8 +73,7 @@ void NTPResourceCache::CreateNewTabHTML() {
ChromeURLDataManager::DataSource::SetFontAndTextDirection(&localized_strings);
base::StringPiece new_tab_html(ResourceBundle::GetSharedInstance().
- GetRawDataResource(IDR_NEW_TAB_4_HTML,
- ui::SCALE_FACTOR_NONE));
+ GetRawDataResource(IDR_NEW_TAB_4_HTML));
const char* new_tab_link = kLearnMoreIncognitoUrl;
string16 learnMoreLink = ASCIIToUTF16(
diff --git a/chrome/browser/ui/webui/options2/chromeos/wallpaper_thumbnail_source2.cc b/chrome/browser/ui/webui/options2/chromeos/wallpaper_thumbnail_source2.cc
index 73f7e3f..bc38e2d 100644
--- a/chrome/browser/ui/webui/options2/chromeos/wallpaper_thumbnail_source2.cc
+++ b/chrome/browser/ui/webui/options2/chromeos/wallpaper_thumbnail_source2.cc
@@ -19,7 +19,6 @@
#include "content/public/browser/browser_thread.h"
#include "grit/ui_resources.h"
#include "net/base/mime_util.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/codec/png_codec.h"
@@ -108,8 +107,7 @@ void WallpaperThumbnailSource::StartDataRequest(const std::string& path,
if (idr != -1) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
const ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- SendResponse(request_id, rb.LoadDataResourceBytes(idr,
- ui::SCALE_FACTOR_100P));
+ SendResponse(request_id, rb.LoadDataResourceBytes(idr));
}
}
diff --git a/chrome/browser/ui/webui/options2/options_ui2.cc b/chrome/browser/ui/webui/options2/options_ui2.cc
index 8edd569..33b13b7 100644
--- a/chrome/browser/ui/webui/options2/options_ui2.cc
+++ b/chrome/browser/ui/webui/options2/options_ui2.cc
@@ -57,7 +57,6 @@
#include "grit/theme_resources.h"
#include "grit/theme_resources_standard.h"
#include "net/base/escape.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#if defined(OS_CHROMEOS)
@@ -150,11 +149,11 @@ void OptionsUIHTMLSource::StartDataRequest(const std::string& path,
} else if (path == kOptionsBundleJsFile) {
// Return (and cache) the options javascript code.
response_bytes = ResourceBundle::GetSharedInstance().LoadDataResourceBytes(
- IDR_OPTIONS2_BUNDLE_JS, ui::SCALE_FACTOR_NONE);
+ IDR_OPTIONS2_BUNDLE_JS);
} else {
// Return (and cache) the main options html page as the default.
response_bytes = ResourceBundle::GetSharedInstance().LoadDataResourceBytes(
- IDR_OPTIONS2_HTML, ui::SCALE_FACTOR_NONE);
+ IDR_OPTIONS2_HTML);
}
SendResponse(request_id, response_bytes);
@@ -356,8 +355,7 @@ void OptionsUI::ProcessAutocompleteSuggestions(
// static
base::RefCountedMemory* OptionsUI::GetFaviconResourceBytes() {
return ResourceBundle::GetSharedInstance().
- LoadDataResourceBytes(IDR_SETTINGS_FAVICON,
- ui::SCALE_FACTOR_100P);
+ LoadDataResourceBytes(IDR_SETTINGS_FAVICON);
}
void OptionsUI::InitializeHandlers() {
diff --git a/chrome/browser/ui/webui/plugins_ui.cc b/chrome/browser/ui/webui/plugins_ui.cc
index 901ff58..34aef3c 100644
--- a/chrome/browser/ui/webui/plugins_ui.cc
+++ b/chrome/browser/ui/webui/plugins_ui.cc
@@ -19,9 +19,9 @@
#include "base/values.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/plugin_prefs.h"
+#include "chrome/browser/prefs/scoped_user_pref_update.h"
#include "chrome/browser/prefs/pref_member.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/prefs/scoped_user_pref_update.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
@@ -42,7 +42,6 @@
#include "grit/theme_resources.h"
#include "grit/theme_resources_standard.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#include "webkit/plugins/npapi/plugin_group.h"
@@ -484,7 +483,7 @@ PluginsUI::PluginsUI(content::WebUI* web_ui) : WebUIController(web_ui) {
// static
base::RefCountedMemory* PluginsUI::GetFaviconResourceBytes() {
return ResourceBundle::GetSharedInstance().
- LoadDataResourceBytes(IDR_PLUGIN, ui::SCALE_FACTOR_100P);
+ LoadDataResourceBytes(IDR_PLUGIN);
}
// static
diff --git a/chrome/browser/ui/webui/sessions_ui.cc b/chrome/browser/ui/webui/sessions_ui.cc
index cb68200..3743b31 100644
--- a/chrome/browser/ui/webui/sessions_ui.cc
+++ b/chrome/browser/ui/webui/sessions_ui.cc
@@ -28,7 +28,6 @@
#include "grit/theme_resources.h"
#include "grit/theme_resources_standard.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
using content::WebContents;
@@ -271,6 +270,5 @@ SessionsUI::SessionsUI(content::WebUI* web_ui) : WebUIController(web_ui) {
// static
base::RefCountedMemory* SessionsUI::GetFaviconResourceBytes() {
return ResourceBundle::GetSharedInstance().
- LoadDataResourceBytes(IDR_HISTORY_FAVICON,
- ui::SCALE_FACTOR_100P);
+ LoadDataResourceBytes(IDR_HISTORY_FAVICON);
}
diff --git a/chrome/browser/ui/webui/shared_resources_data_source.cc b/chrome/browser/ui/webui/shared_resources_data_source.cc
index 2d6630b..378b8e3 100644
--- a/chrome/browser/ui/webui/shared_resources_data_source.cc
+++ b/chrome/browser/ui/webui/shared_resources_data_source.cc
@@ -76,7 +76,7 @@ void SharedResourcesDataSource::StartDataRequest(const std::string& path,
DCHECK_NE(-1, idr) << " path: " << path;
const ResourceBundle& rb = ResourceBundle::GetSharedInstance();
scoped_refptr<base::RefCountedStaticMemory> bytes(
- rb.LoadDataResourceBytes(idr, ui::SCALE_FACTOR_NONE));
+ rb.LoadDataResourceBytes(idr));
SendResponse(request_id, bytes);
}
diff --git a/chrome/browser/ui/webui/theme_source.cc b/chrome/browser/ui/webui/theme_source.cc
index b51c05d..2c2a59b 100644
--- a/chrome/browser/ui/webui/theme_source.cc
+++ b/chrome/browser/ui/webui/theme_source.cc
@@ -6,7 +6,6 @@
#include "base/memory/ref_counted_memory.h"
#include "base/message_loop.h"
-#include "base/string_number_conversions.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/resources_util.h"
#include "chrome/browser/themes/theme_service.h"
@@ -16,60 +15,21 @@
#include "chrome/common/url_constants.h"
#include "content/public/browser/browser_thread.h"
#include "googleurl/src/gurl.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/theme_provider.h"
using content::BrowserThread;
-namespace {
-
// use a resource map rather than hard-coded strings.
static const char* kNewTabCSSPath = "css/new_tab_theme.css";
static const char* kNewIncognitoTabCSSPath = "css/incognito_new_tab_theme.css";
-struct ScaleFactorMap {
- const char* name;
- ui::ScaleFactor scale_factor;
-};
-
-const ScaleFactorMap kScaleFactorMap[] = {
- { "1x", ui::SCALE_FACTOR_100P },
- { "2x", ui::SCALE_FACTOR_200P },
-};
-
-std::string StripQueryParams(const std::string& path) {
+static std::string StripQueryParams(const std::string& path) {
GURL path_url = GURL(std::string(chrome::kChromeUIScheme) + "://" +
std::string(chrome::kChromeUIThemePath) + "/" + path);
return path_url.path().substr(1); // path() always includes a leading '/'.
}
-std::string ParsePathAndScale(const std::string& path,
- ui::ScaleFactor* scale_factor) {
- // Our path may include cachebuster arguments, so trim them off.
- std::string uncached_path = StripQueryParams(path);
- if (scale_factor)
- *scale_factor = ui::SCALE_FACTOR_100P;
-
- // Detect and parse resource string ending in @<scale>x.
- std::size_t pos = uncached_path.rfind('@');
- if (pos != std::string::npos) {
- if (scale_factor) {
- for (size_t i = 0; i < arraysize(kScaleFactorMap); i++) {
- if (uncached_path.compare(pos + 1, uncached_path.length() - pos - 1,
- kScaleFactorMap[i].name) == 0) {
- *scale_factor = kScaleFactorMap[i].scale_factor;
- }
- }
- }
- // Strip scale factor specification from path.
- uncached_path = uncached_path.substr(0, pos);
- }
- return uncached_path;
-}
-
-} // namespace
-
////////////////////////////////////////////////////////////////////////////////
// ThemeSource, public:
@@ -86,9 +46,8 @@ ThemeSource::~ThemeSource() {
void ThemeSource::StartDataRequest(const std::string& path,
bool is_incognito,
int request_id) {
- // Default scale factor if not specified.
- ui::ScaleFactor scale_factor;
- std::string uncached_path = ParsePathAndScale(path, &scale_factor);
+ // Our path may include cachebuster arguments, so trim them off.
+ std::string uncached_path = StripQueryParams(path);
if (uncached_path == kNewTabCSSPath ||
uncached_path == kNewIncognitoTabCSSPath) {
@@ -101,7 +60,7 @@ void ThemeSource::StartDataRequest(const std::string& path,
} else {
int resource_id = ResourcesUtil::GetThemeResourceId(uncached_path);
if (resource_id != -1) {
- SendThemeBitmap(request_id, resource_id, scale_factor);
+ SendThemeBitmap(request_id, resource_id);
return;
}
}
@@ -110,7 +69,7 @@ void ThemeSource::StartDataRequest(const std::string& path,
}
std::string ThemeSource::GetMimeType(const std::string& path) const {
- std::string uncached_path = ParsePathAndScale(path, NULL);
+ std::string uncached_path = StripQueryParams(path);
if (uncached_path == kNewTabCSSPath ||
uncached_path == kNewIncognitoTabCSSPath) {
@@ -122,7 +81,7 @@ std::string ThemeSource::GetMimeType(const std::string& path) const {
MessageLoop* ThemeSource::MessageLoopForRequestPath(
const std::string& path) const {
- std::string uncached_path = ParsePathAndScale(path, NULL);
+ std::string uncached_path = StripQueryParams(path);
if (uncached_path == kNewTabCSSPath ||
uncached_path == kNewIncognitoTabCSSPath) {
@@ -148,22 +107,18 @@ bool ThemeSource::ShouldReplaceExistingSource() const {
////////////////////////////////////////////////////////////////////////////////
// ThemeSource, private:
-void ThemeSource::SendThemeBitmap(int request_id,
- int resource_id,
- ui::ScaleFactor scale_factor) {
+void ThemeSource::SendThemeBitmap(int request_id, int resource_id) {
if (ThemeService::IsThemeableImage(resource_id)) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
ui::ThemeProvider* tp = ThemeServiceFactory::GetForProfile(profile_);
DCHECK(tp);
- // TODO(flackr): Pass scale factor when fetching themeable images.
scoped_refptr<base::RefCountedMemory> image_data(tp->GetRawData(
resource_id));
SendResponse(request_id, image_data);
} else {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
const ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- SendResponse(request_id,
- rb.LoadDataResourceBytes(resource_id, scale_factor));
+ SendResponse(request_id, rb.LoadDataResourceBytes(resource_id));
}
}
diff --git a/chrome/browser/ui/webui/theme_source.h b/chrome/browser/ui/webui/theme_source.h
index 5b58d1c..9e6c30e 100644
--- a/chrome/browser/ui/webui/theme_source.h
+++ b/chrome/browser/ui/webui/theme_source.h
@@ -9,7 +9,6 @@
#include <string>
#include "chrome/browser/ui/webui/chrome_url_data_manager.h"
-#include "ui/base/layout.h"
class Profile;
@@ -39,9 +38,7 @@ class ThemeSource : public ChromeURLDataManager::DataSource {
private:
// Fetch and send the theme bitmap.
- void SendThemeBitmap(int request_id,
- int resource_id,
- ui::ScaleFactor scale_factor);
+ void SendThemeBitmap(int request_id, int resource_id);
// The original profile (never an OTR profile).
Profile* profile_;
diff --git a/chrome/browser/ui/webui/web_ui_browsertest.cc b/chrome/browser/ui/webui/web_ui_browsertest.cc
index ac95ea2..2a7e0bf 100644
--- a/chrome/browser/ui/webui/web_ui_browsertest.cc
+++ b/chrome/browser/ui/webui/web_ui_browsertest.cc
@@ -322,7 +322,7 @@ void WebUIBrowserTest::SetUpInProcessBrowserTestFixture() {
FilePath resources_pack_path;
PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path);
ResourceBundle::GetSharedInstance().AddDataPack(
- resources_pack_path, ui::SCALE_FACTOR_100P);
+ resources_pack_path, ui::ResourceHandle::kScaleFactor100x);
FilePath mockPath;
ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &mockPath));
diff --git a/chrome/browser/ui/webui/web_ui_util.cc b/chrome/browser/ui/webui/web_ui_util.cc
index 46d2824..4ef88e0 100644
--- a/chrome/browser/ui/webui/web_ui_util.cc
+++ b/chrome/browser/ui/webui/web_ui_util.cc
@@ -11,7 +11,6 @@
#include "base/memory/ref_counted_memory.h"
#include "base/values.h"
#include "chrome/browser/disposition_utils.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/codec/png_codec.h"
@@ -31,8 +30,7 @@ std::string GetImageDataUrl(const SkBitmap& bitmap) {
std::string GetImageDataUrlFromResource(int res) {
// Load resource icon and covert to base64 encoded data url
base::RefCountedStaticMemory* icon_data =
- ResourceBundle::GetSharedInstance().LoadDataResourceBytes(res,
- ui::SCALE_FACTOR_100P);
+ ResourceBundle::GetSharedInstance().LoadDataResourceBytes(res);
if (!icon_data)
return std::string();
scoped_refptr<base::RefCountedMemory> raw_icon(icon_data);
diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc
index 040c8b0..369bc0a 100644
--- a/chrome/common/chrome_content_client.cc
+++ b/chrome/common/chrome_content_client.cc
@@ -9,9 +9,9 @@
#include "base/path_service.h"
#include "base/process_util.h"
#include "base/string_number_conversions.h"
+#include "base/stringprintf.h"
#include "base/string_split.h"
#include "base/string_util.h"
-#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
#include "chrome/common/child_process_logging.h"
#include "chrome/common/chrome_paths.h"
@@ -25,7 +25,6 @@
#include "grit/common_resources.h"
#include "remoting/client/plugin/pepper_entrypoints.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#include "webkit/glue/user_agent.h"
#include "webkit/plugins/npapi/plugin_list.h"
@@ -416,11 +415,16 @@ string16 ChromeContentClient::GetLocalizedString(int message_id) const {
return l10n_util::GetStringUTF16(message_id);
}
-base::StringPiece ChromeContentClient::GetDataResource(
+base::StringPiece ChromeContentClient::GetDataResource(int resource_id) const {
+ return ResourceBundle::GetSharedInstance().GetRawDataResource(resource_id);
+}
+
+base::StringPiece ChromeContentClient::GetImageResource(
int resource_id,
- ui::ScaleFactor scale_factor) const {
- return ResourceBundle::GetSharedInstance().GetRawDataResource(
- resource_id, scale_factor);
+ float scale_factor) const {
+ // TODO(flackr): Pass scale_factor to ResourceBundle to get best matching
+ // image resource for the given scale factor.
+ return ResourceBundle::GetSharedInstance().GetRawDataResource(resource_id);
}
#if defined(OS_WIN)
diff --git a/chrome/common/chrome_content_client.h b/chrome/common/chrome_content_client.h
index e6074d5..a69cd87 100644
--- a/chrome/common/chrome_content_client.h
+++ b/chrome/common/chrome_content_client.h
@@ -33,9 +33,9 @@ class ChromeContentClient : public content::ContentClient {
virtual bool CanHandleWhileSwappedOut(const IPC::Message& msg) OVERRIDE;
virtual std::string GetUserAgent() const OVERRIDE;
virtual string16 GetLocalizedString(int message_id) const OVERRIDE;
- virtual base::StringPiece GetDataResource(
- int resource_id,
- ui::ScaleFactor scale_factor) const OVERRIDE;
+ virtual base::StringPiece GetDataResource(int resource_id) const OVERRIDE;
+ virtual base::StringPiece GetImageResource(int resource_id,
+ float scale_factor) const OVERRIDE;
#if defined(OS_WIN)
virtual bool SandboxPlugin(CommandLine* command_line,
diff --git a/chrome/common/extensions/api/extension_api.cc b/chrome/common/extensions/api/extension_api.cc
index 16458f8..b713a27 100644
--- a/chrome/common/extensions/api/extension_api.cc
+++ b/chrome/common/extensions/api/extension_api.cc
@@ -23,7 +23,6 @@
#include "googleurl/src/gurl.h"
#include "grit/common_resources.h"
#include "grit/extensions_api_resources.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
using base::DictionaryValue;
@@ -62,8 +61,7 @@ bool HasUnprivilegedChild(const DictionaryValue* name_space_node,
}
base::StringPiece ReadFromResource(int resource_id) {
- return ResourceBundle::GetSharedInstance().GetRawDataResource(
- resource_id, ui::SCALE_FACTOR_NONE);
+ return ResourceBundle::GetSharedInstance().GetRawDataResource(resource_id);
}
scoped_ptr<ListValue> LoadSchemaList(const std::string& name,
diff --git a/chrome/common/extensions/simple_feature_provider.cc b/chrome/common/extensions/simple_feature_provider.cc
index d17c360..08bed31 100644
--- a/chrome/common/extensions/simple_feature_provider.cc
+++ b/chrome/common/extensions/simple_feature_provider.cc
@@ -9,7 +9,6 @@
#include "chrome/common/extensions/manifest_feature.h"
#include "chrome/common/extensions/permission_feature.h"
#include "grit/common_resources.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
namespace extensions {
@@ -43,7 +42,7 @@ struct Static {
int resource_id) {
std::string manifest_features =
ResourceBundle::GetSharedInstance().GetRawDataResource(
- resource_id, ui::SCALE_FACTOR_NONE).as_string();
+ resource_id).as_string();
int error_code = 0;
std::string error_message;
Value* value = base::JSONReader::ReadAndReturnError(
diff --git a/chrome/common/jstemplate_builder.cc b/chrome/common/jstemplate_builder.cc
index 31c0c4d..9d0d46b 100644
--- a/chrome/common/jstemplate_builder.cc
+++ b/chrome/common/jstemplate_builder.cc
@@ -12,7 +12,6 @@
#include "base/logging.h"
#include "base/string_util.h"
#include "grit/common_resources.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
namespace {
@@ -92,7 +91,7 @@ void AppendJsTemplateSourceHtml(std::string* output) {
// fetch and cache the pointer of the jstemplate resource source text.
static const base::StringPiece jstemplate_src(
ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_JSTEMPLATE_JS, ui::SCALE_FACTOR_NONE));
+ IDR_JSTEMPLATE_JS));
if (jstemplate_src.empty()) {
NOTREACHED() << "Unable to get jstemplate src";
@@ -118,10 +117,10 @@ void AppendI18nTemplateSourceHtml(std::string* output) {
// fetch and cache the pointer of the jstemplate resource source text.
static const base::StringPiece i18n_template_src(
ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_I18N_TEMPLATE_JS, ui::SCALE_FACTOR_NONE));
+ IDR_I18N_TEMPLATE_JS));
static const base::StringPiece i18n_template2_src(
ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_I18N_TEMPLATE2_JS, ui::SCALE_FACTOR_NONE));
+ IDR_I18N_TEMPLATE2_JS));
const base::StringPiece* template_src = g_version2 ?
&i18n_template2_src : &i18n_template_src;
@@ -141,7 +140,7 @@ void AppendI18nTemplateProcessHtml(std::string* output) {
static const base::StringPiece i18n_process_src(
ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_I18N_PROCESS_JS, ui::SCALE_FACTOR_NONE));
+ IDR_I18N_PROCESS_JS));
if (i18n_process_src.empty()) {
NOTREACHED() << "Unable to get i18n process src";
diff --git a/chrome/common/net/net_resource_provider.cc b/chrome/common/net/net_resource_provider.cc
index db1a8ba..abea5f4 100644
--- a/chrome/common/net/net_resource_provider.cc
+++ b/chrome/common/net/net_resource_provider.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -13,7 +13,6 @@
#include "grit/generated_resources.h"
#include "grit/net_resources.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
namespace {
@@ -41,7 +40,7 @@ struct LazyDirectoryListerCacher {
l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)));
html_data = jstemplate_builder::GetI18nTemplateHtml(
ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_DIR_HEADER_HTML, ui::SCALE_FACTOR_NONE),
+ IDR_DIR_HEADER_HTML),
&value);
}
@@ -58,8 +57,7 @@ base::StringPiece NetResourceProvider(int key) {
if (IDR_DIR_HEADER_HTML == key)
return base::StringPiece(lazy_dir_lister.html_data);
- return ResourceBundle::GetSharedInstance().GetRawDataResource(
- key, ui::SCALE_FACTOR_NONE);
+ return ResourceBundle::GetSharedInstance().GetRawDataResource(key);
}
} // namespace chrome_common_net
diff --git a/chrome/common/web_apps.cc b/chrome/common/web_apps.cc
index 1564754..bfcf199 100644
--- a/chrome/common/web_apps.cc
+++ b/chrome/common/web_apps.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -25,7 +25,6 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/size.h"
#include "webkit/glue/dom_operations.h"
@@ -217,8 +216,7 @@ bool ParseWebAppFromDefinitionFile(Value* definition_value,
scoped_ptr<Value> schema(
base::JSONReader::ReadAndReturnError(
ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_WEB_APP_SCHEMA,
- ui::SCALE_FACTOR_NONE).as_string(),
+ IDR_WEB_APP_SCHEMA).as_string(),
base::JSON_PARSE_RFC, // options
&error_code,
&error_message));
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc
index 7450dde..4013b92f 100644
--- a/chrome/renderer/chrome_content_renderer_client.cc
+++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -18,11 +18,11 @@
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/content_settings_pattern.h"
+#include "chrome/common/external_ipc_fuzzer.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/extensions/extension_process_policy.h"
#include "chrome/common/extensions/extension_set.h"
-#include "chrome/common/external_ipc_fuzzer.h"
#include "chrome/common/jstemplate_builder.h"
#include "chrome/common/render_messages.h"
#include "chrome/common/url_constants.h"
@@ -83,7 +83,6 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLError.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLRequest.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#include "webkit/plugins/npapi/plugin_list.h"
#include "webkit/plugins/ppapi/plugin_module.h"
@@ -660,8 +659,7 @@ void ChromeContentRendererClient::GetNavigationErrorStrings(
}
const base::StringPiece template_html(
- ResourceBundle::GetSharedInstance().GetRawDataResource(
- resource_id, ui::SCALE_FACTOR_NONE));
+ ResourceBundle::GetSharedInstance().GetRawDataResource(resource_id));
if (template_html.empty()) {
NOTREACHED() << "unable to load template. ID: " << resource_id;
} else {
diff --git a/chrome/renderer/extensions/extension_dispatcher.cc b/chrome/renderer/extensions/extension_dispatcher.cc
index 30876ca..9706f67 100644
--- a/chrome/renderer/extensions/extension_dispatcher.cc
+++ b/chrome/renderer/extensions/extension_dispatcher.cc
@@ -57,7 +57,6 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLRequest.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#include "v8/include/v8.h"
@@ -413,8 +412,7 @@ void ExtensionDispatcher::OnLoaded(
patterns.assign(platform_app_patterns);
WebView::addUserStyleSheet(
WebString::fromUTF8(ResourceBundle::GetSharedInstance().
- GetRawDataResource(IDR_PLATFORM_APP_CSS,
- ui::SCALE_FACTOR_NONE)),
+ GetRawDataResource(IDR_PLATFORM_APP_CSS)),
patterns,
WebView::UserContentInjectInAllFrames,
WebView::UserStyleInjectInExistingDocuments);
diff --git a/chrome/renderer/extensions/json_schema_unittest.cc b/chrome/renderer/extensions/json_schema_unittest.cc
index 8eb4581..c4b0614 100644
--- a/chrome/renderer/extensions/json_schema_unittest.cc
+++ b/chrome/renderer/extensions/json_schema_unittest.cc
@@ -9,7 +9,6 @@
#include "chrome/test/base/v8_unit_test.h"
#include "grit/renderer_resources.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
static const char kJsonSchema[] = "json_schema.js";
@@ -24,7 +23,7 @@ class JsonSchemaTest : public V8UnitTest {
// Add the json schema code to the context.
std::string code = ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_JSON_SCHEMA_JS, ui::SCALE_FACTOR_NONE).as_string();
+ IDR_JSON_SCHEMA_JS).as_string();
// json_schema.js expects to have requireNative() defined.
ExecuteScriptInContext(
diff --git a/chrome/renderer/extensions/user_script_slave.cc b/chrome/renderer/extensions/user_script_slave.cc
index 088dc56..9008381 100644
--- a/chrome/renderer/extensions/user_script_slave.cc
+++ b/chrome/renderer/extensions/user_script_slave.cc
@@ -8,10 +8,10 @@
#include "base/command_line.h"
#include "base/logging.h"
-#include "base/metrics/histogram.h"
#include "base/perftimer.h"
#include "base/pickle.h"
#include "base/shared_memory.h"
+#include "base/metrics/histogram.h"
#include "base/stringprintf.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_set.h"
@@ -27,10 +27,9 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h"
-#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLRequest.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h"
-#include "ui/base/layout.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
#include "ui/base/resource/resource_bundle.h"
using WebKit::WebFrame;
@@ -119,7 +118,7 @@ UserScriptSlave::UserScriptSlave(const ExtensionSet* extensions)
script_deleter_(&scripts_),
extensions_(extensions) {
api_js_ = ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_GREASEMONKEY_API_JS, ui::SCALE_FACTOR_NONE);
+ IDR_GREASEMONKEY_API_JS);
}
UserScriptSlave::~UserScriptSlave() {}
diff --git a/chrome/renderer/plugins/plugin_placeholder.cc b/chrome/renderer/plugins/plugin_placeholder.cc
index cf85d24..e87bbea 100644
--- a/chrome/renderer/plugins/plugin_placeholder.cc
+++ b/chrome/renderer/plugins/plugin_placeholder.cc
@@ -12,8 +12,8 @@
#include "base/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/common/jstemplate_builder.h"
-#include "chrome/common/prerender_messages.h"
#include "chrome/common/render_messages.h"
+#include "chrome/common/prerender_messages.h"
#include "chrome/renderer/chrome_content_renderer_client.h"
#include "chrome/renderer/custom_menu_commands.h"
#include "chrome/renderer/plugins/plugin_uma.h"
@@ -22,6 +22,9 @@
#include "grit/generated_resources.h"
#include "grit/renderer_resources.h"
#include "grit/webkit_strings.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebData.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPoint.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h"
@@ -33,11 +36,7 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptSource.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebTextCaseSensitivity.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
-#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebData.h"
-#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPoint.h"
-#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#include "webkit/glue/webpreferences.h"
#include "webkit/plugins/npapi/plugin_group.h"
@@ -102,7 +101,7 @@ PluginPlaceholder* PluginPlaceholder::CreateMissingPlugin(
const WebPluginParams& params) {
const base::StringPiece template_html(
ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_BLOCKED_PLUGIN_HTML, ui::SCALE_FACTOR_NONE));
+ IDR_BLOCKED_PLUGIN_HTML));
DictionaryValue values;
values.SetString("message", l10n_util::GetStringUTF8(IDS_PLUGIN_SEARCHING));
@@ -133,7 +132,7 @@ PluginPlaceholder* PluginPlaceholder::CreateErrorPlugin(
const base::StringPiece template_html(
ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_BLOCKED_PLUGIN_HTML, ui::SCALE_FACTOR_NONE));
+ IDR_BLOCKED_PLUGIN_HTML));
std::string html_data =
jstemplate_builder::GetI18nTemplateHtml(template_html, &values);
@@ -163,8 +162,7 @@ PluginPlaceholder* PluginPlaceholder::CreateBlockedPlugin(
values.SetString("hide", l10n_util::GetStringUTF8(IDS_PLUGIN_HIDE));
const base::StringPiece template_html(
- ResourceBundle::GetSharedInstance().GetRawDataResource(
- template_id, ui::SCALE_FACTOR_NONE));
+ ResourceBundle::GetSharedInstance().GetRawDataResource(template_id));
DCHECK(!template_html.empty()) << "unable to load template. ID: "
<< template_id;
@@ -187,7 +185,7 @@ PluginPlaceholder* PluginPlaceholder::CreateMobileYoutubePlugin(
const WebPluginParams& params) {
const base::StringPiece template_html(
ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_YOUTUBE_PLUGIN_HTML, ui::SCALE_FACTOR_NONE));
+ IDR_YOUTUBE_PLUGIN_HTML));
DictionaryValue values;
values.SetString("video_id", GetYoutubeVideoId(params));
diff --git a/chrome/renderer/resource_bundle_source_map.cc b/chrome/renderer/resource_bundle_source_map.cc
index 86ee68d..5a42582 100644
--- a/chrome/renderer/resource_bundle_source_map.cc
+++ b/chrome/renderer/resource_bundle_source_map.cc
@@ -4,7 +4,6 @@
#include "chrome/renderer/resource_bundle_source_map.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
ResourceBundleSourceMap::ResourceBundleSourceMap(
@@ -25,8 +24,7 @@ v8::Handle<v8::Value> ResourceBundleSourceMap::GetSource(
if (!Contains(name))
return v8::Undefined();
int resource_id = resource_id_map_[name];
- return ConvertString(resource_bundle_->GetRawDataResource(
- resource_id, ui::SCALE_FACTOR_NONE));
+ return ConvertString(resource_bundle_->GetRawDataResource(resource_id));
}
bool ResourceBundleSourceMap::Contains(const std::string& name) {
diff --git a/chrome/test/base/chrome_test_suite.cc b/chrome/test/base/chrome_test_suite.cc
index 3795306..842e58c 100644
--- a/chrome/test/base/chrome_test_suite.cc
+++ b/chrome/test/base/chrome_test_suite.cc
@@ -201,7 +201,7 @@ void ChromeTestSuite::Initialize() {
resources_pack_path =
resources_pack_path.Append(FILE_PATH_LITERAL("resources.pak"));
ResourceBundle::GetSharedInstance().AddDataPack(
- resources_pack_path, ui::SCALE_FACTOR_100P);
+ resources_pack_path, ui::ResourceHandle::kScaleFactor100x);
// Mock out the compositor on platforms that use it.
ui::SetupTestCompositor();
diff --git a/chrome/test/base/module_system_test.cc b/chrome/test/base/module_system_test.cc
index d6bb6d3..ce77a20 100644
--- a/chrome/test/base/module_system_test.cc
+++ b/chrome/test/base/module_system_test.cc
@@ -8,7 +8,6 @@
#include "base/memory/scoped_ptr.h"
#include "base/string_piece.h"
#include "chrome/renderer/native_handler.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#include <map>
@@ -99,8 +98,7 @@ void ModuleSystemTest::RegisterModule(const std::string& name,
void ModuleSystemTest::RegisterModule(const std::string& name,
int resource_id) {
const std::string& code = ResourceBundle::GetSharedInstance().
- GetRawDataResource(resource_id,
- ui::SCALE_FACTOR_NONE).as_string();
+ GetRawDataResource(resource_id).as_string();
source_map_->RegisterModule(name, code);
}
diff --git a/chrome/tools/mac_helpers/infoplist_strings_util.mm b/chrome/tools/mac_helpers/infoplist_strings_util.mm
index 051013b..270e07f 100644
--- a/chrome/tools/mac_helpers/infoplist_strings_util.mm
+++ b/chrome/tools/mac_helpers/infoplist_strings_util.mm
@@ -60,7 +60,7 @@ ui::DataPack* LoadResourceDataPack(const char* dir_path,
dir_path, branding_strings_name, locale_name];
if (resource_path) {
FilePath resources_pak_path([resource_path fileSystemRepresentation]);
- resource_pack = new ui::DataPack(ui::SCALE_FACTOR_100P);
+ resource_pack = new ui::DataPack(ui::ResourceHandle::kScaleFactor100x);
bool success = resource_pack->Load(resources_pak_path);
if (!success) {
delete resource_pack;