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 #ifndef UI_GFX_DISPLAY_H_ | 5 #ifndef UI_GFX_DISPLAY_H_ |
6 #define UI_GFX_DISPLAY_H_ | 6 #define UI_GFX_DISPLAY_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
128 | 128 |
129 // Returns a string representation of the display; | 129 // Returns a string representation of the display; |
130 std::string ToString() const; | 130 std::string ToString() const; |
131 | 131 |
132 // True if the display contains valid display id. | 132 // True if the display contains valid display id. |
133 bool is_valid() const { return id_ != kInvalidDisplayID; } | 133 bool is_valid() const { return id_ != kInvalidDisplayID; } |
134 | 134 |
135 // True if the display corresponds to internal panel. | 135 // True if the display corresponds to internal panel. |
136 bool IsInternal() const; | 136 bool IsInternal() const; |
137 | 137 |
138 // True if the physical size information is available. | |
139 bool IsPhysicalSizeAvailable() const; | |
sky
2016/01/13 21:00:10
Is there a compelling reason to add api here? I do
Bret
2016/01/14 01:28:23
I talked with Scott and he's right, I'll revert th
| |
140 | |
141 // Gets/Sets the physical dimensions of the display in millimeters. | |
142 gfx::Size GetPhysicalSizeMm() const; | |
143 void SetPhysicalSizeMm(gfx::Size physical_size); | |
144 | |
138 // Gets/Sets an id of display corresponding to internal panel. | 145 // Gets/Sets an id of display corresponding to internal panel. |
139 static int64_t InternalDisplayId(); | 146 static int64_t InternalDisplayId(); |
140 static void SetInternalDisplayId(int64_t internal_display_id); | 147 static void SetInternalDisplayId(int64_t internal_display_id); |
141 | 148 |
142 // Test if the |id| is for the internal display if any. | 149 // Test if the |id| is for the internal display if any. |
143 static bool IsInternalDisplayId(int64_t id); | 150 static bool IsInternalDisplayId(int64_t id); |
144 | 151 |
145 // True if there is an internal display. | 152 // True if there is an internal display. |
146 static bool HasInternalDisplay(); | 153 static bool HasInternalDisplay(); |
147 | 154 |
148 private: | 155 private: |
149 int64_t id_; | 156 int64_t id_; |
150 Rect bounds_; | 157 Rect bounds_; |
151 Rect work_area_; | 158 Rect work_area_; |
152 float device_scale_factor_; | 159 float device_scale_factor_; |
153 Rotation rotation_; | 160 Rotation rotation_; |
154 TouchSupport touch_support_; | 161 TouchSupport touch_support_; |
162 gfx::Size physical_size_mm_; | |
155 }; | 163 }; |
156 | 164 |
157 } // namespace gfx | 165 } // namespace gfx |
158 | 166 |
159 #endif // UI_GFX_DISPLAY_H_ | 167 #endif // UI_GFX_DISPLAY_H_ |
OLD | NEW |