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

Unified Diff: ui/base/accelerators/accelerator.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 side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698