| 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> |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <set> | 12 #include <set> |
| 13 | 13 |
| 14 #include "ash/ash_export.h" | 14 #include "ash/ash_export.h" |
| 15 #include "ash/common/accelerators/accelerator_table.h" | 15 #include "ash/common/accelerators/accelerator_table.h" |
| 16 #include "ash/common/accelerators/exit_warning_handler.h" | 16 #include "ash/common/accelerators/exit_warning_handler.h" |
| 17 #include "base/compiler_specific.h" | 17 #include "base/compiler_specific.h" |
| 18 #include "base/gtest_prod_util.h" | 18 #include "base/gtest_prod_util.h" |
| 19 #include "base/macros.h" | 19 #include "base/macros.h" |
| 20 #include "ui/base/accelerators/accelerator.h" | 20 #include "ui/base/accelerators/accelerator.h" |
| 21 #include "ui/base/accelerators/accelerator_history.h" | 21 #include "ui/base/accelerators/accelerator_history.h" |
| 22 | 22 |
| 23 namespace ui { | 23 namespace ui { |
| 24 class AcceleratorManager; | 24 class AcceleratorManager; |
| 25 class AcceleratorManagerDelegate; |
| 25 } | 26 } |
| 26 | 27 |
| 27 namespace ash { | 28 namespace ash { |
| 28 | 29 |
| 29 struct AcceleratorData; | 30 struct AcceleratorData; |
| 30 class AcceleratorControllerDelegate; | 31 class AcceleratorControllerDelegate; |
| 31 class ExitWarningHandler; | 32 class ExitWarningHandler; |
| 32 class ImeControlDelegate; | 33 class ImeControlDelegate; |
| 33 | 34 |
| 34 // AcceleratorController provides functions for registering or unregistering | 35 // AcceleratorController provides functions for registering or unregistering |
| 35 // global keyboard accelerators, which are handled earlier than any windows. It | 36 // global keyboard accelerators, which are handled earlier than any windows. It |
| 36 // also implements several handlers as an accelerator target. | 37 // also implements several handlers as an accelerator target. |
| 37 class ASH_EXPORT AcceleratorController : public ui::AcceleratorTarget { | 38 class ASH_EXPORT AcceleratorController : public ui::AcceleratorTarget { |
| 38 public: | 39 public: |
| 39 explicit AcceleratorController(AcceleratorControllerDelegate* delegate); | 40 AcceleratorController(AcceleratorControllerDelegate* delegate, |
| 41 ui::AcceleratorManagerDelegate* manager_delegate); |
| 40 ~AcceleratorController() override; | 42 ~AcceleratorController() override; |
| 41 | 43 |
| 42 // A list of possible ways in which an accelerator should be restricted before | 44 // A list of possible ways in which an accelerator should be restricted before |
| 43 // processing. Any target registered with this controller should respect | 45 // processing. Any target registered with this controller should respect |
| 44 // restrictions by calling |GetCurrentAcceleratorRestriction| during | 46 // restrictions by calling |GetCurrentAcceleratorRestriction| during |
| 45 // processing. | 47 // processing. |
| 46 enum AcceleratorProcessingRestriction { | 48 enum AcceleratorProcessingRestriction { |
| 47 // Process the accelerator normally. | 49 // Process the accelerator normally. |
| 48 RESTRICTION_NONE, | 50 RESTRICTION_NONE, |
| 49 | 51 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 std::set<int> actions_needing_window_; | 196 std::set<int> actions_needing_window_; |
| 195 // Actions that can be performed without closing the menu (if one is present). | 197 // Actions that can be performed without closing the menu (if one is present). |
| 196 std::set<int> actions_keeping_menu_open_; | 198 std::set<int> actions_keeping_menu_open_; |
| 197 | 199 |
| 198 DISALLOW_COPY_AND_ASSIGN(AcceleratorController); | 200 DISALLOW_COPY_AND_ASSIGN(AcceleratorController); |
| 199 }; | 201 }; |
| 200 | 202 |
| 201 } // namespace ash | 203 } // namespace ash |
| 202 | 204 |
| 203 #endif // ASH_COMMON_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ | 205 #endif // ASH_COMMON_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ |
| OLD | NEW |