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

Unified Diff: ui/display/chromeos/display_configurator.h

Issue 597683004: chromeos: Save display power state on config failure. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review comments Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: ui/display/chromeos/display_configurator.h
diff --git a/ui/display/chromeos/display_configurator.h b/ui/display/chromeos/display_configurator.h
index c891478a7ee525be59b3ad25da6fbcb7f7a9656f..bd0576c1019a0148f9430d726ffbdbeb8b152c95 100644
--- a/ui/display/chromeos/display_configurator.h
+++ b/ui/display/chromeos/display_configurator.h
@@ -137,7 +137,9 @@ class DISPLAY_EXPORT DisplayConfigurator : public NativeDisplayObserver {
virtual ~DisplayConfigurator();
MultipleDisplayState display_state() const { return display_state_; }
- chromeos::DisplayPowerState power_state() const { return power_state_; }
+ chromeos::DisplayPowerState requested_power_state() const {
+ return requested_power_state_;
+ }
const gfx::Size framebuffer_size() const { return framebuffer_size_; }
const std::vector<DisplayState>& cached_displays() const {
return cached_displays_;
@@ -174,7 +176,8 @@ class DISPLAY_EXPORT DisplayConfigurator : public NativeDisplayObserver {
// Called when powerd notifies us that some set of displays should be turned
// on or off. This requires enabling or disabling the CRTC associated with
// the display(s) in question so that the low power state is engaged.
- // |flags| contains bitwise-or-ed kSetDisplayPower* values.
+ // |flags| contains bitwise-or-ed kSetDisplayPower* values. Returns true if
+ // the system successfully enters (or was already in) |power_state|.
bool SetDisplayPower(chromeos::DisplayPowerState power_state, int flags);
// Force switching the display mode to |new_state|. Returns false if
@@ -320,8 +323,11 @@ class DISPLAY_EXPORT DisplayConfigurator : public NativeDisplayObserver {
gfx::Size framebuffer_size_;
- // The current power state.
- chromeos::DisplayPowerState power_state_;
+ // The last-requested and current power state. These may differ if
+ // configuration fails: SetDisplayMode() needs the last-requested state while
+ // SetDisplayPower() needs the current state.
+ chromeos::DisplayPowerState requested_power_state_;
+ chromeos::DisplayPowerState current_power_state_;
// Most-recently-used display configuration. Note that the actual
// configuration changes asynchronously.
« no previous file with comments | « chrome/browser/chromeos/display/display_preferences_unittest.cc ('k') | ui/display/chromeos/display_configurator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698