| Index: ui/base/accelerators/accelerator_processor.h
|
| diff --git a/ui/base/accelerators/accelerator_processor.h b/ui/base/accelerators/accelerator_processor.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..f9eff32e6bd25de24511fbea0a1a44e930f0529e
|
| --- /dev/null
|
| +++ b/ui/base/accelerators/accelerator_processor.h
|
| @@ -0,0 +1,38 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef UI_BASE_ACCELERATORS_ACCELERATOR_PROCESSOR_H_
|
| +#define UI_BASE_ACCELERATORS_ACCELERATOR_PROCESSOR_H_
|
| +
|
| +#include "ui/base/ui_base_export.h"
|
| +
|
| +namespace ui {
|
| +
|
| +class Accelerator;
|
| +class AcceleratorTarget;
|
| +
|
| +// An interface for dispatching accelerators to AcceleratorTargets.
|
| +class UI_BASE_EXPORT AcceleratorProcessor {
|
| + 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 target is registered for that keyboard
|
| + // accelerator.
|
| + virtual AcceleratorTarget* GetTargetForAccelerator(
|
| + const Accelerator& accelerator) const = 0;
|
| +
|
| + protected:
|
| + virtual ~AcceleratorProcessor() {}
|
| +};
|
| +
|
| +} // namespace ui
|
| +
|
| +#endif // UI_BASE_ACCELERATORS_ACCELERATOR_PROCESSOR_H_
|
|
|