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

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

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 #include "ui/gfx/android/device_display_info.h" 5 #include "ui/gfx/android/device_display_info.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/gfx/android/shared_device_display_info.h" 8 #include "ui/gfx/android/shared_device_display_info.h"
9 9
10 namespace gfx { 10 namespace gfx {
11 11
12 DeviceDisplayInfo::DeviceDisplayInfo() { 12 DeviceDisplayInfo::DeviceDisplayInfo() {
13 } 13 }
14 14
15 DeviceDisplayInfo::~DeviceDisplayInfo() { 15 DeviceDisplayInfo::~DeviceDisplayInfo() {
16 } 16 }
17 17
18 int DeviceDisplayInfo::GetDisplayHeight() { 18 int DeviceDisplayInfo::GetDisplayHeight() {
19 return SharedDeviceDisplayInfo::GetInstance()->GetDisplayHeight(); 19 return SharedDeviceDisplayInfo::GetInstance()->GetDisplayHeight();
20 } 20 }
21 21
22 int DeviceDisplayInfo::GetDisplayWidth() { 22 int DeviceDisplayInfo::GetDisplayWidth() {
23 return SharedDeviceDisplayInfo::GetInstance()->GetDisplayWidth(); 23 return SharedDeviceDisplayInfo::GetInstance()->GetDisplayWidth();
24 } 24 }
25 25
26 int DeviceDisplayInfo::GetRealDisplayHeight(bool& supported) {
27 int height = SharedDeviceDisplayInfo::GetInstance()->GetRealDisplayHeight();
28 if (!(supported = height > 0))
no sievers 2013/12/20 19:51:19 And could we just return 0 here and below if not s
29 height = GetDisplayHeight();
30 return height;
31 }
32
33 int DeviceDisplayInfo::GetRealDisplayWidth(bool& supported) {
34 int width = SharedDeviceDisplayInfo::GetInstance()->GetRealDisplayWidth();
35 if (!(supported = width > 0))
36 width = GetDisplayWidth();
37 return width;
38 }
39
26 int DeviceDisplayInfo::GetBitsPerPixel() { 40 int DeviceDisplayInfo::GetBitsPerPixel() {
27 return SharedDeviceDisplayInfo::GetInstance()->GetBitsPerPixel(); 41 return SharedDeviceDisplayInfo::GetInstance()->GetBitsPerPixel();
28 } 42 }
29 43
30 int DeviceDisplayInfo::GetBitsPerComponent() { 44 int DeviceDisplayInfo::GetBitsPerComponent() {
31 return SharedDeviceDisplayInfo::GetInstance()->GetBitsPerComponent(); 45 return SharedDeviceDisplayInfo::GetInstance()->GetBitsPerComponent();
32 } 46 }
33 47
34 double DeviceDisplayInfo::GetDIPScale() { 48 double DeviceDisplayInfo::GetDIPScale() {
35 return SharedDeviceDisplayInfo::GetInstance()->GetDIPScale(); 49 return SharedDeviceDisplayInfo::GetInstance()->GetDIPScale();
36 } 50 }
37 51
38 int DeviceDisplayInfo::GetSmallestDIPWidth() { 52 int DeviceDisplayInfo::GetSmallestDIPWidth() {
39 return SharedDeviceDisplayInfo::GetInstance()->GetSmallestDIPWidth(); 53 return SharedDeviceDisplayInfo::GetInstance()->GetSmallestDIPWidth();
40 } 54 }
41 55
42 } // namespace gfx 56 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698