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

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

Issue 2296003002: ABANDONED: chromeos: Resume displays when suspend is cancelled. (Closed)
Patch Set: fix comment Created 4 years, 4 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 | ash/system/chromeos/power/power_event_observer.cc » ('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.h
diff --git a/ash/system/chromeos/power/power_event_observer.h b/ash/system/chromeos/power/power_event_observer.h
index eb5bc058a2556c237a959084b54ef96c4d910b9a..1ac40cfe20cd45f31bf37f1a8c0d3222b8454670 100644
--- a/ash/system/chromeos/power/power_event_observer.h
+++ b/ash/system/chromeos/power/power_event_observer.h
@@ -7,8 +7,10 @@
#include "ash/ash_export.h"
#include "base/callback.h"
+#include "base/cancelable_callback.h"
#include "base/compiler_specific.h"
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
#include "chromeos/dbus/power_manager_client.h"
#include "chromeos/dbus/session_manager_client.h"
@@ -38,17 +40,42 @@ class ASH_EXPORT PowerEventObserver
void ScreenIsLocked() override;
void ScreenIsUnlocked() override;
+ private:
+ // Runs ui::DisplayConfigurator::ResumeDisplays() if possible (i.e.
+ // |suspend_displays_in_progress_| is false). Otherwise, sets
+ // |should_undo_suspend_displays_| so this method can be called again once the
+ // in-progress display-suspending finishes.
+ void ResumeDisplays();
+
+ // Callback for ui::DisplayConfigurator::SuspendDisplays().
+ void OnSuspendDisplaysCompleted(const base::Closure& suspend_callback,
+ bool status);
+
// Is the screen currently locked?
bool screen_locked_;
// Have the lock screen animations completed?
bool waiting_for_lock_screen_animations_;
+ // Is there an in-progress async call to
+ // ui::DisplayConfigurator::SuspendDisplays()?
+ bool suspend_displays_in_progress_;
+
+ // Do we need to undo an in-progress call to
+ // ui::DisplayConfigurator::SuspendDisplays() after it completes?
+ bool should_undo_suspend_displays_;
+
// If set, called when the lock screen animations have completed to confirm
// that the system is ready to be suspended.
base::Closure screen_lock_callback_;
- private:
+ // Used by OnSuspendDisplaysCompleted() if |should_undo_suspend_displays_| is
+ // true to run ResumeDisplays(). The task is canceled if it's still pending
+ // when SuspendImminent() is called.
+ base::CancelableClosure undo_suspend_displays_callback_;
+
+ base::WeakPtrFactory<PowerEventObserver> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(PowerEventObserver);
};
« no previous file with comments | « no previous file | ash/system/chromeos/power/power_event_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698