| 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/chromeos/power/tablet_power_button_controller.h" | 5 #include "ash/system/chromeos/power/tablet_power_button_controller.h" |
| 6 | 6 |
| 7 #include "ash/common/accessibility_delegate.h" | 7 #include "ash/common/accessibility_delegate.h" |
| 8 #include "ash/common/session/session_state_delegate.h" | 8 #include "ash/common/session/session_state_delegate.h" |
| 9 #include "ash/common/shell_delegate.h" | 9 #include "ash/common/shell_delegate.h" |
| 10 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 10 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 void TabletPowerButtonController::SetDisplayForcedOff(bool forced_off) { | 209 void TabletPowerButtonController::SetDisplayForcedOff(bool forced_off) { |
| 210 if (backlights_forced_off_ == forced_off) | 210 if (backlights_forced_off_ == forced_off) |
| 211 return; | 211 return; |
| 212 | 212 |
| 213 // Set the display and keyboard backlights (if present) to |forced_off|. | 213 // Set the display and keyboard backlights (if present) to |forced_off|. |
| 214 chromeos::DBusThreadManager::Get() | 214 chromeos::DBusThreadManager::Get() |
| 215 ->GetPowerManagerClient() | 215 ->GetPowerManagerClient() |
| 216 ->SetBacklightsForcedOff(forced_off); | 216 ->SetBacklightsForcedOff(forced_off); |
| 217 backlights_forced_off_ = forced_off; | 217 backlights_forced_off_ = forced_off; |
| 218 | 218 |
| 219 ShellDelegate* delegate = WmShell::Get()->delegate(); | 219 ShellDelegate* delegate = Shell::Get()->shell_delegate(); |
| 220 delegate->SetTouchscreenEnabledInPrefs(!forced_off, | 220 delegate->SetTouchscreenEnabledInPrefs(!forced_off, |
| 221 true /* use_local_state */); | 221 true /* use_local_state */); |
| 222 delegate->UpdateTouchscreenStatusFromPrefs(); | 222 delegate->UpdateTouchscreenStatusFromPrefs(); |
| 223 | 223 |
| 224 // Send an a11y alert. | 224 // Send an a11y alert. |
| 225 Shell::GetInstance()->accessibility_delegate()->TriggerAccessibilityAlert( | 225 Shell::GetInstance()->accessibility_delegate()->TriggerAccessibilityAlert( |
| 226 forced_off ? A11Y_ALERT_SCREEN_OFF : A11Y_ALERT_SCREEN_ON); | 226 forced_off ? A11Y_ALERT_SCREEN_OFF : A11Y_ALERT_SCREEN_ON); |
| 227 } | 227 } |
| 228 | 228 |
| 229 void TabletPowerButtonController::GetInitialBacklightsForcedOff() { | 229 void TabletPowerButtonController::GetInitialBacklightsForcedOff() { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 256 WmShell::Get()->GetSessionStateDelegate(); | 256 WmShell::Get()->GetSessionStateDelegate(); |
| 257 if (session_state_delegate->ShouldLockScreenAutomatically() && | 257 if (session_state_delegate->ShouldLockScreenAutomatically() && |
| 258 session_state_delegate->CanLockScreen() && | 258 session_state_delegate->CanLockScreen() && |
| 259 !session_state_delegate->IsUserSessionBlocked() && | 259 !session_state_delegate->IsUserSessionBlocked() && |
| 260 !controller_->LockRequested()) { | 260 !controller_->LockRequested()) { |
| 261 session_state_delegate->LockScreen(); | 261 session_state_delegate->LockScreen(); |
| 262 } | 262 } |
| 263 } | 263 } |
| 264 | 264 |
| 265 } // namespace ash | 265 } // namespace ash |
| OLD | NEW |