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 ASH_DISPLAY_DISPLAY_MANAGER_H_ | 5 #ifndef ASH_DISPLAY_DISPLAY_MANAGER_H_ |
6 #define ASH_DISPLAY_DISPLAY_MANAGER_H_ | 6 #define ASH_DISPLAY_DISPLAY_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 // that the insets size should be specified in DIP size. It also triggers the | 123 // that the insets size should be specified in DIP size. It also triggers the |
124 // display's bounds change. | 124 // display's bounds change. |
125 void SetOverscanInsets(int64 display_id, const gfx::Insets& insets_in_dip); | 125 void SetOverscanInsets(int64 display_id, const gfx::Insets& insets_in_dip); |
126 | 126 |
127 // Sets the display's rotation. | 127 // Sets the display's rotation. |
128 void SetDisplayRotation(int64 display_id, gfx::Display::Rotation rotation); | 128 void SetDisplayRotation(int64 display_id, gfx::Display::Rotation rotation); |
129 | 129 |
130 // Sets the display's ui scale. | 130 // Sets the display's ui scale. |
131 void SetDisplayUIScale(int64 display_id, float ui_scale); | 131 void SetDisplayUIScale(int64 display_id, float ui_scale); |
132 | 132 |
| 133 // Sets the display's resolution. |
| 134 void SetDisplayResolution(int64 display_id, const gfx::Size& resolution); |
| 135 |
133 // Register per display properties. |overscan_insets| is NULL if | 136 // Register per display properties. |overscan_insets| is NULL if |
134 // the display has no custom overscan insets. | 137 // the display has no custom overscan insets. |
135 void RegisterDisplayProperty(int64 display_id, | 138 void RegisterDisplayProperty(int64 display_id, |
136 gfx::Display::Rotation rotation, | 139 gfx::Display::Rotation rotation, |
137 float ui_scale, | 140 float ui_scale, |
138 const gfx::Insets* overscan_insets); | 141 const gfx::Insets* overscan_insets, |
| 142 const gfx::Size& resolution_in_pixels); |
| 143 |
| 144 // Returns the display's selected resolution. |
| 145 bool GetSelectedResolutionForDisplayId(int64 display_id, |
| 146 gfx::Size* resolution_out) const; |
139 | 147 |
140 // Tells if display rotation/ui scaling features are enabled. | 148 // Tells if display rotation/ui scaling features are enabled. |
141 bool IsDisplayRotationEnabled() const; | 149 bool IsDisplayRotationEnabled() const; |
142 bool IsDisplayUIScalingEnabled() const; | 150 bool IsDisplayUIScalingEnabled() const; |
143 | 151 |
144 // Returns the current overscan insets for the specified |display_id|. | 152 // Returns the current overscan insets for the specified |display_id|. |
145 // Returns an empty insets (0, 0, 0, 0) if no insets are specified for | 153 // Returns an empty insets (0, 0, 0, 0) if no insets are specified for |
146 // the display. | 154 // the display. |
147 gfx::Insets GetOverscanInsets(int64 display_id) const; | 155 gfx::Insets GetOverscanInsets(int64 display_id) const; |
148 | 156 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 // List of current active dispays. | 271 // List of current active dispays. |
264 DisplayList displays_; | 272 DisplayList displays_; |
265 | 273 |
266 int num_connected_displays_; | 274 int num_connected_displays_; |
267 | 275 |
268 bool force_bounds_changed_; | 276 bool force_bounds_changed_; |
269 | 277 |
270 // The mapping from the display ID to its internal data. | 278 // The mapping from the display ID to its internal data. |
271 std::map<int64, DisplayInfo> display_info_; | 279 std::map<int64, DisplayInfo> display_info_; |
272 | 280 |
| 281 // Selected resolutions for displays. Key is the displays' ID. |
| 282 std::map<int64, gfx::Size> resolutions_; |
| 283 |
273 // When set to true, the host window's resize event updates | 284 // When set to true, the host window's resize event updates |
274 // the display's size. This is set to true when running on | 285 // the display's size. This is set to true when running on |
275 // desktop environment (for debugging) so that resizing the host | 286 // desktop environment (for debugging) so that resizing the host |
276 // window wil update the display properly. This is set to false | 287 // window wil update the display properly. This is set to false |
277 // on device as well as during the unit tests. | 288 // on device as well as during the unit tests. |
278 bool change_display_upon_host_resize_; | 289 bool change_display_upon_host_resize_; |
279 | 290 |
280 bool software_mirroring_enabled_; | 291 bool software_mirroring_enabled_; |
281 | 292 |
282 DISALLOW_COPY_AND_ASSIGN(DisplayManager); | 293 DISALLOW_COPY_AND_ASSIGN(DisplayManager); |
283 }; | 294 }; |
284 | 295 |
285 } // namespace internal | 296 } // namespace internal |
286 } // namespace ash | 297 } // namespace ash |
287 | 298 |
288 #endif // ASH_DISPLAY_DISPLAY_MANAGER_H_ | 299 #endif // ASH_DISPLAY_DISPLAY_MANAGER_H_ |
OLD | NEW |