| Index: ui/base/accelerators/accelerator_manager.h
|
| diff --git a/ui/base/accelerators/accelerator_manager.h b/ui/base/accelerators/accelerator_manager.h
|
| index d103e6fb1706b17c1259550345951f3107a009e4..9db9629fd8ecc8a9aabf7fa974fe15f1af2cdd75 100644
|
| --- a/ui/base/accelerators/accelerator_manager.h
|
| +++ b/ui/base/accelerators/accelerator_manager.h
|
| @@ -16,7 +16,10 @@
|
|
|
| namespace ui {
|
|
|
| -// The AcceleratorManger is used to handle keyboard accelerators.
|
| +class AcceleratorManagerDelegate;
|
| +
|
| +// AcceleratorManger handles processing of accelerators. A delegate may be
|
| +// supplied which is notified as unique accelerators are added and removed.
|
| class UI_BASE_EXPORT AcceleratorManager {
|
| public:
|
| enum HandlerPriority {
|
| @@ -24,7 +27,7 @@ class UI_BASE_EXPORT AcceleratorManager {
|
| kHighPriority,
|
| };
|
|
|
| - AcceleratorManager();
|
| + explicit AcceleratorManager(AcceleratorManagerDelegate* = nullptr);
|
| ~AcceleratorManager();
|
|
|
| // Register a keyboard accelerator for the specified target. If multiple
|
| @@ -70,11 +73,18 @@ class UI_BASE_EXPORT AcceleratorManager {
|
|
|
| private:
|
| // The accelerators and associated targets.
|
| - typedef std::list<AcceleratorTarget*> AcceleratorTargetList;
|
| + using AcceleratorTargetList = std::list<AcceleratorTarget*>;
|
| // This construct pairs together a |bool| (denoting whether the list contains
|
| // a priority_handler at the front) with the list of AcceleratorTargets.
|
| - typedef std::pair<bool, AcceleratorTargetList> AcceleratorTargets;
|
| - typedef std::map<Accelerator, AcceleratorTargets> AcceleratorMap;
|
| + using AcceleratorTargets = std::pair<bool, AcceleratorTargetList>;
|
| + using AcceleratorMap = std::map<Accelerator, AcceleratorTargets>;
|
| +
|
| + // Implementation of Unregister(). |map_iter| points to the accelerator to
|
| + // remove, and |target| the AcceleratorTarget to remove.
|
| + void UnregisterImpl(AcceleratorMap::iterator map_iter,
|
| + AcceleratorTarget* target);
|
| +
|
| + AcceleratorManagerDelegate* delegate_;
|
| AcceleratorMap accelerators_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(AcceleratorManager);
|
|
|