| 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_COMMON_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ | 5 #ifndef ASH_COMMON_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ |
| 6 #define ASH_COMMON_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ | 6 #define ASH_COMMON_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 const ui::Accelerator& accelerator); | 158 const ui::Accelerator& accelerator); |
| 159 | 159 |
| 160 // Returns whether performing |action| should consume the key event. | 160 // Returns whether performing |action| should consume the key event. |
| 161 bool ShouldActionConsumeKeyEvent(AcceleratorAction action); | 161 bool ShouldActionConsumeKeyEvent(AcceleratorAction action); |
| 162 | 162 |
| 163 // Get the accelerator restriction for the given action. Supply an |action| | 163 // Get the accelerator restriction for the given action. Supply an |action| |
| 164 // of -1 to get restrictions that apply for the current context. | 164 // of -1 to get restrictions that apply for the current context. |
| 165 AcceleratorProcessingRestriction GetAcceleratorProcessingRestriction( | 165 AcceleratorProcessingRestriction GetAcceleratorProcessingRestriction( |
| 166 int action); | 166 int action); |
| 167 | 167 |
| 168 // If |accelerator| is a deprecated accelerator, it performs the appropriate |
| 169 // deprecated accelerator pre-handling. |
| 170 // Returns PROCEED if the accelerator's action should be performed (i.e. if |
| 171 // |accelerator| is not a deprecated accelerator, or it's an enabled |
| 172 // deprecated accelerator), and STOP otherwise (if the accelerator is a |
| 173 // disabled deprecated accelerator). |
| 174 enum class AcceleratorProcessingStatus { PROCEED, STOP }; |
| 175 AcceleratorProcessingStatus MaybeDeprecatedAcceleratorPressed( |
| 176 AcceleratorAction action, |
| 177 const ui::Accelerator& accelerator) const; |
| 178 |
| 168 AcceleratorControllerDelegate* delegate_; | 179 AcceleratorControllerDelegate* delegate_; |
| 169 | 180 |
| 170 std::unique_ptr<ui::AcceleratorManager> accelerator_manager_; | 181 std::unique_ptr<ui::AcceleratorManager> accelerator_manager_; |
| 171 | 182 |
| 172 // A tracker for the current and previous accelerators. | 183 // A tracker for the current and previous accelerators. |
| 173 std::unique_ptr<ui::AcceleratorHistory> accelerator_history_; | 184 std::unique_ptr<ui::AcceleratorHistory> accelerator_history_; |
| 174 | 185 |
| 175 std::unique_ptr<ImeControlDelegate> ime_control_delegate_; | 186 std::unique_ptr<ImeControlDelegate> ime_control_delegate_; |
| 176 | 187 |
| 177 // Handles the exit accelerator which requires a double press to exit and | 188 // Handles the exit accelerator which requires a double press to exit and |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 std::set<int> actions_needing_window_; | 224 std::set<int> actions_needing_window_; |
| 214 // Actions that can be performed without closing the menu (if one is present). | 225 // Actions that can be performed without closing the menu (if one is present). |
| 215 std::set<int> actions_keeping_menu_open_; | 226 std::set<int> actions_keeping_menu_open_; |
| 216 | 227 |
| 217 DISALLOW_COPY_AND_ASSIGN(AcceleratorController); | 228 DISALLOW_COPY_AND_ASSIGN(AcceleratorController); |
| 218 }; | 229 }; |
| 219 | 230 |
| 220 } // namespace ash | 231 } // namespace ash |
| 221 | 232 |
| 222 #endif // ASH_COMMON_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ | 233 #endif // ASH_COMMON_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ |
| OLD | NEW |