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 // Checks if the given accelerator can be performed without the need to close | |
121 // the menu (if one is present), returns false if this is the case, and true | |
122 // otherwise (the menu should be closed and the accelerator should be reposted | |
123 // after the menu exits). | |
pkotwicz
2015/09/10 19:13:00
Nit: I think this would make for a simpler comment
afakhry
2015/09/10 20:57:13
Done.
| |
124 bool ShouldCloseMenuAndRepostAccelerator( | |
125 const ui::Accelerator& accelerator) const; | |
126 | |
120 ui::AcceleratorHistory* accelerator_history() { | 127 ui::AcceleratorHistory* accelerator_history() { |
121 return accelerator_history_.get(); | 128 return accelerator_history_.get(); |
122 } | 129 } |
123 | 130 |
124 // Overridden from ui::AcceleratorTarget: | 131 // Overridden from ui::AcceleratorTarget: |
125 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; | 132 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; |
126 bool CanHandleAccelerators() const override; | 133 bool CanHandleAccelerators() const override; |
127 | 134 |
128 private: | 135 private: |
129 FRIEND_TEST_ALL_PREFIXES(AcceleratorControllerTest, GlobalAccelerators); | 136 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. | 203 // Preferred actions. See accelerator_table.h for details. |
197 std::set<int> preferred_actions_; | 204 std::set<int> preferred_actions_; |
198 // Reserved actions. See accelerator_table.h for details. | 205 // Reserved actions. See accelerator_table.h for details. |
199 std::set<int> reserved_actions_; | 206 std::set<int> reserved_actions_; |
200 // Actions which will not be repeated while holding the accelerator key. | 207 // Actions which will not be repeated while holding the accelerator key. |
201 std::set<int> nonrepeatable_actions_; | 208 std::set<int> nonrepeatable_actions_; |
202 // Actions allowed in app mode. | 209 // Actions allowed in app mode. |
203 std::set<int> actions_allowed_in_app_mode_; | 210 std::set<int> actions_allowed_in_app_mode_; |
204 // Actions disallowed if there are no windows. | 211 // Actions disallowed if there are no windows. |
205 std::set<int> actions_needing_window_; | 212 std::set<int> actions_needing_window_; |
213 // Actions that can be performed without closing the menu (if one is present). | |
214 std::set<int> actions_keeping_menu_open_; | |
206 | 215 |
207 DISALLOW_COPY_AND_ASSIGN(AcceleratorController); | 216 DISALLOW_COPY_AND_ASSIGN(AcceleratorController); |
208 }; | 217 }; |
209 | 218 |
210 } // namespace ash | 219 } // namespace ash |
211 | 220 |
212 #endif // ASH_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ | 221 #endif // ASH_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ |
OLD | NEW |