summaryrefslogtreecommitdiffstats
path: root/content/browser/webui
diff options
context:
space:
mode:
authorpkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-15 22:23:21 +0000
committerpkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-15 22:23:21 +0000
commit3a80190d5f0c907f60d00467658401766d3cc4d8 (patch)
tree92b73d865923ba53d794b8d6293c48d7a015c3d2 /content/browser/webui
parent80d364ec445be64ce949f7c033cf510fd16ea36c (diff)
downloadchromium_src-3a80190d5f0c907f60d00467658401766d3cc4d8.zip
chromium_src-3a80190d5f0c907f60d00467658401766d3cc4d8.tar.gz
chromium_src-3a80190d5f0c907f60d00467658401766d3cc4d8.tar.bz2
Moves GetIconScaleFactor to WebUI::GetRendererScale in order to reuse code as many places in the C++ code push images to Javascript.
Bug=133032 Test=Compiles Review URL: https://chromiumcodereview.appspot.com/10535134 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142499 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/webui')
-rw-r--r--content/browser/webui/web_ui_impl.cc5
-rw-r--r--content/browser/webui/web_ui_impl.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/content/browser/webui/web_ui_impl.cc b/content/browser/webui/web_ui_impl.cc
index 1656b98..1050e61 100644
--- a/content/browser/webui/web_ui_impl.cc
+++ b/content/browser/webui/web_ui_impl.cc
@@ -9,6 +9,7 @@
#include "base/utf_string_conversions.h"
#include "base/values.h"
#include "content/browser/child_process_security_policy_impl.h"
+#include "content/browser/renderer_host/dip_util.h"
#include "content/browser/renderer_host/render_process_host_impl.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
@@ -116,6 +117,10 @@ WebContents* WebUIImpl::GetWebContents() const {
return web_contents_;
}
+float WebUIImpl::GetDeviceScale() const {
+ return GetDIPScaleFactor(web_contents_->GetRenderWidgetHostView());
+}
+
bool WebUIImpl::ShouldHideFavicon() const {
return hide_favicon_;
}
diff --git a/content/browser/webui/web_ui_impl.h b/content/browser/webui/web_ui_impl.h
index d0dfcab..e8f9ea1 100644
--- a/content/browser/webui/web_ui_impl.h
+++ b/content/browser/webui/web_ui_impl.h
@@ -33,6 +33,7 @@ class CONTENT_EXPORT WebUIImpl : public content::WebUI,
virtual content::WebContents* GetWebContents() const OVERRIDE;
virtual content::WebUIController* GetController() const OVERRIDE;
virtual void SetController(content::WebUIController* controller) OVERRIDE;
+ virtual float GetDeviceScale() const OVERRIDE;
virtual bool ShouldHideFavicon() const OVERRIDE;
virtual void HideFavicon() OVERRIDE;
virtual bool ShouldFocusLocationBarByDefault() const OVERRIDE;