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

Unified Diff: ash/wm/power_button_controller.h

Issue 2474913004: Tablet-like power button behavior on Convertible/Tablet ChromeOS devices (Closed)
Patch Set: extract TabletPowerButtonController 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
Index: ash/wm/power_button_controller.h
diff --git a/ash/wm/power_button_controller.h b/ash/wm/power_button_controller.h
index 7043966f92a9d439ef664804e47343fab0d6804c..4e3741ebf0014c85d01f7e729404c0715fd34b7e 100644
--- a/ash/wm/power_button_controller.h
+++ b/ash/wm/power_button_controller.h
@@ -26,12 +26,15 @@ class Layer;
namespace ash {
+class LockStateController;
+#if defined(OS_CHROMEOS)
+class TabletPowerButtonController;
+#endif
+
namespace test {
-class PowerButtonControllerTest;
+class TabletPowerButtonControllerTest;
}
-class LockStateController;
-
// 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
// mode.
@@ -78,7 +81,7 @@ class ASH_EXPORT PowerButtonController
#endif
private:
- friend class test::PowerButtonControllerTest;
+ friend class test::TabletPowerButtonControllerTest;
// Are the power or lock buttons currently held?
bool power_button_down_;
@@ -110,6 +113,12 @@ class ASH_EXPORT PowerButtonController
LockStateController* controller_; // Not owned.
+#if defined(OS_CHROMEOS)
+ // When device is convertible/tablet, pass the OnPowerButtonEvent to
+ // |tablet_controller_| when it should be handled there.
+ std::unique_ptr<TabletPowerButtonController> tablet_controller_;
+#endif
+
DISALLOW_COPY_AND_ASSIGN(PowerButtonController);
};

Powered by Google App Engine
This is Rietveld 408576698