Chromium Code Reviews| Index: ash/wm/lock_state_controller.h |
| diff --git a/ash/wm/lock_state_controller.h b/ash/wm/lock_state_controller.h |
| index a3cdbe86af59450045b82a6ef6e41eeea46e1f18..cafbbadb49e6a1fbc25dbf8d8d08f68b356edd43 100644 |
| --- a/ash/wm/lock_state_controller.h |
| +++ b/ash/wm/lock_state_controller.h |
| @@ -9,6 +9,7 @@ |
| #include "ash/ash_export.h" |
| #include "ash/common/shell_observer.h" |
| +#include "ash/public/interfaces/shutdown.mojom.h" |
|
James Cook
2016/11/02 20:20:03
Can this be forward declared?
Elliot Glaysher
2016/11/02 21:45:16
Done.
|
| #include "ash/wm/session_state_animator.h" |
| #include "base/macros.h" |
| #include "base/memory/weak_ptr.h" |
| @@ -22,6 +23,10 @@ class Rect; |
| class Size; |
| } |
| +namespace service_manager { |
| +class Connector; |
| +} |
| + |
| namespace ui { |
| class Layer; |
| } |
| @@ -33,18 +38,6 @@ class LockStateControllerTest; |
| class PowerButtonControllerTest; |
| } |
| -// Performs system-related functions on behalf of LockStateController. |
| -class ASH_EXPORT LockStateControllerDelegate { |
| - public: |
| - LockStateControllerDelegate() {} |
| - virtual ~LockStateControllerDelegate() {} |
| - |
| - virtual void RequestShutdown() = 0; |
| - |
| - private: |
| - DISALLOW_COPY_AND_ASSIGN(LockStateControllerDelegate); |
| -}; |
| - |
| // Displays onscreen animations and locks or suspends the system in response to |
| // the power button being pressed or released. |
| // Lock workflow: |
| @@ -99,6 +92,8 @@ class ASH_EXPORT LockStateController : public aura::WindowTreeHostObserver, |
| virtual ~TestApi(); |
| + void SetShutdownClient(std::unique_ptr<mojom::ShutdownClient> client); |
| + |
| bool lock_fail_timer_is_running() const { |
| return controller_->lock_fail_timer_.IsRunning(); |
| } |
| @@ -139,11 +134,9 @@ class ASH_EXPORT LockStateController : public aura::WindowTreeHostObserver, |
| DISALLOW_COPY_AND_ASSIGN(TestApi); |
| }; |
| - LockStateController(); |
| + LockStateController(service_manager::Connector* connector); |
|
James Cook
2016/11/02 20:20:03
nit: explicit
Elliot Glaysher
2016/11/02 21:45:16
Done.
|
| ~LockStateController() override; |
| - void SetDelegate(std::unique_ptr<LockStateControllerDelegate> delegate); |
| - |
| // Starts locking (with slow animation) that can be cancelled. |
| // After locking and |kLockToShutdownTimeoutMs| StartShutdownAnimation() |
| // will be called unless CancelShutdownAnimation() is called, if |
| @@ -274,8 +267,6 @@ class ASH_EXPORT LockStateController : public aura::WindowTreeHostObserver, |
| std::unique_ptr<SessionStateAnimator> animator_; |
| - std::unique_ptr<LockStateControllerDelegate> delegate_; |
| - |
| // The current login status, or original login status from before we locked. |
| LoginStatus login_status_; |
| @@ -300,6 +291,9 @@ class ASH_EXPORT LockStateController : public aura::WindowTreeHostObserver, |
| // How long has it been since the request to lock the screen? |
| std::unique_ptr<base::ElapsedTimer> lock_duration_timer_; |
| + // The client that we request to shut down the machine. |
| + std::unique_ptr<mojom::ShutdownClient> shutdown_client_; |
| + |
| // Started when we request that the screen be locked. When it fires, we |
| // assume that our request got dropped. |
| base::OneShotTimer lock_fail_timer_; |