diff options
author | yutak@chromium.org <yutak@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-06 00:41:44 +0000 |
---|---|---|
committer | yutak@chromium.org <yutak@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-06 00:41:44 +0000 |
commit | 71421c3fc725d9d55acba7a4233525f8b6e07350 (patch) | |
tree | e35543c073010cf0c4f78c33f898d97a926551c2 /views/view.h | |
parent | e0d770da976974190620824d99262aedaa4242ae (diff) | |
download | chromium_src-71421c3fc725d9d55acba7a4233525f8b6e07350.zip chromium_src-71421c3fc725d9d55acba7a4233525f8b6e07350.tar.gz chromium_src-71421c3fc725d9d55acba7a4233525f8b6e07350.tar.bz2 |
Fix keyboard accelerator registration issue in views::View.
View should not register the same accelerator target multiple times.
BUG=13275
TEST=None
Review URL: http://codereview.chromium.org/118242
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17810 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/view.h')
-rw-r--r-- | views/view.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/views/view.h b/views/view.h index 03291c6..967ce22 100644 --- a/views/view.h +++ b/views/view.h @@ -1127,9 +1127,11 @@ class View : public AcceleratorTarget { void PrintViewHierarchyImp(int indent); void PrintFocusHierarchyImp(int indent); - // Registers/unregister this view's keyboard accelerators with the - // FocusManager. - void RegisterAccelerators(); + // Registers this view's keyboard accelerators that are not registered to + // FocusManager yet, if possible. + void RegisterPendingAccelerators(); + + // Unregisters all the keyboard accelerators associated with this view. void UnregisterAccelerators(); // This View's bounds in the parent coordinate system. @@ -1174,8 +1176,11 @@ class View : public AcceleratorTarget { // Next view to be focused when the Shift-Tab key combination is pressed. View* previous_focusable_view_; - // The list of accelerators. + // The list of accelerators. List elements in the range + // [0, registered_accelerator_count_) are already registered to FocusManager, + // and the rest are not yet. scoped_ptr<std::vector<Accelerator> > accelerators_; + int registered_accelerator_count_; // The menu controller. ContextMenuController* context_menu_controller_; |