| Index: ui/android/java/src/org/chromium/ui/gfx/DeviceDisplayInfo.java
|
| diff --git a/ui/android/java/src/org/chromium/ui/gfx/DeviceDisplayInfo.java b/ui/android/java/src/org/chromium/ui/gfx/DeviceDisplayInfo.java
|
| index 188c405c7c28cc1169e0b2640293632ccd3e82c4..1cde803306fda3c3aa07d3c57362552237530509 100644
|
| --- a/ui/android/java/src/org/chromium/ui/gfx/DeviceDisplayInfo.java
|
| +++ b/ui/android/java/src/org/chromium/ui/gfx/DeviceDisplayInfo.java
|
| @@ -8,6 +8,7 @@ import android.content.ComponentCallbacks;
|
| import android.content.Context;
|
| import android.content.res.Configuration;
|
| import android.graphics.PixelFormat;
|
| +import android.graphics.Point;
|
| import android.os.Build;
|
| import android.util.DisplayMetrics;
|
| import android.view.Display;
|
| @@ -51,6 +52,30 @@ public class DeviceDisplayInfo {
|
| return getMetrics().widthPixels;
|
| }
|
|
|
| + /**
|
| + * @return Display height in physical pixels (including onscreen buttons).
|
| + */
|
| + @CalledByNative
|
| + public int getRealDisplayHeight() {
|
| + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1)
|
| + return -1;
|
| + Point size = new Point();
|
| + getDisplay().getRealSize(size);
|
| + return size.y;
|
| + }
|
| +
|
| + /**
|
| + * @return Display width in physical pixels (including onscreen buttons).
|
| + */
|
| + @CalledByNative
|
| + public int getRealDisplayWidth() {
|
| + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1)
|
| + return -1;
|
| + Point size = new Point();
|
| + getDisplay().getRealSize(size);
|
| + return size.x;
|
| + }
|
| +
|
| @SuppressWarnings("deprecation")
|
| private int getPixelFormat() {
|
| if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
| @@ -141,8 +166,10 @@ public class DeviceDisplayInfo {
|
| }
|
|
|
| private void updateNativeSharedDisplayInfo() {
|
| - nativeUpdateSharedDeviceDisplayInfo(getDisplayHeight(),
|
| - getDisplayWidth(), getBitsPerPixel(), getBitsPerComponent(),
|
| + nativeUpdateSharedDeviceDisplayInfo(
|
| + getDisplayHeight(), getDisplayWidth(),
|
| + getRealDisplayHeight(), getRealDisplayWidth(),
|
| + getBitsPerPixel(), getBitsPerComponent(),
|
| getDIPScale(), getSmallestDIPWidth());
|
| }
|
|
|
| @@ -171,9 +198,10 @@ public class DeviceDisplayInfo {
|
| return deviceDisplayInfo;
|
| }
|
|
|
| - private native void nativeUpdateSharedDeviceDisplayInfo(int displayHeight,
|
| - int displayWidth, int bitsPerPixel,
|
| - int bitsPerComponent, double dipScale,
|
| + private native void nativeUpdateSharedDeviceDisplayInfo(
|
| + int displayHeight, int displayWidth,
|
| + int realDisplayHeight, int realDisplayWidth,
|
| + int bitsPerPixel, int bitsPerComponent, double dipScale,
|
| int smallestDIPWidth);
|
|
|
| }
|
|
|