Index: ui/gfx/android/shared_device_display_info.cc |
diff --git a/ui/gfx/android/shared_device_display_info.cc b/ui/gfx/android/shared_device_display_info.cc |
index 9ac18d0218da6a024ed42031112a64a1e38b0d89..32dc73e54e10527852408d4cfcca57dcaff6484d 100644 |
--- a/ui/gfx/android/shared_device_display_info.cc |
+++ b/ui/gfx/android/shared_device_display_info.cc |
@@ -16,12 +16,16 @@ static void UpdateSharedDeviceDisplayInfo(JNIEnv* env, |
jobject obj, |
jint display_height, |
jint display_width, |
+ jint physical_display_height, |
+ jint physical_display_width, |
jint bits_per_pixel, |
jint bits_per_component, |
jdouble dip_scale, |
jint smallest_dip_width) { |
SharedDeviceDisplayInfo::GetInstance()->InvokeUpdate(env, obj, |
- display_height, display_width, bits_per_pixel, bits_per_component, |
+ display_height, display_width, |
+ physical_display_height, physical_display_width, |
+ bits_per_pixel, bits_per_component, |
dip_scale, smallest_dip_width); |
} |
@@ -42,6 +46,16 @@ int SharedDeviceDisplayInfo::GetDisplayWidth() { |
return display_width_; |
} |
+int SharedDeviceDisplayInfo::GetPhysicalDisplayHeight() { |
+ base::AutoLock autolock(lock_); |
+ return physical_display_height_; |
+} |
+ |
+int SharedDeviceDisplayInfo::GetPhysicalDisplayWidth() { |
+ base::AutoLock autolock(lock_); |
+ return physical_display_width_; |
+} |
+ |
int SharedDeviceDisplayInfo::GetBitsPerPixel() { |
base::AutoLock autolock(lock_); |
DCHECK_NE(0, bits_per_pixel_); |
@@ -75,14 +89,18 @@ void SharedDeviceDisplayInfo::InvokeUpdate(JNIEnv* env, |
jobject obj, |
jint display_height, |
jint display_width, |
+ jint physical_display_height, |
+ jint physical_display_width, |
jint bits_per_pixel, |
jint bits_per_component, |
jdouble dip_scale, |
jint smallest_dip_width) { |
base::AutoLock autolock(lock_); |
- UpdateDisplayInfo(env, obj, display_height, |
- display_width, bits_per_pixel, bits_per_component, dip_scale, |
+ UpdateDisplayInfo(env, obj, |
+ display_height, display_width, |
+ physical_display_height, physical_display_width, |
+ bits_per_pixel, bits_per_component, dip_scale, |
smallest_dip_width); |
} |
@@ -100,6 +118,9 @@ SharedDeviceDisplayInfo::SharedDeviceDisplayInfo() |
UpdateDisplayInfo(env, j_device_info_.obj(), |
Java_DeviceDisplayInfo_getDisplayHeight(env, j_device_info_.obj()), |
Java_DeviceDisplayInfo_getDisplayWidth(env, j_device_info_.obj()), |
+ Java_DeviceDisplayInfo_getPhysicalDisplayHeight(env, |
+ j_device_info_.obj()), |
+ Java_DeviceDisplayInfo_getPhysicalDisplayWidth(env, j_device_info_.obj()), |
Java_DeviceDisplayInfo_getBitsPerPixel(env, j_device_info_.obj()), |
Java_DeviceDisplayInfo_getBitsPerComponent(env, j_device_info_.obj()), |
Java_DeviceDisplayInfo_getDIPScale(env, j_device_info_.obj()), |
@@ -113,12 +134,16 @@ void SharedDeviceDisplayInfo::UpdateDisplayInfo(JNIEnv* env, |
jobject jobj, |
jint display_height, |
jint display_width, |
+ jint physical_display_height, |
+ jint physical_display_width, |
jint bits_per_pixel, |
jint bits_per_component, |
jdouble dip_scale, |
jint smallest_dip_width) { |
display_height_ = static_cast<int>(display_height); |
display_width_ = static_cast<int>(display_width); |
+ physical_display_height_ = static_cast<int>(physical_display_height); |
+ physical_display_width_ = static_cast<int>(physical_display_width); |
bits_per_pixel_ = static_cast<int>(bits_per_pixel); |
bits_per_component_ = static_cast<int>(bits_per_component); |
dip_scale_ = static_cast<double>(dip_scale); |