| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 } | 106 } |
| 107 ScreenshotDelegate* screenshot_delegate() { | 107 ScreenshotDelegate* screenshot_delegate() { |
| 108 return screenshot_delegate_.get(); | 108 return screenshot_delegate_.get(); |
| 109 } | 109 } |
| 110 | 110 |
| 111 // Provides access to the ExitWarningHandler for testing. | 111 // Provides access to the ExitWarningHandler for testing. |
| 112 ExitWarningHandler* GetExitWarningHandlerForTest() { | 112 ExitWarningHandler* GetExitWarningHandlerForTest() { |
| 113 return &exit_warning_handler_; | 113 return &exit_warning_handler_; |
| 114 } | 114 } |
| 115 | 115 |
| 116 // Checks if the given accelerator can be performed without the need to close |
| 117 // the menu (if one is present), returns false if this is the case, and true |
| 118 // otherwise (the menu should be closed and the accelerator should be reposted |
| 119 // after the menu exits). |
| 120 bool ShouldCloseMenuAndRepostAccelerator( |
| 121 const ui::Accelerator& accelerator) const; |
| 122 |
| 116 ui::AcceleratorHistory* accelerator_history() { | 123 ui::AcceleratorHistory* accelerator_history() { |
| 117 return accelerator_history_.get(); | 124 return accelerator_history_.get(); |
| 118 } | 125 } |
| 119 | 126 |
| 120 // Overridden from ui::AcceleratorTarget: | 127 // Overridden from ui::AcceleratorTarget: |
| 121 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; | 128 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; |
| 122 bool CanHandleAccelerators() const override; | 129 bool CanHandleAccelerators() const override; |
| 123 | 130 |
| 124 private: | 131 private: |
| 125 FRIEND_TEST_ALL_PREFIXES(AcceleratorControllerTest, GlobalAccelerators); | 132 FRIEND_TEST_ALL_PREFIXES(AcceleratorControllerTest, GlobalAccelerators); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 // Preferred actions. See accelerator_table.h for details. | 192 // Preferred actions. See accelerator_table.h for details. |
| 186 std::set<int> preferred_actions_; | 193 std::set<int> preferred_actions_; |
| 187 // Reserved actions. See accelerator_table.h for details. | 194 // Reserved actions. See accelerator_table.h for details. |
| 188 std::set<int> reserved_actions_; | 195 std::set<int> reserved_actions_; |
| 189 // Actions which will not be repeated while holding the accelerator key. | 196 // Actions which will not be repeated while holding the accelerator key. |
| 190 std::set<int> nonrepeatable_actions_; | 197 std::set<int> nonrepeatable_actions_; |
| 191 // Actions allowed in app mode. | 198 // Actions allowed in app mode. |
| 192 std::set<int> actions_allowed_in_app_mode_; | 199 std::set<int> actions_allowed_in_app_mode_; |
| 193 // Actions disallowed if there are no windows. | 200 // Actions disallowed if there are no windows. |
| 194 std::set<int> actions_needing_window_; | 201 std::set<int> actions_needing_window_; |
| 202 // Actions that can be performed without closing the menu (if one is present). |
| 203 std::set<int> actions_keeping_menu_open_; |
| 195 | 204 |
| 196 DISALLOW_COPY_AND_ASSIGN(AcceleratorController); | 205 DISALLOW_COPY_AND_ASSIGN(AcceleratorController); |
| 197 }; | 206 }; |
| 198 | 207 |
| 199 } // namespace ash | 208 } // namespace ash |
| 200 | 209 |
| 201 #endif // ASH_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ | 210 #endif // ASH_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ |
| OLD | NEW |