Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(580)

Side by Side Diff: ui/base/accelerators/accelerator_processor.h

Issue 838253004: MacViews: Fix duplicate definition of ExtensionKeyBindingRegistry::SetShortcutHandlingSuspended (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@DragBookmarks2
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_BASE_ACCELERATORS_ACCELERATOR_PROCESSOR_H_
6 #define UI_BASE_ACCELERATORS_ACCELERATOR_PROCESSOR_H_
7
8 #include "ui/base/ui_base_export.h"
9
10 namespace ui {
11
12 class Accelerator;
13 class AcceleratorTarget;
14
15 // An interface for dispatching accelerators to AcceleratorTargets.
16 class UI_BASE_EXPORT AcceleratorProcessor {
17 public:
18 // Activate the target associated with the specified accelerator.
19 // First, AcceleratorPressed handler of the most recently registered target
20 // is called, and if that handler processes the event (i.e. returns true),
21 // this method immediately returns. If not, we do the same thing on the next
22 // target, and so on.
23 // Returns true if an accelerator was activated.
24 virtual bool ProcessAccelerator(const Accelerator& accelerator) = 0;
25
26 // Returns the AcceleratorTarget that should be activated for the specified
27 // keyboard accelerator, or NULL if no target is registered for that keyboard
28 // accelerator.
29 virtual AcceleratorTarget* GetTargetForAccelerator(
30 const Accelerator& accelerator) const = 0;
31
32 protected:
33 virtual ~AcceleratorProcessor() {}
34 };
35
36 } // namespace ui
37
38 #endif // UI_BASE_ACCELERATORS_ACCELERATOR_PROCESSOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698