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 CONTENT_COMMON_ANDROID_DEVICE_INFO_H_ | |
6 #define CONTENT_COMMON_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 content { | |
15 | |
16 // Facilitates access to device information typically only | |
17 // available using the Android SDK, including Display properties. | |
18 class DeviceInfo { | |
19 public: | |
20 DeviceInfo(); | |
21 ~DeviceInfo(); | |
22 | |
23 int GetHeight(); | |
24 int GetWidth(); | |
25 int GetBitsPerPixel(); | |
26 int GetBitsPerComponent(); | |
27 double GetDPIScale(); | |
28 double GetRefreshRate(); | |
29 std::string GetNetworkCountryIso(); | |
30 | |
31 private: | |
32 base::android::ScopedJavaGlobalRef<jobject> j_device_info_; | |
33 | |
34 DISALLOW_COPY_AND_ASSIGN(DeviceInfo); | |
35 }; | |
36 | |
37 bool RegisterDeviceInfo(JNIEnv* env); | |
38 | |
39 } // namespace content | |
40 | |
41 #endif // CONTENT_COMMON_ANDROID_DEVICE_INFO_H_ | |
OLD | NEW |