diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-04 22:12:51 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-04 22:12:51 +0000 |
commit | 9a861cc490008122943d4e3df06ddda1f9c5dab1 (patch) | |
tree | 5137df895ccd10a55c0d16f72dc74df690403036 /views/focus | |
parent | 2f9eb5aebf8174a384d5745586a0a81d52c46c00 (diff) | |
download | chromium_src-9a861cc490008122943d4e3df06ddda1f9c5dab1.zip chromium_src-9a861cc490008122943d4e3df06ddda1f9c5dab1.tar.gz chromium_src-9a861cc490008122943d4e3df06ddda1f9c5dab1.tar.bz2 |
views (linux): Fix keyboard shortcuts.
BUG=Pressing backspace in a textfield in a web-page triggers the 'navigate back'
action in the browser. This is because the accelerator gets triggered before the
renderer has a chance to get to the key. To fix this bug, rearrange the keypress
event handler for RenderWidgetHostViewViews. The views-way of keypress handling
is more similar on windows and linux with this change.
TEST=see bug
Review URL: http://codereview.chromium.org/6002007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70456 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/focus')
-rw-r--r-- | views/focus/accelerator_handler_touch.cc | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/views/focus/accelerator_handler_touch.cc b/views/focus/accelerator_handler_touch.cc index a39da9e..84b4404 100644 --- a/views/focus/accelerator_handler_touch.cc +++ b/views/focus/accelerator_handler_touch.cc @@ -153,25 +153,7 @@ bool DispatchXEvent(XEvent* xev) { if (RootView* root = FindRootViewForGdkWindow(gwind)) { switch (xev->type) { - case KeyPress: { - // If Tab is pressed, then the RootView needs to process it first, - // because the focus-manager will move the focus to the next focusable - // view, without letting the currently focused view process it (which - // means, for example, tab-ing to move focus between fields/links in a - // RenderWidgetHostViewViews won't work). For all other keys, let the - // focus manager process it first so that the keyboard accelerators can - // be triggered. - KeyEvent keyev(xev); - FocusManager* focus_manager = root->GetFocusManager(); - if (FocusManager::IsTabTraversalKeyEvent(keyev)) { - return root->ProcessKeyEvent(keyev) || - (focus_manager && !focus_manager->OnKeyEvent(keyev)); - } else { - return (focus_manager && !focus_manager->OnKeyEvent(keyev)) || - root->ProcessKeyEvent(keyev); - } - } - + case KeyPress: case KeyRelease: { KeyEvent keyev(xev); return root->ProcessKeyEvent(keyev); |