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

Unified Diff: ash/wm/power_button_controller.h

Issue 326813004: Added quick lock mechanism while in Touchview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reverted immediate lock on power button press. Created 6 years, 6 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 | « ash/wm/maximize_mode/maximize_mode_controller_unittest.cc ('k') | ash/wm/power_button_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/power_button_controller.h
diff --git a/ash/wm/power_button_controller.h b/ash/wm/power_button_controller.h
index f1780146c773ccb41e003f4061c7049d2d3baf58..ecab2a30bbab5fe6162ea86bcdfb1b5802346dd0 100644
--- a/ash/wm/power_button_controller.h
+++ b/ash/wm/power_button_controller.h
@@ -5,9 +5,12 @@
#ifndef ASH_WM_POWER_BUTTON_CONTROLLER_H_
#define ASH_WM_POWER_BUTTON_CONTROLLER_H_
+#include "ash/accelerators/accelerator_controller.h"
+#include "ash/accelerators/accelerator_table.h"
#include "ash/ash_export.h"
#include "ash/wm/session_state_animator.h"
#include "base/basictypes.h"
+#include "ui/base/accelerators/accelerator.h"
#if defined(OS_CHROMEOS)
#include "ui/display/chromeos/display_configurator.h"
@@ -30,13 +33,14 @@ class PowerButtonControllerTest;
class LockStateController;
-// Displays onscreen animations and locks or suspends the system in response to
-// the power button being pressed or released.
+// Handles power & lock button events which may result in the locking or
+// shutting down of the system as well as taking screen shots.
class ASH_EXPORT PowerButtonController
+ : ui::EventHandler
// TODO(derat): Remove these ifdefs after DisplayConfigurator becomes
// cross-platform.
#if defined(OS_CHROMEOS)
- : public ui::DisplayConfigurator::Observer
+ , public ui::DisplayConfigurator::Observer
flackr 2014/06/17 14:09:09 nit: indent 2 more
bruthig 2014/08/29 14:44:33 Done.
#endif
{
public:
@@ -54,6 +58,9 @@ class ASH_EXPORT PowerButtonController
void OnPowerButtonEvent(bool down, const base::TimeTicks& timestamp);
void OnLockButtonEvent(bool down, const base::TimeTicks& timestamp);
+ // ui::EventHandler:
+ virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE;
+
#if defined(OS_CHROMEOS)
// Overriden from ui::DisplayConfigurator::Observer:
virtual void OnDisplayModeChanged(
@@ -67,6 +74,9 @@ class ASH_EXPORT PowerButtonController
bool power_button_down_;
bool lock_button_down_;
+ // True when the volume down button is being held down.
+ bool volume_down_pressed_;
+
// Has the screen brightness been reduced to 0%?
bool brightness_is_zero_;
@@ -79,7 +89,7 @@ class ASH_EXPORT PowerButtonController
// that misreports power button releases?
bool has_legacy_power_button_;
- LockStateController* controller_; // Not owned.
+ LockStateController* controller_; // Not owned.
DISALLOW_COPY_AND_ASSIGN(PowerButtonController);
};
« no previous file with comments | « ash/wm/maximize_mode/maximize_mode_controller_unittest.cc ('k') | ash/wm/power_button_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698