Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: ui/gfx/android/device_display_info.h

Issue 93933016: Android: Add support for returning real screen resolution. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Return supported boolean. Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef UI_GFX_ANDROID_DEVICE_DISPLAY_INFO_H_ 5 #ifndef UI_GFX_ANDROID_DEVICE_DISPLAY_INFO_H_
6 #define UI_GFX_ANDROID_DEVICE_DISPLAY_INFO_H_ 6 #define UI_GFX_ANDROID_DEVICE_DISPLAY_INFO_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 #include <string> 9 #include <string>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "ui/gfx/gfx_export.h" 12 #include "ui/gfx/gfx_export.h"
13 13
14 namespace gfx { 14 namespace gfx {
15 15
16 // Facilitates access to device information typically only 16 // Facilitates access to device information typically only
17 // available using the Android SDK, including Display properties. 17 // available using the Android SDK, including Display properties.
18 class GFX_EXPORT DeviceDisplayInfo { 18 class GFX_EXPORT DeviceDisplayInfo {
19 public: 19 public:
20 DeviceDisplayInfo(); 20 DeviceDisplayInfo();
21 ~DeviceDisplayInfo(); 21 ~DeviceDisplayInfo();
22 22
23 // Returns display height in physical pixels. 23 // Returns display height in physical pixels.
24 int GetDisplayHeight(); 24 int GetDisplayHeight();
25 25
26 // Returns display width in physical pixels. 26 // Returns display width in physical pixels.
27 int GetDisplayWidth(); 27 int GetDisplayWidth();
28 28
29 // Returns real display height in physical pixels.
30 // If this isn't supported, display width is returned.
31 int GetRealDisplayHeight(bool& supported);
32
33 // Returns real display width in physical pixels.
34 // If this isn't supported, display width is returned.
35 int GetRealDisplayWidth(bool& supported);
36
29 // Returns number of bits per pixel. 37 // Returns number of bits per pixel.
30 int GetBitsPerPixel(); 38 int GetBitsPerPixel();
31 39
32 // Returns number of bits per component. 40 // Returns number of bits per component.
33 int GetBitsPerComponent(); 41 int GetBitsPerComponent();
34 42
35 // Returns a scaling factor for Density Independent Pixel unit 43 // Returns a scaling factor for Density Independent Pixel unit
36 // (1.0 is 160dpi, 0.75 is 120dpi, 2.0 is 320dpi). 44 // (1.0 is 160dpi, 0.75 is 120dpi, 2.0 is 320dpi).
37 double GetDIPScale(); 45 double GetDIPScale();
38 46
39 // Smallest possible screen size in density-independent pixels. 47 // Smallest possible screen size in density-independent pixels.
40 int GetSmallestDIPWidth(); 48 int GetSmallestDIPWidth();
41 49
42 private: 50 private:
43 DISALLOW_COPY_AND_ASSIGN(DeviceDisplayInfo); 51 DISALLOW_COPY_AND_ASSIGN(DeviceDisplayInfo);
44 }; 52 };
45 53
46 } // namespace gfx 54 } // namespace gfx
47 55
48 #endif // UI_GFX_ANDROID_DEVICE_DISPLAY_INFO_H_ 56 #endif // UI_GFX_ANDROID_DEVICE_DISPLAY_INFO_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698