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

Unified Diff: ash/wm/power_button_controller.h

Issue 2496043004: Revert of Tablet-like power button behavior on Convertible/Tablet ChromeOS devices (Closed)
Patch Set: Created 4 years, 1 month 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/lock_state_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 7f3696f5eea1c152e49409c6e70a3b4604419b59..7043966f92a9d439ef664804e47343fab0d6804c 100644
--- a/ash/wm/power_button_controller.h
+++ b/ash/wm/power_button_controller.h
@@ -4,8 +4,6 @@
#ifndef ASH_WM_POWER_BUTTON_CONTROLLER_H_
#define ASH_WM_POWER_BUTTON_CONTROLLER_H_
-
-#include <memory>
#include "ash/ash_export.h"
#include "base/macros.h"
@@ -28,10 +26,11 @@
namespace ash {
+namespace test {
+class PowerButtonControllerTest;
+}
+
class LockStateController;
-#if defined(OS_CHROMEOS)
-class TabletPowerButtonController;
-#endif
// Handles power & lock button events which may result in the locking or
// shutting down of the system as well as taking screen shots while in maximize
@@ -54,6 +53,10 @@
has_legacy_power_button_ = legacy;
}
+ void set_enable_quick_lock_for_test(bool enable_quick_lock) {
+ enable_quick_lock_ = enable_quick_lock;
+ }
+
// Called when the current screen brightness changes.
void OnScreenBrightnessChanged(double percent);
@@ -72,13 +75,11 @@
// Overridden from chromeos::PowerManagerClient::Observer:
void PowerButtonEventReceived(bool down,
const base::TimeTicks& timestamp) override;
-
- TabletPowerButtonController* tablet_power_button_controller_for_test() {
- return tablet_controller_.get();
- }
#endif
private:
+ friend class test::PowerButtonControllerTest;
+
// Are the power or lock buttons currently held?
bool power_button_down_;
bool lock_button_down_;
@@ -104,12 +105,10 @@
// that misreports power button releases?
bool has_legacy_power_button_;
- LockStateController* lock_state_controller_; // Not owned.
+ // Enables quick, non-cancellable locking of the screen when in maximize mode.
+ bool enable_quick_lock_;
-#if defined(OS_CHROMEOS)
- // Handles events for convertible/tablet devices.
- std::unique_ptr<TabletPowerButtonController> tablet_controller_;
-#endif
+ LockStateController* controller_; // Not owned.
DISALLOW_COPY_AND_ASSIGN(PowerButtonController);
};
« no previous file with comments | « ash/wm/lock_state_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