OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ | 5 #ifndef UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ |
6 #define UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ | 6 #define UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 // Returns the mode within |display| that matches the given size with highest | 130 // Returns the mode within |display| that matches the given size with highest |
131 // refresh rate. Returns None if no matching display was found. | 131 // refresh rate. Returns None if no matching display was found. |
132 static const DisplayMode* FindDisplayModeMatchingSize( | 132 static const DisplayMode* FindDisplayModeMatchingSize( |
133 const DisplaySnapshot& display, | 133 const DisplaySnapshot& display, |
134 const gfx::Size& size); | 134 const gfx::Size& size); |
135 | 135 |
136 DisplayConfigurator(); | 136 DisplayConfigurator(); |
137 virtual ~DisplayConfigurator(); | 137 virtual ~DisplayConfigurator(); |
138 | 138 |
139 MultipleDisplayState display_state() const { return display_state_; } | 139 MultipleDisplayState display_state() const { return display_state_; } |
140 chromeos::DisplayPowerState power_state() const { return power_state_; } | 140 chromeos::DisplayPowerState requested_power_state() const { |
| 141 return requested_power_state_; |
| 142 } |
141 const gfx::Size framebuffer_size() const { return framebuffer_size_; } | 143 const gfx::Size framebuffer_size() const { return framebuffer_size_; } |
142 const std::vector<DisplayState>& cached_displays() const { | 144 const std::vector<DisplayState>& cached_displays() const { |
143 return cached_displays_; | 145 return cached_displays_; |
144 } | 146 } |
145 | 147 |
146 void set_state_controller(StateController* controller) { | 148 void set_state_controller(StateController* controller) { |
147 state_controller_ = controller; | 149 state_controller_ = controller; |
148 } | 150 } |
149 void set_mirroring_controller(SoftwareMirroringController* controller) { | 151 void set_mirroring_controller(SoftwareMirroringController* controller) { |
150 mirroring_controller_ = controller; | 152 mirroring_controller_ = controller; |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 // Xrandr X11 extension is supported. | 315 // Xrandr X11 extension is supported. |
314 // If this flag is set to false, any attempts to change the display | 316 // If this flag is set to false, any attempts to change the display |
315 // configuration to immediately fail without changing the state. | 317 // configuration to immediately fail without changing the state. |
316 bool configure_display_; | 318 bool configure_display_; |
317 | 319 |
318 // The current display state. | 320 // The current display state. |
319 MultipleDisplayState display_state_; | 321 MultipleDisplayState display_state_; |
320 | 322 |
321 gfx::Size framebuffer_size_; | 323 gfx::Size framebuffer_size_; |
322 | 324 |
323 // The current power state. | 325 // The last-requested and current power state. These may differ if |
324 chromeos::DisplayPowerState power_state_; | 326 // configuration fails: SetDisplayMode() needs the last-requested state while |
| 327 // SetDisplayPower() needs the current state. |
| 328 chromeos::DisplayPowerState requested_power_state_; |
| 329 chromeos::DisplayPowerState current_power_state_; |
325 | 330 |
326 // Most-recently-used display configuration. Note that the actual | 331 // Most-recently-used display configuration. Note that the actual |
327 // configuration changes asynchronously. | 332 // configuration changes asynchronously. |
328 DisplayStateList cached_displays_; | 333 DisplayStateList cached_displays_; |
329 | 334 |
330 ObserverList<Observer> observers_; | 335 ObserverList<Observer> observers_; |
331 | 336 |
332 // The timer to delay configuring displays. This is used to aggregate multiple | 337 // The timer to delay configuring displays. This is used to aggregate multiple |
333 // display configuration events when they are reported in short time spans. | 338 // display configuration events when they are reported in short time spans. |
334 // See comment for NativeDisplayEventDispatcherX11 for more details. | 339 // See comment for NativeDisplayEventDispatcherX11 for more details. |
335 base::OneShotTimer<DisplayConfigurator> configure_timer_; | 340 base::OneShotTimer<DisplayConfigurator> configure_timer_; |
336 | 341 |
337 // Id for next display protection client. | 342 // Id for next display protection client. |
338 ContentProtectionClientId next_display_protection_client_id_; | 343 ContentProtectionClientId next_display_protection_client_id_; |
339 | 344 |
340 // Display protection requests of each client. | 345 // Display protection requests of each client. |
341 ProtectionRequests client_protection_requests_; | 346 ProtectionRequests client_protection_requests_; |
342 | 347 |
343 DISALLOW_COPY_AND_ASSIGN(DisplayConfigurator); | 348 DISALLOW_COPY_AND_ASSIGN(DisplayConfigurator); |
344 }; | 349 }; |
345 | 350 |
346 } // namespace ui | 351 } // namespace ui |
347 | 352 |
348 #endif // UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ | 353 #endif // UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ |
OLD | NEW |