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