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 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
679 RegisterAccelerators(kAcceleratorData, kAcceleratorDataLength); | 679 RegisterAccelerators(kAcceleratorData, kAcceleratorDataLength); |
680 | 680 |
681 RegisterDeprecatedAccelerators(); | 681 RegisterDeprecatedAccelerators(); |
682 | 682 |
683 if (debug::DebugAcceleratorsEnabled()) { | 683 if (debug::DebugAcceleratorsEnabled()) { |
684 RegisterAccelerators(kDebugAcceleratorData, kDebugAcceleratorDataLength); | 684 RegisterAccelerators(kDebugAcceleratorData, kDebugAcceleratorDataLength); |
685 // All debug accelerators are reserved. | 685 // All debug accelerators are reserved. |
686 for (size_t i = 0; i < kDebugAcceleratorDataLength; ++i) | 686 for (size_t i = 0; i < kDebugAcceleratorDataLength; ++i) |
687 reserved_actions_.insert(kDebugAcceleratorData[i].action); | 687 reserved_actions_.insert(kDebugAcceleratorData[i].action); |
688 } | 688 } |
| 689 |
| 690 if (debug::DeveloperAcceleratorsEnabled()) { |
| 691 RegisterAccelerators(kDeveloperAcceleratorData, |
| 692 kDeveloperAcceleratorDataLength); |
| 693 // Developer accelerators are also reserved. |
| 694 for (size_t i = 0; i < kDeveloperAcceleratorDataLength; ++i) |
| 695 reserved_actions_.insert(kDeveloperAcceleratorData[i].action); |
| 696 } |
689 } | 697 } |
690 | 698 |
691 void AcceleratorController::RegisterAccelerators( | 699 void AcceleratorController::RegisterAccelerators( |
692 const AcceleratorData accelerators[], | 700 const AcceleratorData accelerators[], |
693 size_t accelerators_length) { | 701 size_t accelerators_length) { |
694 for (size_t i = 0; i < accelerators_length; ++i) { | 702 for (size_t i = 0; i < accelerators_length; ++i) { |
695 ui::Accelerator accelerator = | 703 ui::Accelerator accelerator = |
696 CreateAccelerator(accelerators[i].keycode, accelerators[i].modifiers, | 704 CreateAccelerator(accelerators[i].keycode, accelerators[i].modifiers, |
697 accelerators[i].trigger_on_press); | 705 accelerators[i].trigger_on_press); |
698 Register(accelerator, this); | 706 Register(accelerator, this); |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1105 if (wm_shell->mru_window_tracker()->BuildMruWindowList().empty() && | 1113 if (wm_shell->mru_window_tracker()->BuildMruWindowList().empty() && |
1106 actions_needing_window_.find(action) != actions_needing_window_.end()) { | 1114 actions_needing_window_.find(action) != actions_needing_window_.end()) { |
1107 wm_shell->accessibility_delegate()->TriggerAccessibilityAlert( | 1115 wm_shell->accessibility_delegate()->TriggerAccessibilityAlert( |
1108 A11Y_ALERT_WINDOW_NEEDED); | 1116 A11Y_ALERT_WINDOW_NEEDED); |
1109 return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION; | 1117 return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION; |
1110 } | 1118 } |
1111 return RESTRICTION_NONE; | 1119 return RESTRICTION_NONE; |
1112 } | 1120 } |
1113 | 1121 |
1114 } // namespace ash | 1122 } // namespace ash |
OLD | NEW |