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

Unified Diff: ash/system/chromeos/power/power_event_observer.cc

Issue 1130823003: Wait for display configuration to finish before suspending (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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
« no previous file with comments | « no previous file | ui/display/chromeos/display_configurator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/chromeos/power/power_event_observer.cc
diff --git a/ash/system/chromeos/power/power_event_observer.cc b/ash/system/chromeos/power/power_event_observer.cc
index 1510ddd69303de1040aab6c1179f4137fa1c7991..3dad7644587329d3a70056722ea63dd890588a60 100644
--- a/ash/system/chromeos/power/power_event_observer.cc
+++ b/ash/system/chromeos/power/power_event_observer.cc
@@ -37,6 +37,11 @@ void ResumeRenderingRequests() {
window->GetHost()->compositor()->SetVisible(true);
}
+void OnSuspendDisplaysCompleted(const base::Closure& suspend_callback,
+ bool status) {
+ suspend_callback.Run();
+}
+
} // namespace
PowerEventObserver::PowerEventObserver()
@@ -113,7 +118,10 @@ void PowerEventObserver::SuspendImminent() {
}
ui::UserActivityDetector::Get()->OnDisplayPowerChanging();
- shell->display_configurator()->SuspendDisplays();
+ shell->display_configurator()->SuspendDisplays(base::Bind(
+ &OnSuspendDisplaysCompleted, chromeos::DBusThreadManager::Get()
+ ->GetPowerManagerClient()
+ ->GetSuspendReadinessCallback()));
}
void PowerEventObserver::SuspendDone(const base::TimeDelta& sleep_duration) {
« no previous file with comments | « no previous file | ui/display/chromeos/display_configurator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698