summaryrefslogtreecommitdiffstats
path: root/android_webview
diff options
context:
space:
mode:
authorreveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-11 04:45:55 +0000
committerreveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-11 04:45:55 +0000
commit6785b0884ca7fd3e0ec9818ad335bd2b03888b2d (patch)
tree4098c5ab1eee10425cbfa6f06cd5b6005788235e /android_webview
parent25451015fdff3f7d6b26d8ebbc1cc6c539ca637a (diff)
downloadchromium_src-6785b0884ca7fd3e0ec9818ad335bd2b03888b2d.zip
chromium_src-6785b0884ca7fd3e0ec9818ad335bd2b03888b2d.tar.gz
chromium_src-6785b0884ca7fd3e0ec9818ad335bd2b03888b2d.tar.bz2
ui: Use physical size for gfx::Display on Android if available.
Use gfx::DeviceDisplayInfo::GetPhysicalDisplayWidth/Height() when avaialble as this is a more accurate value for display size as window decorations etc. have not been subtracted. BUG=365877 Review URL: https://codereview.chromium.org/374303002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282541 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview')
-rw-r--r--android_webview/javatests/src/org/chromium/android_webview/test/AwLegacyQuirksTest.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwLegacyQuirksTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwLegacyQuirksTest.java
index 6f70ec7..aed910c 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AwLegacyQuirksTest.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwLegacyQuirksTest.java
@@ -133,9 +133,13 @@ public class AwLegacyQuirksTest extends AwTestBase {
DeviceDisplayInfo deviceInfo =
DeviceDisplayInfo.create(getInstrumentation().getTargetContext());
float dipScale = (float) deviceInfo.getDIPScale();
- float physicalDisplayWidth = deviceInfo.getDisplayWidth();
+ float physicalDisplayWidth = deviceInfo.getPhysicalDisplayWidth() != 0 ?
+ deviceInfo.getPhysicalDisplayWidth() :
+ deviceInfo.getDisplayWidth();
float cssDisplayWidth = physicalDisplayWidth / dipScale;
- float physicalDisplayHeight = deviceInfo.getDisplayHeight();
+ float physicalDisplayHeight = deviceInfo.getPhysicalDisplayHeight() != 0 ?
+ deviceInfo.getPhysicalDisplayHeight() :
+ deviceInfo.getDisplayHeight();
float cssDisplayHeight = physicalDisplayHeight / dipScale;
float screenWidth = Integer.parseInt(