summaryrefslogtreecommitdiffstats
path: root/content/shell
diff options
context:
space:
mode:
authorfischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-17 21:28:20 +0000
committerfischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-17 21:28:20 +0000
commit61a796c49a99e1e43e462ffd20a489f2142efcc8 (patch)
tree255809046b1d17f645b2fad9d3ecebf06c628915 /content/shell
parent3a62d03239d6e7aacdb94650aae6d962badc0c24 (diff)
downloadchromium_src-61a796c49a99e1e43e462ffd20a489f2142efcc8.zip
chromium_src-61a796c49a99e1e43e462ffd20a489f2142efcc8.tar.gz
chromium_src-61a796c49a99e1e43e462ffd20a489f2142efcc8.tar.bz2
Revert 137734 - Select theme resources from ResourceBundle at requested scale factor.
Return the best match for a requested scale factor when fetching raw image data from ResourceBundle. TBR=aa,abodenha BUG=123611 TEST=ResourceBundle.LoadImageResourceBytes Review URL: https://chromiumcodereview.appspot.com/10387010 TBR=flackr@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137738 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell')
-rw-r--r--content/shell/layout_test_controller_bindings.cc4
-rw-r--r--content/shell/shell_content_client.cc13
-rw-r--r--content/shell/shell_content_client.h6
-rw-r--r--content/shell/shell_devtools_delegate.cc4
4 files changed, 14 insertions, 13 deletions
diff --git a/content/shell/layout_test_controller_bindings.cc b/content/shell/layout_test_controller_bindings.cc
index 054b4f7..2f3a5ad 100644
--- a/content/shell/layout_test_controller_bindings.cc
+++ b/content/shell/layout_test_controller_bindings.cc
@@ -10,7 +10,6 @@
#include "grit/shell_resources.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
using WebKit::WebFrame;
@@ -21,8 +20,7 @@ namespace content {
namespace {
base::StringPiece GetStringResource(int resource_id) {
- return ResourceBundle::GetSharedInstance().GetRawDataResource(
- resource_id, ui::SCALE_FACTOR_NONE);
+ return ResourceBundle::GetSharedInstance().GetRawDataResource(resource_id);
}
RenderView* GetCurrentRenderView() {
diff --git a/content/shell/shell_content_client.cc b/content/shell/shell_content_client.cc
index c004593..e3c80d8 100644
--- a/content/shell/shell_content_client.cc
+++ b/content/shell/shell_content_client.cc
@@ -52,11 +52,16 @@ string16 ShellContentClient::GetLocalizedString(int message_id) const {
return string16();
}
-base::StringPiece ShellContentClient::GetDataResource(
+base::StringPiece ShellContentClient::GetDataResource(int resource_id) const {
+ return ResourceBundle::GetSharedInstance().GetRawDataResource(resource_id);
+}
+
+base::StringPiece ShellContentClient::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/content/shell/shell_content_client.h b/content/shell/shell_content_client.h
index 1d3aeda..d8b216e 100644
--- a/content/shell/shell_content_client.h
+++ b/content/shell/shell_content_client.h
@@ -31,9 +31,9 @@ class ShellContentClient : public 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/content/shell/shell_devtools_delegate.cc b/content/shell/shell_devtools_delegate.cc
index cf35cd1..15cdce8 100644
--- a/content/shell/shell_devtools_delegate.cc
+++ b/content/shell/shell_devtools_delegate.cc
@@ -9,7 +9,6 @@
#include "content/public/browser/devtools_http_handler.h"
#include "grit/shell_resources.h"
#include "net/url_request/url_request_context_getter.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
namespace content {
@@ -36,8 +35,7 @@ void ShellDevToolsDelegate::Stop() {
std::string ShellDevToolsDelegate::GetDiscoveryPageHTML() {
return ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE,
- ui::SCALE_FACTOR_NONE).as_string();
+ IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE).as_string();
}
bool ShellDevToolsDelegate::BundlesFrontendResources() {