Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef UI_GFX_ANDROID_DEVICE_INFO_H_ | |
| 6 #define UI_GFX_ANDROID_DEVICE_INFO_H_ | |
| 7 | |
| 8 #include <jni.h> | |
| 9 #include <string> | |
| 10 | |
| 11 #include "base/android/scoped_java_ref.h" | |
| 12 #include "base/basictypes.h" | |
| 13 | |
| 14 namespace gfx { | |
| 15 | |
| 16 // Facilitates access to device information typically only | |
| 17 // available using the Android SDK, including Display properties. | |
| 18 class DeviceInfo { | |
|
Yaron
2013/01/17 00:38:48
NIT: make this "class UI_EXPORT DeviceInfo" (for t
aruslan
2013/01/17 02:11:47
Done.
| |
| 19 public: | |
| 20 DeviceInfo(); | |
| 21 ~DeviceInfo(); | |
| 22 | |
| 23 // Returns display height in physical pixels. | |
| 24 int GetDisplayHeight(); | |
| 25 | |
| 26 // Returns display width in physical pixels. | |
| 27 int GetDisplayWidth(); | |
| 28 | |
| 29 // Returns number of bits per pixel. | |
| 30 int GetBitsPerPixel(); | |
| 31 | |
| 32 // Returns number of bits per component. | |
| 33 int GetBitsPerComponent(); | |
| 34 | |
| 35 // Returns a scaling factor for Density Independent Pixel unit | |
| 36 // (1.0 is 160dpi, 0.75 is 120dpi, 2.0 is 320dpi). | |
| 37 double GetDIPScale(); | |
| 38 | |
| 39 // Returns display refresh rate in number of frames per second. | |
| 40 double GetRefreshRate(); | |
| 41 | |
| 42 // Returns the ISO country code equivalent of the current MCC. | |
| 43 std::string GetNetworkCountryIso(); | |
| 44 | |
| 45 // Registers methods with JNI and returns true if succeeded. | |
| 46 static bool RegisterDeviceInfo(JNIEnv* env); | |
| 47 | |
| 48 private: | |
| 49 base::android::ScopedJavaGlobalRef<jobject> j_device_info_; | |
| 50 | |
| 51 DISALLOW_COPY_AND_ASSIGN(DeviceInfo); | |
| 52 }; | |
| 53 | |
| 54 } // namespace gfx | |
| 55 | |
| 56 #endif // UI_GFX_ANDROID_DEVICE_INFO_H_ | |
| OLD | NEW |