| 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);
|
| };
|
|
|
|
|