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

Unified Diff: ash/system/chromeos/power/tablet_power_button_controller.cc

Issue 2533373002: Enabled/disable touch screen in TabletPowerButtonController (Closed)
Patch Set: touch_screen_status 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/system/chromeos/power/tablet_power_button_controller.cc
diff --git a/ash/system/chromeos/power/tablet_power_button_controller.cc b/ash/system/chromeos/power/tablet_power_button_controller.cc
index 06d9efae2292990d999ea471bae6c94bf3424912..619ce300fce41c371554fa5a429c69dd31a4da20 100644
--- a/ash/system/chromeos/power/tablet_power_button_controller.cc
+++ b/ash/system/chromeos/power/tablet_power_button_controller.cc
@@ -6,6 +6,7 @@
#include "ash/common/accessibility_delegate.h"
#include "ash/common/session/session_state_delegate.h"
+#include "ash/common/shell_delegate.h"
#include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/shell.h"
@@ -182,8 +183,16 @@ void TabletPowerButtonController::SetBacklightsForcedOff(bool forced_off) {
->SetBacklightsForcedOff(forced_off);
backlights_forced_off_ = forced_off;
+ // ToggleTouchscreen when there is a request/stop backlights forced off call
+ // and touch screen should be toggled.
+ WmShell* wm_shell = WmShell::Get();
+ const bool touch_screen_disabled =
+ !wm_shell->delegate()->IsTouchscreenEnabled();
+ if (touch_screen_disabled ^ forced_off)
+ wm_shell->delegate()->ToggleTouchscreen();
+
// Send an a11y alert.
- WmShell::Get()->accessibility_delegate()->TriggerAccessibilityAlert(
+ wm_shell->accessibility_delegate()->TriggerAccessibilityAlert(
forced_off ? A11Y_ALERT_SCREEN_OFF : A11Y_ALERT_SCREEN_ON);
}

Powered by Google App Engine
This is Rietveld 408576698