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

Unified Diff: ash/wm/power_button_controller.cc

Issue 2506493002: Add a switch for tablet power button behavior (Closed)
Patch Set: based on comments 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.cc
diff --git a/ash/wm/power_button_controller.cc b/ash/wm/power_button_controller.cc
index 9daa3df0ef896512a112d92b0c62437655185a6a..9ea85af9688d4384cadcfba8d1538db73de06d38 100644
--- a/ash/wm/power_button_controller.cc
+++ b/ash/wm/power_button_controller.cc
@@ -44,8 +44,11 @@ PowerButtonController::PowerButtonController(LockStateController* controller)
#if defined(OS_CHROMEOS)
chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(
this);
- tablet_controller_.reset(
- new TabletPowerButtonController(lock_state_controller_));
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kAshEnableTabletPowerButton)) {
+ tablet_controller_.reset(
+ new TabletPowerButtonController(lock_state_controller_));
+ }
Shell::GetInstance()->display_configurator()->AddObserver(this);
#endif
Shell::GetInstance()->PrependPreTargetHandler(this);
@@ -80,6 +83,7 @@ void PowerButtonController::OnPowerButtonEvent(
->IsMaximizeModeWindowManagerEnabled();
if (!has_legacy_power_button_ && !should_take_screenshot &&
+ tablet_controller_ &&
tablet_controller_->ShouldHandlePowerButtonEvents()) {
tablet_controller_->OnPowerButtonEvent(down, timestamp);
return;

Powered by Google App Engine
This is Rietveld 408576698