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

Unified Diff: ui/views/focus/focus_manager.h

Issue 9402018: Experimental Extension Keybinding (first cut). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 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/views/focus/focus_manager.h
===================================================================
--- ui/views/focus/focus_manager.h (revision 122745)
+++ ui/views/focus/focus_manager.h (working copy)
@@ -189,6 +189,14 @@
// Register a keyboard accelerator for the specified target. If multiple
// targets are registered for an accelerator, a target registered later has
// higher priority.
+ // |accelerator| is the accelerator to register.
+ // |priority| denotes whether the |target| is a priority handler or not.
+ // NOTE: In almost all cases, you should specify |false| for this parameter.
+ // Setting it to |true| prevents Chrome from sending the shortcut to the
+ // webpage if the renderer has focus, which is not desirable except for
+ // isolated cases.
+ // |target| is the AcceleratorTarget that handles the event once the
+ // accelerator is pressed.
// Note that we are currently limited to accelerators that are either:
// - a key combination including Ctrl or Alt
// - the escape key
@@ -196,6 +204,7 @@
// - any F key (F1, F2, F3 ...)
// - any browser specific keys (as available on special keyboards)
void RegisterAccelerator(const ui::Accelerator& accelerator,
+ bool priority,
ui::AcceleratorTarget* target);
// Unregister the specified keyboard accelerator for the specified target.
@@ -239,6 +248,9 @@
ui::AcceleratorTarget* GetCurrentTargetForAccelerator(
const ui::Accelerator& accelertor) const;
+ // Whether the given |accelerator| has a priority handler associated with it.
+ bool HasPriorityHandler(const ui::Accelerator& accelerator) const;
+
// Clears the native view having the focus.
virtual void ClearNativeFocus();

Powered by Google App Engine
This is Rietveld 408576698