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/common/accelerators/accelerator_controller.h" | 5 #include "ash/common/accelerators/accelerator_controller.h" |
6 | 6 |
7 #include "ash/common/accelerators/accelerator_commands.h" | 7 #include "ash/common/accelerators/accelerator_commands.h" |
8 #include "ash/common/accelerators/accelerator_controller_delegate.h" | 8 #include "ash/common/accelerators/accelerator_controller_delegate.h" |
9 #include "ash/common/accelerators/debug_commands.h" | 9 #include "ash/common/accelerators/debug_commands.h" |
10 #include "ash/common/accessibility_delegate.h" | 10 #include "ash/common/accessibility_delegate.h" |
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 // True should be returned if running |action| does something. Otherwise, | 737 // True should be returned if running |action| does something. Otherwise, |
738 // false should be returned to give the web contents a chance at handling the | 738 // false should be returned to give the web contents a chance at handling the |
739 // accelerator. | 739 // accelerator. |
740 switch (action) { | 740 switch (action) { |
741 case CYCLE_BACKWARD_MRU: | 741 case CYCLE_BACKWARD_MRU: |
742 case CYCLE_FORWARD_MRU: | 742 case CYCLE_FORWARD_MRU: |
743 return CanHandleCycleMru(accelerator); | 743 return CanHandleCycleMru(accelerator); |
744 case DEBUG_PRINT_LAYER_HIERARCHY: | 744 case DEBUG_PRINT_LAYER_HIERARCHY: |
745 case DEBUG_PRINT_VIEW_HIERARCHY: | 745 case DEBUG_PRINT_VIEW_HIERARCHY: |
746 case DEBUG_PRINT_WINDOW_HIERARCHY: | 746 case DEBUG_PRINT_WINDOW_HIERARCHY: |
| 747 case DEBUG_TOGGLE_WALLPAPER_MODE: |
747 return debug::DebugAcceleratorsEnabled(); | 748 return debug::DebugAcceleratorsEnabled(); |
748 case NEW_INCOGNITO_WINDOW: | 749 case NEW_INCOGNITO_WINDOW: |
749 return CanHandleNewIncognitoWindow(); | 750 return CanHandleNewIncognitoWindow(); |
750 case NEXT_IME: | 751 case NEXT_IME: |
751 return CanHandleNextIme(ime_control_delegate_.get()); | 752 return CanHandleNextIme(ime_control_delegate_.get()); |
752 case PREVIOUS_IME: | 753 case PREVIOUS_IME: |
753 return CanHandlePreviousIme(ime_control_delegate_.get()); | 754 return CanHandlePreviousIme(ime_control_delegate_.get()); |
754 case SHOW_MESSAGE_CENTER_BUBBLE: | 755 case SHOW_MESSAGE_CENTER_BUBBLE: |
755 return CanHandleShowMessageCenterBubble(); | 756 return CanHandleShowMessageCenterBubble(); |
756 case SWITCH_IME: | 757 case SWITCH_IME: |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 switch (action) { | 850 switch (action) { |
850 case CYCLE_BACKWARD_MRU: | 851 case CYCLE_BACKWARD_MRU: |
851 HandleCycleBackwardMRU(accelerator); | 852 HandleCycleBackwardMRU(accelerator); |
852 break; | 853 break; |
853 case CYCLE_FORWARD_MRU: | 854 case CYCLE_FORWARD_MRU: |
854 HandleCycleForwardMRU(accelerator); | 855 HandleCycleForwardMRU(accelerator); |
855 break; | 856 break; |
856 case DEBUG_PRINT_LAYER_HIERARCHY: | 857 case DEBUG_PRINT_LAYER_HIERARCHY: |
857 case DEBUG_PRINT_VIEW_HIERARCHY: | 858 case DEBUG_PRINT_VIEW_HIERARCHY: |
858 case DEBUG_PRINT_WINDOW_HIERARCHY: | 859 case DEBUG_PRINT_WINDOW_HIERARCHY: |
| 860 case DEBUG_TOGGLE_WALLPAPER_MODE: |
859 debug::PerformDebugActionIfEnabled(action); | 861 debug::PerformDebugActionIfEnabled(action); |
860 break; | 862 break; |
861 case EXIT: | 863 case EXIT: |
862 // UMA metrics are recorded in the handler. | 864 // UMA metrics are recorded in the handler. |
863 exit_warning_handler_.HandleAccelerator(); | 865 exit_warning_handler_.HandleAccelerator(); |
864 break; | 866 break; |
865 case FOCUS_NEXT_PANE: | 867 case FOCUS_NEXT_PANE: |
866 HandleRotatePaneFocus(FocusCycler::FORWARD); | 868 HandleRotatePaneFocus(FocusCycler::FORWARD); |
867 break; | 869 break; |
868 case FOCUS_PREVIOUS_PANE: | 870 case FOCUS_PREVIOUS_PANE: |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 if (wm_shell->mru_window_tracker()->BuildMruWindowList().empty() && | 1105 if (wm_shell->mru_window_tracker()->BuildMruWindowList().empty() && |
1104 actions_needing_window_.find(action) != actions_needing_window_.end()) { | 1106 actions_needing_window_.find(action) != actions_needing_window_.end()) { |
1105 wm_shell->accessibility_delegate()->TriggerAccessibilityAlert( | 1107 wm_shell->accessibility_delegate()->TriggerAccessibilityAlert( |
1106 A11Y_ALERT_WINDOW_NEEDED); | 1108 A11Y_ALERT_WINDOW_NEEDED); |
1107 return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION; | 1109 return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION; |
1108 } | 1110 } |
1109 return RESTRICTION_NONE; | 1111 return RESTRICTION_NONE; |
1110 } | 1112 } |
1111 | 1113 |
1112 } // namespace ash | 1114 } // namespace ash |
OLD | NEW |