| 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 UI_BASE_ACCELERATORS_ACCELERATOR_MANAGER_H_ | 5 #ifndef UI_BASE_ACCELERATORS_ACCELERATOR_MANAGER_H_ |
| 6 #define UI_BASE_ACCELERATORS_ACCELERATOR_MANAGER_H_ | 6 #define UI_BASE_ACCELERATORS_ACCELERATOR_MANAGER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <utility> | 10 #include <utility> |
| 11 #include <vector> |
| 11 | 12 |
| 12 #include "base/macros.h" | 13 #include "base/macros.h" |
| 13 #include "ui/base/accelerators/accelerator.h" | 14 #include "ui/base/accelerators/accelerator.h" |
| 14 #include "ui/base/ui_base_export.h" | 15 #include "ui/base/ui_base_export.h" |
| 15 #include "ui/events/event_constants.h" | 16 #include "ui/events/event_constants.h" |
| 16 | 17 |
| 17 namespace ui { | 18 namespace ui { |
| 18 | 19 |
| 19 class AcceleratorManagerDelegate; | 20 class AcceleratorManagerDelegate; |
| 20 | 21 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 44 // Note that we are currently limited to accelerators that are either: | 45 // Note that we are currently limited to accelerators that are either: |
| 45 // - a key combination including Ctrl or Alt | 46 // - a key combination including Ctrl or Alt |
| 46 // - the escape key | 47 // - the escape key |
| 47 // - the enter key | 48 // - the enter key |
| 48 // - any F key (F1, F2, F3 ...) | 49 // - any F key (F1, F2, F3 ...) |
| 49 // - any browser specific keys (as available on special keyboards) | 50 // - any browser specific keys (as available on special keyboards) |
| 50 void Register(const Accelerator& accelerator, | 51 void Register(const Accelerator& accelerator, |
| 51 HandlerPriority priority, | 52 HandlerPriority priority, |
| 52 AcceleratorTarget* target); | 53 AcceleratorTarget* target); |
| 53 | 54 |
| 55 void Registers(std::vector<ui::Accelerator>& accelerators); |
| 56 |
| 54 // Unregister the specified keyboard accelerator for the specified target. | 57 // Unregister the specified keyboard accelerator for the specified target. |
| 55 void Unregister(const Accelerator& accelerator, AcceleratorTarget* target); | 58 void Unregister(const Accelerator& accelerator, AcceleratorTarget* target); |
| 56 | 59 |
| 57 // Unregister all keyboard accelerator for the specified target. | 60 // Unregister all keyboard accelerator for the specified target. |
| 58 void UnregisterAll(AcceleratorTarget* target); | 61 void UnregisterAll(AcceleratorTarget* target); |
| 59 | 62 |
| 60 // Returns whether |accelerator| is already registered. | 63 // Returns whether |accelerator| is already registered. |
| 61 bool IsRegistered(const Accelerator& accelerator) const; | 64 bool IsRegistered(const Accelerator& accelerator) const; |
| 62 | 65 |
| 63 // Activate the target associated with the specified accelerator. | 66 // Activate the target associated with the specified accelerator. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 86 | 89 |
| 87 AcceleratorManagerDelegate* delegate_; | 90 AcceleratorManagerDelegate* delegate_; |
| 88 AcceleratorMap accelerators_; | 91 AcceleratorMap accelerators_; |
| 89 | 92 |
| 90 DISALLOW_COPY_AND_ASSIGN(AcceleratorManager); | 93 DISALLOW_COPY_AND_ASSIGN(AcceleratorManager); |
| 91 }; | 94 }; |
| 92 | 95 |
| 93 } // namespace ui | 96 } // namespace ui |
| 94 | 97 |
| 95 #endif // UI_BASE_ACCELERATORS_ACCELERATOR_MANAGER_H_ | 98 #endif // UI_BASE_ACCELERATORS_ACCELERATOR_MANAGER_H_ |
| OLD | NEW |