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 #ifndef ASH_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ | 5 #ifndef ASH_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ |
6 #define ASH_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ | 6 #define ASH_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 } | 110 } |
111 ScreenshotDelegate* screenshot_delegate() { | 111 ScreenshotDelegate* screenshot_delegate() { |
112 return screenshot_delegate_.get(); | 112 return screenshot_delegate_.get(); |
113 } | 113 } |
114 | 114 |
115 // Provides access to the ExitWarningHandler for testing. | 115 // Provides access to the ExitWarningHandler for testing. |
116 ExitWarningHandler* GetExitWarningHandlerForTest() { | 116 ExitWarningHandler* GetExitWarningHandlerForTest() { |
117 return &exit_warning_handler_; | 117 return &exit_warning_handler_; |
118 } | 118 } |
119 | 119 |
| 120 // Returns true if the menu should close in order to perform the accelerator. |
| 121 bool ShouldCloseMenuAndRepostAccelerator( |
| 122 const ui::Accelerator& accelerator) const; |
| 123 |
120 ui::AcceleratorHistory* accelerator_history() { | 124 ui::AcceleratorHistory* accelerator_history() { |
121 return accelerator_history_.get(); | 125 return accelerator_history_.get(); |
122 } | 126 } |
123 | 127 |
124 // Overridden from ui::AcceleratorTarget: | 128 // Overridden from ui::AcceleratorTarget: |
125 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; | 129 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; |
126 bool CanHandleAccelerators() const override; | 130 bool CanHandleAccelerators() const override; |
127 | 131 |
128 private: | 132 private: |
129 FRIEND_TEST_ALL_PREFIXES(AcceleratorControllerTest, GlobalAccelerators); | 133 FRIEND_TEST_ALL_PREFIXES(AcceleratorControllerTest, GlobalAccelerators); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 // Preferred actions. See accelerator_table.h for details. | 200 // Preferred actions. See accelerator_table.h for details. |
197 std::set<int> preferred_actions_; | 201 std::set<int> preferred_actions_; |
198 // Reserved actions. See accelerator_table.h for details. | 202 // Reserved actions. See accelerator_table.h for details. |
199 std::set<int> reserved_actions_; | 203 std::set<int> reserved_actions_; |
200 // Actions which will not be repeated while holding the accelerator key. | 204 // Actions which will not be repeated while holding the accelerator key. |
201 std::set<int> nonrepeatable_actions_; | 205 std::set<int> nonrepeatable_actions_; |
202 // Actions allowed in app mode. | 206 // Actions allowed in app mode. |
203 std::set<int> actions_allowed_in_app_mode_; | 207 std::set<int> actions_allowed_in_app_mode_; |
204 // Actions disallowed if there are no windows. | 208 // Actions disallowed if there are no windows. |
205 std::set<int> actions_needing_window_; | 209 std::set<int> actions_needing_window_; |
| 210 // Actions that can be performed without closing the menu (if one is present). |
| 211 std::set<int> actions_keeping_menu_open_; |
206 | 212 |
207 DISALLOW_COPY_AND_ASSIGN(AcceleratorController); | 213 DISALLOW_COPY_AND_ASSIGN(AcceleratorController); |
208 }; | 214 }; |
209 | 215 |
210 } // namespace ash | 216 } // namespace ash |
211 | 217 |
212 #endif // ASH_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ | 218 #endif // ASH_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ |
OLD | NEW |