| 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/accelerators/accelerator_controller.h" | 5 #include "ash/accelerators/accelerator_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "ash/accelerators/accelerator_commands.h" | 12 #include "ash/accelerators/accelerator_commands.h" |
| 13 #include "ash/accelerators/debug_commands.h" | 13 #include "ash/accelerators/debug_commands.h" |
| 14 #include "ash/ash_switches.h" | 14 #include "ash/ash_switches.h" |
| 15 #include "ash/common/session/session_state_delegate.h" | 15 #include "ash/common/session/session_state_delegate.h" |
| 16 #include "ash/common/shelf/shelf_model.h" | 16 #include "ash/common/shelf/shelf_model.h" |
| 17 #include "ash/common/shell_window_ids.h" | 17 #include "ash/common/shell_window_ids.h" |
| 18 #include "ash/common/system/tray/system_tray_delegate.h" | 18 #include "ash/common/system/tray/system_tray_delegate.h" |
| 19 #include "ash/common/system/volume_control_delegate.h" | 19 #include "ash/common/system/volume_control_delegate.h" |
| 20 #include "ash/common/wm/mru_window_tracker.h" | 20 #include "ash/common/wm/mru_window_tracker.h" |
| 21 #include "ash/common/wm/window_state.h" | 21 #include "ash/common/wm/window_state.h" |
| 22 #include "ash/common/wm/wm_event.h" | 22 #include "ash/common/wm/wm_event.h" |
| 23 #include "ash/common/wm_shell.h" |
| 23 #include "ash/debug.h" | 24 #include "ash/debug.h" |
| 24 #include "ash/display/window_tree_host_manager.h" | 25 #include "ash/display/window_tree_host_manager.h" |
| 25 #include "ash/focus_cycler.h" | 26 #include "ash/focus_cycler.h" |
| 26 #include "ash/gpu_support.h" | 27 #include "ash/gpu_support.h" |
| 27 #include "ash/ime_control_delegate.h" | 28 #include "ash/ime_control_delegate.h" |
| 28 #include "ash/magnifier/magnification_controller.h" | 29 #include "ash/magnifier/magnification_controller.h" |
| 29 #include "ash/magnifier/partial_magnification_controller.h" | 30 #include "ash/magnifier/partial_magnification_controller.h" |
| 30 #include "ash/media_delegate.h" | 31 #include "ash/media_delegate.h" |
| 31 #include "ash/multi_profile_uma.h" | 32 #include "ash/multi_profile_uma.h" |
| 32 #include "ash/new_window_delegate.h" | 33 #include "ash/new_window_delegate.h" |
| (...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 } | 726 } |
| 726 | 727 |
| 727 void HandleTouchHudModeChange() { | 728 void HandleTouchHudModeChange() { |
| 728 RootWindowController* controller = | 729 RootWindowController* controller = |
| 729 RootWindowController::ForTargetRootWindow(); | 730 RootWindowController::ForTargetRootWindow(); |
| 730 controller->touch_hud_debug()->ChangeToNextMode(); | 731 controller->touch_hud_debug()->ChangeToNextMode(); |
| 731 } | 732 } |
| 732 | 733 |
| 733 void HandleVolumeDown(const ui::Accelerator& accelerator) { | 734 void HandleVolumeDown(const ui::Accelerator& accelerator) { |
| 734 VolumeControlDelegate* volume_delegate = | 735 VolumeControlDelegate* volume_delegate = |
| 735 Shell::GetInstance()->system_tray_delegate()->GetVolumeControlDelegate(); | 736 WmShell::Get()->system_tray_delegate()->GetVolumeControlDelegate(); |
| 736 if (volume_delegate) | 737 if (volume_delegate) |
| 737 volume_delegate->HandleVolumeDown(accelerator); | 738 volume_delegate->HandleVolumeDown(accelerator); |
| 738 } | 739 } |
| 739 | 740 |
| 740 void HandleVolumeMute(const ui::Accelerator& accelerator) { | 741 void HandleVolumeMute(const ui::Accelerator& accelerator) { |
| 741 VolumeControlDelegate* volume_delegate = | 742 VolumeControlDelegate* volume_delegate = |
| 742 Shell::GetInstance()->system_tray_delegate()->GetVolumeControlDelegate(); | 743 WmShell::Get()->system_tray_delegate()->GetVolumeControlDelegate(); |
| 743 if (volume_delegate) | 744 if (volume_delegate) |
| 744 volume_delegate->HandleVolumeMute(accelerator); | 745 volume_delegate->HandleVolumeMute(accelerator); |
| 745 } | 746 } |
| 746 | 747 |
| 747 void HandleVolumeUp(const ui::Accelerator& accelerator) { | 748 void HandleVolumeUp(const ui::Accelerator& accelerator) { |
| 748 VolumeControlDelegate* volume_delegate = | 749 VolumeControlDelegate* volume_delegate = |
| 749 Shell::GetInstance()->system_tray_delegate()->GetVolumeControlDelegate(); | 750 WmShell::Get()->system_tray_delegate()->GetVolumeControlDelegate(); |
| 750 if (volume_delegate) | 751 if (volume_delegate) |
| 751 volume_delegate->HandleVolumeUp(accelerator); | 752 volume_delegate->HandleVolumeUp(accelerator); |
| 752 } | 753 } |
| 753 | 754 |
| 754 #endif // defined(OS_CHROMEOS) | 755 #endif // defined(OS_CHROMEOS) |
| 755 | 756 |
| 756 } // namespace | 757 } // namespace |
| 757 | 758 |
| 758 //////////////////////////////////////////////////////////////////////////////// | 759 //////////////////////////////////////////////////////////////////////////////// |
| 759 // AcceleratorController, public: | 760 // AcceleratorController, public: |
| (...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1450 } | 1451 } |
| 1451 | 1452 |
| 1452 void AcceleratorController::SetKeyboardBrightnessControlDelegate( | 1453 void AcceleratorController::SetKeyboardBrightnessControlDelegate( |
| 1453 std::unique_ptr<KeyboardBrightnessControlDelegate> | 1454 std::unique_ptr<KeyboardBrightnessControlDelegate> |
| 1454 keyboard_brightness_control_delegate) { | 1455 keyboard_brightness_control_delegate) { |
| 1455 keyboard_brightness_control_delegate_ = | 1456 keyboard_brightness_control_delegate_ = |
| 1456 std::move(keyboard_brightness_control_delegate); | 1457 std::move(keyboard_brightness_control_delegate); |
| 1457 } | 1458 } |
| 1458 | 1459 |
| 1459 } // namespace ash | 1460 } // namespace ash |
| OLD | NEW |