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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 155 |
156 // Registers the overscan insets for the display of the specified ID. Note | 156 // Registers the overscan insets for the display of the specified ID. Note |
157 // that the insets size should be specified in DIP size. It also triggers the | 157 // that the insets size should be specified in DIP size. It also triggers the |
158 // display's bounds change. | 158 // display's bounds change. |
159 void SetOverscanInsets(int64 display_id, const gfx::Insets& insets_in_dip); | 159 void SetOverscanInsets(int64 display_id, const gfx::Insets& insets_in_dip); |
160 | 160 |
161 // Sets the display's rotation. | 161 // Sets the display's rotation. |
162 void SetDisplayRotation(int64 display_id, gfx::Display::Rotation rotation); | 162 void SetDisplayRotation(int64 display_id, gfx::Display::Rotation rotation); |
163 | 163 |
164 // Sets the display's ui scale. | 164 // Sets the display's ui scale. |
| 165 // TODO(mukai): remove this and merge into SetDisplayMode. |
165 void SetDisplayUIScale(int64 display_id, float ui_scale); | 166 void SetDisplayUIScale(int64 display_id, float ui_scale); |
166 | 167 |
167 // Sets the display's resolution. | 168 // Sets the display's resolution. |
| 169 // TODO(mukai): remove this and merge into SetDisplayMode. |
168 void SetDisplayResolution(int64 display_id, const gfx::Size& resolution); | 170 void SetDisplayResolution(int64 display_id, const gfx::Size& resolution); |
169 | 171 |
| 172 // Sets the external display's configuration, including resolution change, |
| 173 // ui-scale change, and device scale factor change. Returns true if it changes |
| 174 // the display resolution so that the caller needs to show a notification in |
| 175 // case the new resolution actually doesn't work. |
| 176 bool SetDisplayMode(int64 display_id, const DisplayMode& display_mode); |
| 177 |
170 // Register per display properties. |overscan_insets| is NULL if | 178 // Register per display properties. |overscan_insets| is NULL if |
171 // the display has no custom overscan insets. | 179 // the display has no custom overscan insets. |
172 void RegisterDisplayProperty(int64 display_id, | 180 void RegisterDisplayProperty(int64 display_id, |
173 gfx::Display::Rotation rotation, | 181 gfx::Display::Rotation rotation, |
174 float ui_scale, | 182 float ui_scale, |
175 const gfx::Insets* overscan_insets, | 183 const gfx::Insets* overscan_insets, |
176 const gfx::Size& resolution_in_pixels, | 184 const gfx::Size& resolution_in_pixels, |
177 ui::ColorCalibrationProfile color_profile); | 185 ui::ColorCalibrationProfile color_profile); |
178 | 186 |
179 // Returns the display's selected mode. | 187 // Returns the display mode of |display_id| which is currently used. |
| 188 DisplayMode GetActiveModeForDisplayId(int64 display_id) const; |
| 189 |
| 190 // Returns the display's selected mode. This returns false and doesn't |
| 191 // set |mode_out| if the display mode is in default. |
180 bool GetSelectedModeForDisplayId(int64 display_id, | 192 bool GetSelectedModeForDisplayId(int64 display_id, |
181 DisplayMode* mode_out) const; | 193 DisplayMode* mode_out) const; |
182 | 194 |
183 // Tells if the virtual resolution feature is enabled. | 195 // Tells if the virtual resolution feature is enabled. |
184 bool IsDisplayUIScalingEnabled() const; | 196 bool IsDisplayUIScalingEnabled() const; |
185 | 197 |
186 // Returns the current overscan insets for the specified |display_id|. | 198 // Returns the current overscan insets for the specified |display_id|. |
187 // Returns an empty insets (0, 0, 0, 0) if no insets are specified for | 199 // Returns an empty insets (0, 0, 0, 0) if no insets are specified for |
188 // the display. | 200 // the display. |
189 gfx::Insets GetOverscanInsets(int64 display_id) const; | 201 gfx::Insets GetOverscanInsets(int64 display_id) const; |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 SecondDisplayMode second_display_mode_; | 373 SecondDisplayMode second_display_mode_; |
362 int64 mirrored_display_id_; | 374 int64 mirrored_display_id_; |
363 gfx::Display non_desktop_display_; | 375 gfx::Display non_desktop_display_; |
364 | 376 |
365 DISALLOW_COPY_AND_ASSIGN(DisplayManager); | 377 DISALLOW_COPY_AND_ASSIGN(DisplayManager); |
366 }; | 378 }; |
367 | 379 |
368 } // namespace ash | 380 } // namespace ash |
369 | 381 |
370 #endif // ASH_DISPLAY_DISPLAY_MANAGER_H_ | 382 #endif // ASH_DISPLAY_DISPLAY_MANAGER_H_ |
OLD | NEW |