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

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

Issue 2864503002: [merge to m58] cros: Update touchscreen status with backlights forced off state during start (Closed)
Patch Set: Created 3 years, 7 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
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 672e54c199841b6ecf569733fd6ad71c0a2b1baa..5e0b54f6b6f832e1aadad9fde487db4aa2df1d14 100644
--- a/ash/system/chromeos/power/tablet_power_button_controller.cc
+++ b/ash/system/chromeos/power/tablet_power_button_controller.cc
@@ -215,11 +215,7 @@ void TabletPowerButtonController::SetDisplayForcedOff(bool forced_off) {
->GetPowerManagerClient()
->SetBacklightsForcedOff(forced_off);
backlights_forced_off_ = forced_off;
-
- ShellDelegate* delegate = WmShell::Get()->delegate();
- delegate->SetTouchscreenEnabledInPrefs(!forced_off,
- true /* use_local_state */);
- delegate->UpdateTouchscreenStatusFromPrefs();
+ UpdateTouchscreenStatus();
// Send an a11y alert.
WmShell::Get()->accessibility_delegate()->TriggerAccessibilityAlert(
@@ -237,6 +233,14 @@ void TabletPowerButtonController::GetInitialBacklightsForcedOff() {
void TabletPowerButtonController::OnGotInitialBacklightsForcedOff(
bool is_forced_off) {
backlights_forced_off_ = is_forced_off;
+ UpdateTouchscreenStatus();
+}
+
+void TabletPowerButtonController::UpdateTouchscreenStatus() {
+ ShellDelegate* delegate = WmShell::Get()->delegate();
+ delegate->SetTouchscreenEnabledInPrefs(!backlights_forced_off_,
+ true /* use_local_state */);
+ delegate->UpdateTouchscreenStatusFromPrefs();
}
void TabletPowerButtonController::StartShutdownTimer() {

Powered by Google App Engine
This is Rietveld 408576698