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 <iostream> | 9 #include <iostream> |
10 #include <string> | 10 #include <string> |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
710 HandleKeyboardBrightnessDown(accelerator); | 710 HandleKeyboardBrightnessDown(accelerator); |
711 break; | 711 break; |
712 case KEYBOARD_BRIGHTNESS_UP: | 712 case KEYBOARD_BRIGHTNESS_UP: |
713 if (keyboard_brightness_control_delegate_) | 713 if (keyboard_brightness_control_delegate_) |
714 return keyboard_brightness_control_delegate_-> | 714 return keyboard_brightness_control_delegate_-> |
715 HandleKeyboardBrightnessUp(accelerator); | 715 HandleKeyboardBrightnessUp(accelerator); |
716 break; | 716 break; |
717 case VOLUME_MUTE: | 717 case VOLUME_MUTE: |
718 return shell->system_tray_delegate()->GetVolumeControlDelegate()-> | 718 return shell->system_tray_delegate()->GetVolumeControlDelegate()-> |
719 HandleVolumeMute(accelerator); | 719 HandleVolumeMute(accelerator); |
720 break; | 720 break; |
Mr4D (OOO till 08-26)
2013/09/06 21:57:54
Can you remove this break?
| |
721 case VOLUME_DOWN: | 721 case VOLUME_DOWN: |
722 return shell->system_tray_delegate()->GetVolumeControlDelegate()-> | 722 return shell->system_tray_delegate()->GetVolumeControlDelegate()-> |
723 HandleVolumeDown(accelerator); | 723 HandleVolumeDown(accelerator); |
724 break; | 724 break; |
Mr4D (OOO till 08-26)
2013/09/06 21:57:54
ditto
| |
725 case VOLUME_UP: | 725 case VOLUME_UP: |
726 return shell->system_tray_delegate()->GetVolumeControlDelegate()-> | 726 return shell->system_tray_delegate()->GetVolumeControlDelegate()-> |
727 HandleVolumeUp(accelerator); | 727 HandleVolumeUp(accelerator); |
728 break; | 728 break; |
Mr4D (OOO till 08-26)
2013/09/06 21:57:54
And so on
| |
729 case FOCUS_LAUNCHER: | 729 case FOCUS_LAUNCHER: |
730 return shell->focus_cycler()->FocusWidget( | 730 return shell->focus_cycler()->FocusWidget( |
731 Launcher::ForPrimaryDisplay()->shelf_widget()); | 731 Launcher::ForPrimaryDisplay()->shelf_widget()); |
732 break; | 732 break; |
733 case FOCUS_NEXT_PANE: | 733 case FOCUS_NEXT_PANE: |
734 return HandleRotatePaneFocus(Shell::FORWARD); | 734 return HandleRotatePaneFocus(Shell::FORWARD); |
735 case FOCUS_PREVIOUS_PANE: | 735 case FOCUS_PREVIOUS_PANE: |
736 return HandleRotatePaneFocus(Shell::BACKWARD); | 736 return HandleRotatePaneFocus(Shell::BACKWARD); |
737 case SHOW_KEYBOARD_OVERLAY: | 737 case SHOW_KEYBOARD_OVERLAY: |
738 ash::Shell::GetInstance()->delegate()->ShowKeyboardOverlay(); | 738 ash::Shell::GetInstance()->delegate()->ShowKeyboardOverlay(); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
829 case WINDOW_SNAP_RIGHT: { | 829 case WINDOW_SNAP_RIGHT: { |
830 aura::Window* window = wm::GetActiveWindow(); | 830 aura::Window* window = wm::GetActiveWindow(); |
831 // Disable window docking shortcut key for full screen window due to | 831 // Disable window docking shortcut key for full screen window due to |
832 // http://crbug.com/135487. | 832 // http://crbug.com/135487. |
833 if (!window || | 833 if (!window || |
834 window->type() != aura::client::WINDOW_TYPE_NORMAL || | 834 window->type() != aura::client::WINDOW_TYPE_NORMAL || |
835 wm::IsWindowFullscreen(window)) { | 835 wm::IsWindowFullscreen(window)) { |
836 break; | 836 break; |
837 } | 837 } |
838 | 838 |
839 internal::SnapSizer::SnapWindow(window, | 839 using internal::SnapSizer; |
840 action == WINDOW_SNAP_LEFT ? internal::SnapSizer::LEFT_EDGE : | 840 if (SnapSizer::CanSnapWindow(window)) { |
841 internal::SnapSizer::RIGHT_EDGE); | 841 SnapSizer::Edge edge = (action == WINDOW_SNAP_LEFT) ? |
842 SnapSizer::LEFT_EDGE : SnapSizer::RIGHT_EDGE; | |
843 SnapSizer::SnapWindow(window, edge, SnapSizer::STEP_YES); | |
844 } | |
842 return true; | 845 return true; |
843 } | 846 } |
844 case WINDOW_MINIMIZE: { | 847 case WINDOW_MINIMIZE: { |
845 aura::Window* window = wm::GetActiveWindow(); | 848 aura::Window* window = wm::GetActiveWindow(); |
846 // Attempt to restore the window that would be cycled through next from | 849 // Attempt to restore the window that would be cycled through next from |
847 // the launcher when there is no active window. | 850 // the launcher when there is no active window. |
848 if (!window) | 851 if (!window) |
849 return HandleCycleWindowMRU(WindowCycleController::FORWARD, false); | 852 return HandleCycleWindowMRU(WindowCycleController::FORWARD, false); |
850 // Disable the shortcut for minimizing full screen window due to | 853 // Disable the shortcut for minimizing full screen window due to |
851 // crbug.com/131709, which is a crashing issue related to minimizing | 854 // crbug.com/131709, which is a crashing issue related to minimizing |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
997 keyboard_brightness_control_delegate) { | 1000 keyboard_brightness_control_delegate) { |
998 keyboard_brightness_control_delegate_ = | 1001 keyboard_brightness_control_delegate_ = |
999 keyboard_brightness_control_delegate.Pass(); | 1002 keyboard_brightness_control_delegate.Pass(); |
1000 } | 1003 } |
1001 | 1004 |
1002 bool AcceleratorController::CanHandleAccelerators() const { | 1005 bool AcceleratorController::CanHandleAccelerators() const { |
1003 return true; | 1006 return true; |
1004 } | 1007 } |
1005 | 1008 |
1006 } // namespace ash | 1009 } // namespace ash |
OLD | NEW |