Chromium Code Reviews| Index: ui/base/accelerators/accelerator.h |
| diff --git a/ui/base/accelerators/accelerator.h b/ui/base/accelerators/accelerator.h |
| index 430a209f41c3145ee89684acc6a8ca0d778db1de..ff1d4a0b0fc4e83539de93f1513f250cb7daf44c 100644 |
| --- a/ui/base/accelerators/accelerator.h |
| +++ b/ui/base/accelerators/accelerator.h |
| @@ -117,6 +117,27 @@ class AcceleratorProvider { |
| virtual ~AcceleratorProvider() {} |
| }; |
| +// An interface for dispatching accelerators to AcceleratorTargets. |
| +class UI_BASE_EXPORT AcceleratorProcessor { |
|
sky
2015/01/08 23:39:26
Is there a reason this isn't in its own header?
Andre
2015/01/09 00:06:15
Done, moved to its own header.
|
| + public: |
| + // Activate the target associated with the specified accelerator. |
| + // First, AcceleratorPressed handler of the most recently registered target |
| + // is called, and if that handler processes the event (i.e. returns true), |
| + // this method immediately returns. If not, we do the same thing on the next |
| + // target, and so on. |
| + // Returns true if an accelerator was activated. |
| + virtual bool ProcessAccelerator(const Accelerator& accelerator) = 0; |
| + |
| + // Returns the AcceleratorTarget that should be activated for the specified |
| + // keyboard accelerator, or NULL if no view is registered for that keyboard |
|
sky
2015/01/08 23:39:26
view->target
Andre
2015/01/09 00:06:15
Done.
|
| + // accelerator. |
| + virtual AcceleratorTarget* GetTargetForAccelerator( |
| + const Accelerator& accelerator) const = 0; |
| + |
| + protected: |
| + virtual ~AcceleratorProcessor() {} |
| +}; |
| + |
| } // namespace ui |
| #endif // UI_BASE_ACCELERATORS_ACCELERATOR_H_ |