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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 const std::vector<GammaRampRGBEntry>& gamma_lut, | 293 const std::vector<GammaRampRGBEntry>& gamma_lut, |
294 const std::vector<float>& correction_matrix); | 294 const std::vector<float>& correction_matrix); |
295 | 295 |
296 private: | 296 private: |
297 class DisplayLayoutManagerImpl; | 297 class DisplayLayoutManagerImpl; |
298 | 298 |
299 // Mapping a client to its protection request. | 299 // Mapping a client to its protection request. |
300 typedef std::map<ContentProtectionClientId, ContentProtections> | 300 typedef std::map<ContentProtectionClientId, ContentProtections> |
301 ProtectionRequests; | 301 ProtectionRequests; |
302 | 302 |
303 // Updates |pending_*| members and applies the passed-in state. |callback| is | |
304 // invoked (perhaps synchronously) on completion. | |
305 void SetDisplayPowerInternal(chromeos::DisplayPowerState power_state, | |
306 int flags, | |
307 const ConfigurationCallback& callback); | |
308 | |
309 // Configures displays. Invoked by |configure_timer_|. | 303 // Configures displays. Invoked by |configure_timer_|. |
310 void ConfigureDisplays(); | 304 void ConfigureDisplays(); |
311 | 305 |
| 306 // Restores |requested_power_state_| after the system has resumed, |
| 307 // additionally forcing a probe. Invoked by |configure_timer_|. |
| 308 void RestoreRequestedPowerStateAfterResume(); |
| 309 |
312 // Notifies observers about an attempted state change. | 310 // Notifies observers about an attempted state change. |
313 void NotifyDisplayStateObservers(bool success, | 311 void NotifyDisplayStateObservers(bool success, |
314 MultipleDisplayState attempted_state); | 312 MultipleDisplayState attempted_state); |
315 | 313 |
316 // Notifies observers about a power state change. | 314 // Notifies observers about a power state change. |
317 void NotifyPowerStateObservers(); | 315 void NotifyPowerStateObservers(); |
318 | 316 |
319 // Returns the display state that should be used with |cached_displays_| while | 317 // Returns the display state that should be used with |cached_displays_| while |
320 // in |power_state|. | 318 // in |power_state|. |
321 MultipleDisplayState ChooseDisplayState( | 319 MultipleDisplayState ChooseDisplayState( |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 | 387 |
390 // Pending requests. These values are used when triggering the next display | 388 // Pending requests. These values are used when triggering the next display |
391 // configuration. | 389 // configuration. |
392 // | 390 // |
393 // Stores the user requested state or INVALID if nothing was requested. | 391 // Stores the user requested state or INVALID if nothing was requested. |
394 MultipleDisplayState requested_display_state_; | 392 MultipleDisplayState requested_display_state_; |
395 | 393 |
396 // Stores the requested power state. | 394 // Stores the requested power state. |
397 chromeos::DisplayPowerState requested_power_state_; | 395 chromeos::DisplayPowerState requested_power_state_; |
398 | 396 |
399 // The power state used by RunPendingConfiguration(). May be | 397 // True if |requested_power_state_| has been changed due to a user request. |
400 // |requested_power_state_| or DISPLAY_POWER_ALL_OFF for suspend. | 398 bool requested_power_state_change_; |
401 chromeos::DisplayPowerState pending_power_state_; | |
402 | |
403 // True if |pending_power_state_| has been changed. | |
404 bool has_pending_power_state_; | |
405 | 399 |
406 // Bitwise-or value of the |kSetDisplayPower*| flags defined above. | 400 // Bitwise-or value of the |kSetDisplayPower*| flags defined above. |
407 int pending_power_flags_; | 401 int requested_power_flags_; |
408 | 402 |
409 // List of callbacks from callers waiting for the display configuration to | 403 // List of callbacks from callers waiting for the display configuration to |
410 // start/finish. Note these callbacks belong to the pending request, not a | 404 // start/finish. Note these callbacks belong to the pending request, not a |
411 // request currently active. | 405 // request currently active. |
412 std::vector<ConfigurationCallback> queued_configuration_callbacks_; | 406 std::vector<ConfigurationCallback> queued_configuration_callbacks_; |
413 | 407 |
414 // List of callbacks belonging to the currently running display configuration | 408 // List of callbacks belonging to the currently running display configuration |
415 // task. | 409 // task. |
416 std::vector<ConfigurationCallback> in_progress_configuration_callbacks_; | 410 std::vector<ConfigurationCallback> in_progress_configuration_callbacks_; |
417 | 411 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 | 458 |
465 // This must be the last variable. | 459 // This must be the last variable. |
466 base::WeakPtrFactory<DisplayConfigurator> weak_ptr_factory_; | 460 base::WeakPtrFactory<DisplayConfigurator> weak_ptr_factory_; |
467 | 461 |
468 DISALLOW_COPY_AND_ASSIGN(DisplayConfigurator); | 462 DISALLOW_COPY_AND_ASSIGN(DisplayConfigurator); |
469 }; | 463 }; |
470 | 464 |
471 } // namespace ui | 465 } // namespace ui |
472 | 466 |
473 #endif // UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ | 467 #endif // UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ |
OLD | NEW |