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

Unified Diff: Source/WebKit/chromium/src/ChromeClientImpl.cpp

Issue 11862015: Merge 139356 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 7 years, 11 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 | « Source/WebKit/chromium/ChangeLog ('k') | Source/WebKit/chromium/src/WebSettingsImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebKit/chromium/src/ChromeClientImpl.cpp
===================================================================
--- Source/WebKit/chromium/src/ChromeClientImpl.cpp (revision 139470)
+++ Source/WebKit/chromium/src/ChromeClientImpl.cpp (working copy)
@@ -170,17 +170,19 @@
FloatRect ChromeClientImpl::windowRect()
{
- WebRect rect;
- if (m_webView->client())
- rect = m_webView->client()->rootWindowRect();
- else {
- // These numbers will be fairly wrong. The window's x/y coordinates will
- // be the top left corner of the screen and the size will be the content
- // size instead of the window size.
- rect.width = m_webView->size().width;
- rect.height = m_webView->size().height;
+ if (m_webView->client()) {
+ // On Chrome for Android, rootWindowRect is in physical screen pixels
+ // instead of density independent (UI) pixels, and must be scaled down.
+ FloatRect rect = FloatRect(m_webView->client()->rootWindowRect());
+ if (!m_webView->page()->settings()->applyDeviceScaleFactorInCompositor())
+ rect.scale(1 / m_webView->client()->screenInfo().deviceScaleFactor);
+ return rect;
}
- return FloatRect(rect);
+
+ // These numbers will be fairly wrong. The window's x/y coordinates will
+ // be the top left corner of the screen and the size will be the content
+ // size instead of the window size.
+ return FloatRect(0, 0, m_webView->size().width, m_webView->size().height);
}
FloatRect ChromeClientImpl::pageRect()
« no previous file with comments | « Source/WebKit/chromium/ChangeLog ('k') | Source/WebKit/chromium/src/WebSettingsImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698