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

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

Issue 2855033004: cros: Update touchscreen status with backlights forced off state during start (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/power/tablet_power_button_controller.cc
diff --git a/ash/system/power/tablet_power_button_controller.cc b/ash/system/power/tablet_power_button_controller.cc
index a2b252809570dbedee17d42ef95d5f520d6b6d55..9282ca3e1dacddf994fd64bf00807aa898f4f569 100644
--- a/ash/system/power/tablet_power_button_controller.cc
+++ b/ash/system/power/tablet_power_button_controller.cc
@@ -55,6 +55,15 @@ bool IsTabletModeActive() {
maximize_mode_controller->IsMaximizeModeWindowManagerEnabled();
}
+// Update Touchscreen status based on the provided |local_pref_enabled|, which
Daniel Erat 2017/05/03 00:48:46 nit: s/Touchscreen/touchscreen/
Qiang(Joe) Xu 2017/05/03 03:14:22 Done.
+// is a reverse state of |backlights_forced_off_|.
Daniel Erat 2017/05/03 00:48:46 instead of referring to backlights_forced_off_ (wh
Qiang(Joe) Xu 2017/05/03 03:14:22 done by moving this to private method. That is bet
+void UpdateTouchscreenStatus(bool local_pref_enabled) {
Daniel Erat 2017/05/03 00:48:46 local_pref_enabled is a bit confusing. can you ren
Qiang(Joe) Xu 2017/05/03 03:14:22 Done.
+ ShellDelegate* delegate = Shell::Get()->shell_delegate();
+ delegate->SetTouchscreenEnabledInPrefs(local_pref_enabled,
+ true /* use_local_state */);
+ delegate->UpdateTouchscreenStatusFromPrefs();
+}
+
} // namespace
TabletPowerButtonController::TestApi::TestApi(
@@ -221,10 +230,7 @@ void TabletPowerButtonController::SetDisplayForcedOff(bool forced_off) {
->SetBacklightsForcedOff(forced_off);
backlights_forced_off_ = forced_off;
Daniel Erat 2017/05/03 00:48:46 nit: delete blank line?
Qiang(Joe) Xu 2017/05/03 03:14:22 Done.
- ShellDelegate* delegate = Shell::Get()->shell_delegate();
- delegate->SetTouchscreenEnabledInPrefs(!forced_off,
- true /* use_local_state */);
- delegate->UpdateTouchscreenStatusFromPrefs();
+ UpdateTouchscreenStatus(!backlights_forced_off_);
// Send an a11y alert.
Shell::Get()->accessibility_delegate()->TriggerAccessibilityAlert(
@@ -242,6 +248,7 @@ void TabletPowerButtonController::GetInitialBacklightsForcedOff() {
void TabletPowerButtonController::OnGotInitialBacklightsForcedOff(
bool is_forced_off) {
backlights_forced_off_ = is_forced_off;
+ UpdateTouchscreenStatus(!backlights_forced_off_);
}
void TabletPowerButtonController::StartShutdownTimer() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698