Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2263)

Unified Diff: content/browser/webui/web_ui_impl.cc

Issue 10535134: Add WebUI::GetDeviceScale (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nits Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/webui/web_ui_impl.h ('k') | content/public/browser/web_ui.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/webui/web_ui_impl.cc
diff --git a/content/browser/webui/web_ui_impl.cc b/content/browser/webui/web_ui_impl.cc
index 1656b984f668dbd98d6d5763bb632cab3ae9e2b1..1050e615d39991efa60b87e50ade9829faefb82c 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_;
}
« no previous file with comments | « content/browser/webui/web_ui_impl.h ('k') | content/public/browser/web_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698