OLD | NEW |
---|---|
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 Loading... | |
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 // Device should always stopped forcing off backlights when suspend is done. | |
163 // This will handle the case when tablet power button pressed causing system | |
164 // resuming, but power button event is not delivered. | |
Daniel Erat
2017/06/22 18:08:40
nit: maybe just something like:
// Stop forcing b
Qiang(Joe) Xu
2017/06/22 18:36:35
Done.
| |
165 SetDisplayForcedOff(false); | |
162 } | 166 } |
163 | 167 |
164 void TabletPowerButtonController::LidEventReceived( | 168 void TabletPowerButtonController::LidEventReceived( |
165 chromeos::PowerManagerClient::LidState state, | 169 chromeos::PowerManagerClient::LidState state, |
166 const base::TimeTicks& timestamp) { | 170 const base::TimeTicks& timestamp) { |
167 SetDisplayForcedOff(false); | 171 SetDisplayForcedOff(false); |
168 } | 172 } |
169 | 173 |
170 void TabletPowerButtonController::OnMaximizeModeStarted() { | 174 void TabletPowerButtonController::OnMaximizeModeStarted() { |
171 shutdown_timer_.Stop(); | 175 shutdown_timer_.Stop(); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
266 SessionController* session_controller = Shell::Get()->session_controller(); | 270 SessionController* session_controller = Shell::Get()->session_controller(); |
267 if (session_controller->ShouldLockScreenAutomatically() && | 271 if (session_controller->ShouldLockScreenAutomatically() && |
268 session_controller->CanLockScreen() && | 272 session_controller->CanLockScreen() && |
269 !session_controller->IsUserSessionBlocked() && | 273 !session_controller->IsUserSessionBlocked() && |
270 !controller_->LockRequested()) { | 274 !controller_->LockRequested()) { |
271 session_controller->LockScreen(); | 275 session_controller->LockScreen(); |
272 } | 276 } |
273 } | 277 } |
274 | 278 |
275 } // namespace ash | 279 } // namespace ash |
OLD | NEW |