Chromium Code Reviews| 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 06d9efae2292990d999ea471bae6c94bf3424912..9b8a2cb5823fdcac8b3dc0e4d9140efb5b452683 100644 |
| --- a/ash/system/chromeos/power/tablet_power_button_controller.cc |
| +++ b/ash/system/chromeos/power/tablet_power_button_controller.cc |
| @@ -94,10 +94,14 @@ void TabletPowerButtonController::OnPowerButtonEvent( |
| // When the system resumes in response to the power button being pressed, |
| // Chrome receives powerd's SuspendDone signal and notification that the |
| // backlight has been turned back on before seeing the power button events |
| - // that woke the system. Ignore events just after resuming to ensure that we |
| - // don't turn the screen off in response to the events. |
| + // that woke the system. If backlights are forced off, stop forcing off |
|
Daniel Erat
2016/12/02 00:58:27
nit: i'd move this "If ..." part down just before
|
| + // because resuming system doesn't handle this, otherwise ignore events |
| + // just after resuming to ensure that we don't turn the screen off in response |
| + // to the events. |
| if (timestamp - last_resume_time_ <= |
| base::TimeDelta::FromMilliseconds(kIgnorePowerButtonAfterResumeMs)) { |
| + if (down && backlights_forced_off_) |
| + SetBacklightsForcedOff(false); |
|
Qiang(Joe) Xu
2016/12/02 01:06:38
Hi, just want to mention here, the long pressed sh
Daniel Erat
2016/12/02 01:10:26
are you just saying power button down events that
|
| return; |
| } |