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

Unified Diff: athena/system/shutdown_dialog.h

Issue 654343002: Intorduce PowerButtonObserver API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: speculative fix Created 6 years, 2 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 | « athena/system/power_button_controller.cc ('k') | athena/system/shutdown_dialog.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/system/shutdown_dialog.h
diff --git a/athena/system/power_button_controller.h b/athena/system/shutdown_dialog.h
similarity index 57%
rename from athena/system/power_button_controller.h
rename to athena/system/shutdown_dialog.h
index b1540b9e38170bc5f3c1a750e00984e567f6413f..bda5adda8ab0c070bf2526736d3be4ea0fa7e5f4 100644
--- a/athena/system/power_button_controller.h
+++ b/athena/system/shutdown_dialog.h
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef ATHENA_SYSTEM_POWER_BUTTON_CONTROLLER_H_
-#define ATHENA_SYSTEM_POWER_BUTTON_CONTROLLER_H_
+#ifndef ATHENA_SYSTEM_SHUTDOWN_DIALOG_H_
+#define ATHENA_SYSTEM_SHUTDOWN_DIALOG_H_
+#include "athena/input/public/input_manager.h"
#include "base/memory/scoped_ptr.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
-#include "chromeos/dbus/power_manager_client.h"
namespace aura {
class Window;
@@ -21,10 +21,10 @@ class Widget;
namespace athena {
// Shuts down in response to the power button being pressed.
-class PowerButtonController : public chromeos::PowerManagerClient::Observer {
+class ShutdownDialog : public PowerButtonObserver {
public:
- explicit PowerButtonController(aura::Window* dialog_container);
- virtual ~PowerButtonController();
+ explicit ShutdownDialog(aura::Window* dialog_container);
+ virtual ~ShutdownDialog();
private:
enum State {
@@ -47,11 +47,9 @@ class PowerButtonController : public chromeos::PowerManagerClient::Observer {
// Requests shutdown.
void Shutdown();
- // chromeos::PowerManagerClient::Observer:
- virtual void BrightnessChanged(int level, bool user_initiated) override;
- virtual void PowerButtonEventReceived(
- bool down,
- const base::TimeTicks& timestamp) override;
+ // PowerButtonObserver:
+ virtual void OnPowerButtonStateChanged(
+ PowerButtonObserver::State state) override;
// |shutdown_warning_message_|'s parent container.
aura::Window* warning_message_container_;
@@ -59,19 +57,13 @@ class PowerButtonController : public chromeos::PowerManagerClient::Observer {
// Shows a warning that the device is about to be shutdown.
scoped_ptr<views::Widget> shutdown_warning_message_;
- // 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_;
-
State state_;
- base::OneShotTimer<PowerButtonController> timer_;
+ base::OneShotTimer<ShutdownDialog> timer_;
- DISALLOW_COPY_AND_ASSIGN(PowerButtonController);
+ DISALLOW_COPY_AND_ASSIGN(ShutdownDialog);
};
} // namespace athena
-#endif // ATHENA_SYSTEM_POWER_BUTTON_CONTROLLER_H_
+#endif // ATHENA_SYSTEM_SHUTDOWN_DIALOG_H_
« no previous file with comments | « athena/system/power_button_controller.cc ('k') | athena/system/shutdown_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698