OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/gfx/android/device_display_info.h" | 5 #include "ui/gfx/android/device_display_info.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "jni/DeviceDisplayInfo_jni.h" | 10 #include "jni/DeviceDisplayInfo_jni.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 return static_cast<int>(result); | 51 return static_cast<int>(result); |
52 } | 52 } |
53 | 53 |
54 double DeviceDisplayInfo::GetDIPScale() { | 54 double DeviceDisplayInfo::GetDIPScale() { |
55 JNIEnv* env = AttachCurrentThread(); | 55 JNIEnv* env = AttachCurrentThread(); |
56 jdouble result = | 56 jdouble result = |
57 Java_DeviceDisplayInfo_getDIPScale(env, j_device_info_.obj()); | 57 Java_DeviceDisplayInfo_getDIPScale(env, j_device_info_.obj()); |
58 return static_cast<double>(result); | 58 return static_cast<double>(result); |
59 } | 59 } |
60 | 60 |
| 61 int DeviceDisplayInfo::GetSmallestDIPWidth() { |
| 62 JNIEnv* env = AttachCurrentThread(); |
| 63 jint result = |
| 64 Java_DeviceDisplayInfo_getSmallestDIPWidth(env, j_device_info_.obj()); |
| 65 return static_cast<int>(result); |
| 66 } |
| 67 |
61 // static | 68 // static |
62 bool DeviceDisplayInfo::RegisterDeviceDisplayInfo(JNIEnv* env) { | 69 bool DeviceDisplayInfo::RegisterDeviceDisplayInfo(JNIEnv* env) { |
63 return RegisterNativesImpl(env); | 70 return RegisterNativesImpl(env); |
64 } | 71 } |
65 | 72 |
66 } // namespace gfx | 73 } // namespace gfx |
OLD | NEW |