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

Unified Diff: athena/system/power_button_controller.h

Issue 451753002: Add fade to white animation when power button is pressed on Athena (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
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..85bb8dc7f647e2a8bc955b5d35ac109ff16af93c 100644
--- a/athena/system/power_button_controller.h
+++ b/athena/system/power_button_controller.h
@@ -5,23 +5,38 @@
#ifndef ATHENA_SYSTEM_POWER_BUTTON_CONTROLLER_H_
#define ATHENA_SYSTEM_POWER_BUTTON_CONTROLLER_H_
+#include "base/time/time.h"
#include "chromeos/dbus/power_manager_client.h"
+#include "ui/compositor/layer_animation_observer.h"
namespace athena {
// 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:
+ // Starts an animation of the root window to |target| brightness and
+ // grayscale.
+ void StartGrayscaleAndBrightnessAnimation(float target,
+ int duration_ms,
+ gfx::Tween::Type tween_type);
+
+ // Requests system shutdown on the D-Bus.
+ void Shutdown();
+
// 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;
+
// Whether the screen brightness was reduced to 0%.
bool brightness_is_zero_;
@@ -31,6 +46,9 @@ class PowerButtonController : public chromeos::PowerManagerClient::Observer {
// Whether shutdown was requested.
bool shutdown_requested_;
+ // Whether the shutdown request can be canceled.
+ bool can_cancel_shutdown_;
+
DISALLOW_COPY_AND_ASSIGN(PowerButtonController);
};

Powered by Google App Engine
This is Rietveld 408576698