| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/wm/power_button_controller.h" | 5 #include "ash/wm/power_button_controller.h" |
| 6 | 6 |
| 7 #include "ash/common/accelerators/accelerator_controller.h" | 7 #include "ash/common/accelerators/accelerator_controller.h" |
| 8 #include "ash/common/ash_switches.h" | 8 #include "ash/common/ash_switches.h" |
| 9 #include "ash/common/session/session_state_delegate.h" | 9 #include "ash/common/session/session_state_delegate.h" |
| 10 #include "ash/common/system/chromeos/audio/tray_audio.h" | 10 #include "ash/common/system/chromeos/audio/tray_audio.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // display is still on (http://crosbug.com/p/24912). | 84 // display is still on (http://crosbug.com/p/24912). |
| 85 if (brightness_is_zero_ && !internal_display_off_and_external_display_on_) | 85 if (brightness_is_zero_ && !internal_display_off_and_external_display_on_) |
| 86 return; | 86 return; |
| 87 | 87 |
| 88 // Take screenshot on power button down plus volume down when in touch view. | 88 // Take screenshot on power button down plus volume down when in touch view. |
| 89 if (should_take_screenshot) { | 89 if (should_take_screenshot) { |
| 90 SystemTray* system_tray = Shell::GetInstance()->GetPrimarySystemTray(); | 90 SystemTray* system_tray = Shell::GetInstance()->GetPrimarySystemTray(); |
| 91 if (system_tray && system_tray->GetTrayAudio()) | 91 if (system_tray && system_tray->GetTrayAudio()) |
| 92 system_tray->GetTrayAudio()->HideDetailedView(false); | 92 system_tray->GetTrayAudio()->HideDetailedView(false); |
| 93 | 93 |
| 94 WmShell::Get()->accelerator_controller()->PerformActionIfEnabled( | 94 Shell::Get()->accelerator_controller()->PerformActionIfEnabled( |
| 95 TAKE_SCREENSHOT); | 95 TAKE_SCREENSHOT); |
| 96 | 96 |
| 97 // Restore volume. | 97 // Restore volume. |
| 98 chromeos::CrasAudioHandler* audio_handler = | 98 chromeos::CrasAudioHandler* audio_handler = |
| 99 chromeos::CrasAudioHandler::Get(); | 99 chromeos::CrasAudioHandler::Get(); |
| 100 audio_handler->SetOutputVolumePercentWithoutNotifyingObservers( | 100 audio_handler->SetOutputVolumePercentWithoutNotifyingObservers( |
| 101 volume_percent_before_screenshot_, | 101 volume_percent_before_screenshot_, |
| 102 chromeos::CrasAudioHandler::VOLUME_CHANGE_MAXIMIZE_MODE_SCREENSHOT); | 102 chromeos::CrasAudioHandler::VOLUME_CHANGE_MAXIMIZE_MODE_SCREENSHOT); |
| 103 return; | 103 return; |
| 104 } | 104 } |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 internal_display_off && external_display_on; | 191 internal_display_off && external_display_on; |
| 192 } | 192 } |
| 193 | 193 |
| 194 void PowerButtonController::PowerButtonEventReceived( | 194 void PowerButtonController::PowerButtonEventReceived( |
| 195 bool down, | 195 bool down, |
| 196 const base::TimeTicks& timestamp) { | 196 const base::TimeTicks& timestamp) { |
| 197 OnPowerButtonEvent(down, timestamp); | 197 OnPowerButtonEvent(down, timestamp); |
| 198 } | 198 } |
| 199 | 199 |
| 200 } // namespace ash | 200 } // namespace ash |
| OLD | NEW |