Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Side by Side Diff: ui/display/chromeos/display_configurator.h

Issue 1861593002: chromeos: Turn off displays on suspend (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: chromeos: Turn off displays on suspend Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 void SetDisplayPowerInternal(chromeos::DisplayPowerState power_state,
304 int flags,
305 const ConfigurationCallback& callback);
Daniel Erat 2016/04/21 22:16:41 nit: add a blank line after this line
dbasehore 2016/04/21 22:35:10 Done.
303 // Configures displays. Invoked by |configure_timer_|. 306 // Configures displays. Invoked by |configure_timer_|.
304 void ConfigureDisplays(); 307 void ConfigureDisplays();
305 308
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. 309 // Notifies observers about an attempted state change.
311 void NotifyDisplayStateObservers(bool success, 310 void NotifyDisplayStateObservers(bool success,
312 MultipleDisplayState attempted_state); 311 MultipleDisplayState attempted_state);
313 312
314 // Notifies observers about a power state change. 313 // Notifies observers about a power state change.
315 void NotifyPowerStateObservers(); 314 void NotifyPowerStateObservers();
316 315
317 // Returns the display state that should be used with |cached_displays_| while 316 // Returns the display state that should be used with |cached_displays_| while
318 // in |power_state|. 317 // in |power_state|.
319 MultipleDisplayState ChooseDisplayState( 318 MultipleDisplayState ChooseDisplayState(
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 386
388 // Pending requests. These values are used when triggering the next display 387 // Pending requests. These values are used when triggering the next display
389 // configuration. 388 // configuration.
390 // 389 //
391 // Stores the user requested state or INVALID if nothing was requested. 390 // Stores the user requested state or INVALID if nothing was requested.
392 MultipleDisplayState requested_display_state_; 391 MultipleDisplayState requested_display_state_;
393 392
394 // Stores the requested power state. 393 // Stores the requested power state.
395 chromeos::DisplayPowerState requested_power_state_; 394 chromeos::DisplayPowerState requested_power_state_;
396 395
396 // Stores the power state to configure. May be the requested_power_state_ or
397 // DISPLAY_POWER_ALL_OFF for suspend.
398 chromeos::DisplayPowerState config_power_state_;
Daniel Erat 2016/04/21 22:16:41 nit: configured_power_state_? maybe current_power_
dbasehore 2016/04/21 22:35:10 current_power_state already exists. configured_pow
399
397 // True if |requested_power_state_| has been changed due to a user request. 400 // True if |requested_power_state_| has been changed due to a user request.
398 bool requested_power_state_change_; 401 bool power_state_change_;
Daniel Erat 2016/04/21 22:16:41 please give this variable a better name. the comme
dbasehore 2016/04/21 22:35:10 The name still seems to be relevant (the power sta
399 402
400 // Bitwise-or value of the |kSetDisplayPower*| flags defined above. 403 // Bitwise-or value of the |kSetDisplayPower*| flags defined above.
401 int requested_power_flags_; 404 int config_power_flags_;
Daniel Erat 2016/04/21 22:16:41 make this either "configured" or "current" too to
dbasehore 2016/04/21 22:35:10 As before. Those names imply that it was already d
402 405
403 // List of callbacks from callers waiting for the display configuration to 406 // List of callbacks from callers waiting for the display configuration to
404 // start/finish. Note these callbacks belong to the pending request, not a 407 // start/finish. Note these callbacks belong to the pending request, not a
405 // request currently active. 408 // request currently active.
406 std::vector<ConfigurationCallback> queued_configuration_callbacks_; 409 std::vector<ConfigurationCallback> queued_configuration_callbacks_;
407 410
408 // List of callbacks belonging to the currently running display configuration 411 // List of callbacks belonging to the currently running display configuration
409 // task. 412 // task.
410 std::vector<ConfigurationCallback> in_progress_configuration_callbacks_; 413 std::vector<ConfigurationCallback> in_progress_configuration_callbacks_;
411 414
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 461
459 // This must be the last variable. 462 // This must be the last variable.
460 base::WeakPtrFactory<DisplayConfigurator> weak_ptr_factory_; 463 base::WeakPtrFactory<DisplayConfigurator> weak_ptr_factory_;
461 464
462 DISALLOW_COPY_AND_ASSIGN(DisplayConfigurator); 465 DISALLOW_COPY_AND_ASSIGN(DisplayConfigurator);
463 }; 466 };
464 467
465 } // namespace ui 468 } // namespace ui
466 469
467 #endif // UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_ 470 #endif // UI_DISPLAY_CHROMEOS_DISPLAY_CONFIGURATOR_H_
OLDNEW
« no previous file with comments | « no previous file | ui/display/chromeos/display_configurator.cc » ('j') | ui/display/chromeos/display_configurator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698