| Index: athena/system/power_button_controller.h
|
| diff --git a/athena/system/power_button_controller.h b/athena/system/power_button_controller.h
|
| index 69fa9a8ac71538b4971a2539cebd03a058bf25ec..6a1ecd1045ef8fd185a3fa361ef086be10c34888 100644
|
| --- a/athena/system/power_button_controller.h
|
| +++ b/athena/system/power_button_controller.h
|
| @@ -5,31 +5,51 @@
|
| #ifndef ATHENA_SYSTEM_POWER_BUTTON_CONTROLLER_H_
|
| #define ATHENA_SYSTEM_POWER_BUTTON_CONTROLLER_H_
|
|
|
| +#include "athena/screen/public/screen_animator.h"
|
| +#include "base/memory/scoped_ptr.h"
|
| +#include "base/time/time.h"
|
| #include "chromeos/dbus/power_manager_client.h"
|
| +#include "ui/compositor/layer_animation_observer.h"
|
|
|
| namespace athena {
|
| +class ScreenAnimator;
|
|
|
| // Shuts down in response to the power button being pressed.
|
| -class PowerButtonController : public chromeos::PowerManagerClient::Observer {
|
| +class PowerButtonController : public chromeos::PowerManagerClient::Observer,
|
| + public ui::ImplicitAnimationObserver {
|
| public:
|
| PowerButtonController();
|
| virtual ~PowerButtonController();
|
|
|
| + private:
|
| + enum State {
|
| + // The screen is animating prior to shutdown. Shutdown can be canceled.
|
| + STATE_PRE_SHUTDOWN_ANIMATION,
|
| +
|
| + // A D-Bus shutdown request has been sent. Shutdown cannot be canceled.
|
| + STATE_SHUTDOWN_REQUESTED,
|
| +
|
| + STATE_OTHER
|
| + };
|
| +
|
| // chromeos::PowerManagerClient::Observer:
|
| virtual void BrightnessChanged(int level, bool user_initiated) OVERRIDE;
|
| virtual void PowerButtonEventReceived(
|
| bool down,
|
| const base::TimeTicks& timestamp) OVERRIDE;
|
|
|
| - private:
|
| + // ui::ImplicitAnimationObserver:
|
| + virtual void OnImplicitAnimationsCompleted() OVERRIDE;
|
| +
|
| + scoped_ptr<ScreenAnimator> animator_;
|
| +
|
| // Whether the screen brightness was reduced to 0%.
|
| bool brightness_is_zero_;
|
|
|
| // The last time at which the screen brightness was 0%.
|
| base::TimeTicks zero_brightness_end_time_;
|
|
|
| - // Whether shutdown was requested.
|
| - bool shutdown_requested_;
|
| + State state_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(PowerButtonController);
|
| };
|
|
|