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

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

Issue 1130823003: Wait for display configuration to finish before suspending (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unittests Created 5 years, 7 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.cc
diff --git a/ui/display/chromeos/display_configurator.cc b/ui/display/chromeos/display_configurator.cc
index 0c7295451dc9b95c5069290ef6e33bd2a7f26130..151b8f1f331c617e3a5fb0b4f2ea2e2f174c9564 100644
--- a/ui/display/chromeos/display_configurator.cc
+++ b/ui/display/chromeos/display_configurator.cc
@@ -854,7 +854,8 @@ void DisplayConfigurator::RemoveObserver(Observer* observer) {
observers_.RemoveObserver(observer);
}
-void DisplayConfigurator::SuspendDisplays() {
+void DisplayConfigurator::SuspendDisplays(
+ const ConfigurationCallback& callback) {
// If the display is off due to user inactivity and there's only a single
// internal display connected, switch to the all-on state before
// suspending. This shouldn't be very noticeable to the user since the
@@ -862,13 +863,14 @@ void DisplayConfigurator::SuspendDisplays() {
// into the "on" state, which greatly reduces resume times.
if (requested_power_state_ == chromeos::DISPLAY_POWER_ALL_OFF) {
SetDisplayPower(chromeos::DISPLAY_POWER_ALL_ON,
- kSetDisplayPowerOnlyIfSingleInternalDisplay,
- base::Bind(&DoNothing));
+ kSetDisplayPowerOnlyIfSingleInternalDisplay, callback);
// We need to make sure that the monitor configuration we just did actually
// completes before we return, because otherwise the X message could be
// racing with the HandleSuspendReadiness message.
native_display_delegate_->SyncWithServer();
+ } else {
+ callback.Run(true);
}
displays_suspended_ = true;

Powered by Google App Engine
This is Rietveld 408576698