Chromium Code Reviews| Index: ui/gfx/android/device_display_info.h |
| diff --git a/ui/gfx/android/device_display_info.h b/ui/gfx/android/device_display_info.h |
| index 74e0ada487507f05d3a5f8f8a9e6374eebf39654..ff9153a15c7cd4443aa94ef36cec13cefb0ba4dd 100644 |
| --- a/ui/gfx/android/device_display_info.h |
| +++ b/ui/gfx/android/device_display_info.h |
| @@ -8,6 +8,7 @@ |
| #include <jni.h> |
| #include <string> |
| +#include "base/android/jni_android.h" |
| #include "base/basictypes.h" |
| #include "ui/gfx/gfx_export.h" |
| @@ -18,6 +19,7 @@ namespace gfx { |
| class GFX_EXPORT DeviceDisplayInfo { |
| public: |
| DeviceDisplayInfo(); |
| + explicit DeviceDisplayInfo(jobject windowAndroid); |
|
boliu
2015/06/01 15:30:18
Can this be the native WindowAndroid type instead?
gsennton
2015/06/04 14:10:29
I get a presubmit error if I try to include ui/and
boliu
2015/06/05 04:57:51
Right, I have to internalize that ui/gfx is actual
|
| ~DeviceDisplayInfo(); |
| // Returns display height in physical pixels. |
| @@ -56,6 +58,32 @@ class GFX_EXPORT DeviceDisplayInfo { |
| // See DeviceDispayInfo.java for more information. |
| int GetRotationDegrees(); |
| + // Registers methods with JNI and returns true if succeeded. |
| + static bool RegisterDeviceDisplayInfo(JNIEnv* env); |
| + |
| + private: |
| + void UpdateDisplayInfo(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, |
| + jint rotation_degrees); |
| + |
| + base::android::ScopedJavaGlobalRef<jobject> j_device_info_; |
| + |
| + int display_height_; |
| + int display_width_; |
| + int physical_display_height_; |
| + int physical_display_width_; |
| + int bits_per_pixel_; |
| + int bits_per_component_; |
| + double dip_scale_; |
| + int smallest_dip_width_; |
| + int rotation_degrees_; |
| + |
| private: |
| DISALLOW_COPY_AND_ASSIGN(DeviceDisplayInfo); |
| }; |