summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/common')
-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
7 files changed, 24 insertions, 28 deletions
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));