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

Side by Side Diff: ash/system/power/tablet_power_button_controller.cc

Issue 2946233003: cros: stop forcing off display when powerd reports SuspendDone (Closed)
Patch Set: nits Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | ash/system/power/tablet_power_button_controller_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/system/power/tablet_power_button_controller.h" 5 #include "ash/system/power/tablet_power_button_controller.h"
6 6
7 #include "ash/accessibility_delegate.h" 7 #include "ash/accessibility_delegate.h"
8 #include "ash/session/session_controller.h" 8 #include "ash/session/session_controller.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_delegate.h" 10 #include "ash/shell_delegate.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 } 152 }
153 153
154 void TabletPowerButtonController::BrightnessChanged(int level, 154 void TabletPowerButtonController::BrightnessChanged(int level,
155 bool user_initiated) { 155 bool user_initiated) {
156 brightness_level_is_zero_ = level == 0; 156 brightness_level_is_zero_ = level == 0;
157 } 157 }
158 158
159 void TabletPowerButtonController::SuspendDone( 159 void TabletPowerButtonController::SuspendDone(
160 const base::TimeDelta& sleep_duration) { 160 const base::TimeDelta& sleep_duration) {
161 last_resume_time_ = tick_clock_->NowTicks(); 161 last_resume_time_ = tick_clock_->NowTicks();
162 // Stop forcing backlights off on resume to handle situations where the power
163 // button resumed but we didn't receive the event (crbug.com/735291).
164 SetDisplayForcedOff(false);
162 } 165 }
163 166
164 void TabletPowerButtonController::LidEventReceived( 167 void TabletPowerButtonController::LidEventReceived(
165 chromeos::PowerManagerClient::LidState state, 168 chromeos::PowerManagerClient::LidState state,
166 const base::TimeTicks& timestamp) { 169 const base::TimeTicks& timestamp) {
167 SetDisplayForcedOff(false); 170 SetDisplayForcedOff(false);
168 } 171 }
169 172
170 void TabletPowerButtonController::OnMaximizeModeStarted() { 173 void TabletPowerButtonController::OnMaximizeModeStarted() {
171 shutdown_timer_.Stop(); 174 shutdown_timer_.Stop();
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 SessionController* session_controller = Shell::Get()->session_controller(); 269 SessionController* session_controller = Shell::Get()->session_controller();
267 if (session_controller->ShouldLockScreenAutomatically() && 270 if (session_controller->ShouldLockScreenAutomatically() &&
268 session_controller->CanLockScreen() && 271 session_controller->CanLockScreen() &&
269 !session_controller->IsUserSessionBlocked() && 272 !session_controller->IsUserSessionBlocked() &&
270 !controller_->LockRequested()) { 273 !controller_->LockRequested()) {
271 session_controller->LockScreen(); 274 session_controller->LockScreen();
272 } 275 }
273 } 276 }
274 277
275 } // namespace ash 278 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/system/power/tablet_power_button_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698