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

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
« no previous file with comments | « ui/views/accessible_pane_view.cc ('k') | ui/views/focus/focus_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/focus/focus_manager.h
===================================================================
--- ui/views/focus/focus_manager.h (revision 123221)
+++ ui/views/focus/focus_manager.h (working copy)
@@ -12,6 +12,7 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
+#include "ui/base/accelerators/accelerator_manager.h"
#include "ui/base/accelerators/accelerator.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/views/events/event.h"
@@ -189,6 +190,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 the priority of the handler.
+ // NOTE: In almost all cases, you should specify kPriorityNormal for this
+ // parameter. Setting it to kPriorityHigh prevents Chrome from sending the
+ // shortcut to the webpage if the renderer has focus, which is not desirable
+ // except for very 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 +205,7 @@
// - any F key (F1, F2, F3 ...)
// - any browser specific keys (as available on special keyboards)
void RegisterAccelerator(const ui::Accelerator& accelerator,
+ ui::AcceleratorManager::HandlerPriority priority,
ui::AcceleratorTarget* target);
// Unregister the specified keyboard accelerator for the specified target.
@@ -239,6 +249,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();
« no previous file with comments | « ui/views/accessible_pane_view.cc ('k') | ui/views/focus/focus_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698