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

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

Issue 2815453007: cros: Stop forcing off display when lid events are received (Closed)
Patch Set: nits 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 unified diff | Download patch
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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 void TabletPowerButtonController::BrightnessChanged(int level, 155 void TabletPowerButtonController::BrightnessChanged(int level,
156 bool user_initiated) { 156 bool user_initiated) {
157 brightness_level_is_zero_ = level == 0; 157 brightness_level_is_zero_ = level == 0;
158 } 158 }
159 159
160 void TabletPowerButtonController::SuspendDone( 160 void TabletPowerButtonController::SuspendDone(
161 const base::TimeDelta& sleep_duration) { 161 const base::TimeDelta& sleep_duration) {
162 last_resume_time_ = tick_clock_->NowTicks(); 162 last_resume_time_ = tick_clock_->NowTicks();
163 } 163 }
164 164
165 void TabletPowerButtonController::LidEventReceived(
166 chromeos::PowerManagerClient::LidState state,
167 const base::TimeTicks& timestamp) {
168 SetDisplayForcedOff(false);
169 }
170
165 void TabletPowerButtonController::OnMaximizeModeStarted() { 171 void TabletPowerButtonController::OnMaximizeModeStarted() {
166 shutdown_timer_.Stop(); 172 shutdown_timer_.Stop();
167 if (controller_->CanCancelShutdownAnimation()) 173 if (controller_->CanCancelShutdownAnimation())
168 controller_->CancelShutdownAnimation(); 174 controller_->CancelShutdownAnimation();
169 } 175 }
170 176
171 void TabletPowerButtonController::OnMaximizeModeEnded() { 177 void TabletPowerButtonController::OnMaximizeModeEnded() {
172 shutdown_timer_.Stop(); 178 shutdown_timer_.Stop();
173 if (controller_->CanCancelShutdownAnimation()) 179 if (controller_->CanCancelShutdownAnimation())
174 controller_->CancelShutdownAnimation(); 180 controller_->CancelShutdownAnimation();
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 SessionController* session_controller = Shell::Get()->session_controller(); 260 SessionController* session_controller = Shell::Get()->session_controller();
255 if (session_controller->ShouldLockScreenAutomatically() && 261 if (session_controller->ShouldLockScreenAutomatically() &&
256 session_controller->CanLockScreen() && 262 session_controller->CanLockScreen() &&
257 !session_controller->IsUserSessionBlocked() && 263 !session_controller->IsUserSessionBlocked() &&
258 !controller_->LockRequested()) { 264 !controller_->LockRequested()) {
259 session_controller->LockScreen(); 265 session_controller->LockScreen();
260 } 266 }
261 } 267 }
262 268
263 } // namespace ash 269 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/power/tablet_power_button_controller.h ('k') | ash/system/power/tablet_power_button_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698