summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/dom_view.cc
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-14 04:28:07 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-14 04:28:07 +0000
commitca13d804c304a61711352044022971ec39f9d4f8 (patch)
tree81e2f1039a317a4ba5177ec98d18a545c0ff9c94 /chrome/browser/views/dom_view.cc
parent921515182691bf105b404862bf80ae7dfc0e151e (diff)
downloadchromium_src-ca13d804c304a61711352044022971ec39f9d4f8.zip
chromium_src-ca13d804c304a61711352044022971ec39f9d4f8.tar.gz
chromium_src-ca13d804c304a61711352044022971ec39f9d4f8.tar.bz2
Clean-up of the accelerator code.
The View::CanProcessTabKeyEvents and View::ShouldLookUpAccelerator have both been replaced with a new method, SkipDefaultKeyEventProcessing. This new method provides for a view that has focus a way to prevent a key event from being processed for tab traversal or accelerators. Also, fixed a regression where the Ctrl-Tab accelerator was not working anymore when the omnibox was focused. BUG=11538 TEST=Thoroughly test accelerators, making sure they work when the page, the omnibox and the find-bar text-field have focus. Also test that tab traversal still work as expected in the browser and in the option dialog. Review URL: http://codereview.chromium.org/113307 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16037 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/dom_view.cc')
-rw-r--r--chrome/browser/views/dom_view.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/chrome/browser/views/dom_view.cc b/chrome/browser/views/dom_view.cc
index fbbd2f5..7213bcf 100644
--- a/chrome/browser/views/dom_view.cc
+++ b/chrome/browser/views/dom_view.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/views/dom_view.h"
#include "chrome/browser/tab_contents/tab_contents.h"
+#include "views/focus/focus_manager.h"
DOMView::DOMView() : initialized_(false), tab_contents_(NULL) {
SetFocusable(true);
@@ -30,3 +31,10 @@ void DOMView::LoadURL(const GURL& url) {
DCHECK(initialized_);
tab_contents_->controller().LoadURL(url, GURL(), PageTransition::START_PAGE);
}
+
+bool DOMView::SkipDefaultKeyEventProcessing(const views::KeyEvent& e) {
+ // Don't move the focus to the next view when tab is pressed, we want the
+ // key event to be propagated to the render view for doing the tab traversal
+ // there.
+ return views::FocusManager::IsTabTraversalKeyEvent(e);
+}