summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-23 15:27:22 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-23 15:27:22 +0000
commit12e742ee34fff97cfb42065d543c984b4178c5d6 (patch)
treee772d9864b2c8954b051506a3e53f3456e7972eb
parentab8a47d3e1987bf0fb09d6bb84364e30ab7b8ea6 (diff)
downloadchromium_src-12e742ee34fff97cfb42065d543c984b4178c5d6.zip
chromium_src-12e742ee34fff97cfb42065d543c984b4178c5d6.tar.gz
chromium_src-12e742ee34fff97cfb42065d543c984b4178c5d6.tar.bz2
Fixes crasher that occurs when using keyboard to navigate focus and
enter triggers a focus change. BUG=2554 TEST=see bug Review URL: http://codereview.chromium.org/4014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2487 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/views/toolbar_view.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/chrome/browser/views/toolbar_view.cc b/chrome/browser/views/toolbar_view.cc
index 8d7ce07..b381125 100644
--- a/chrome/browser/views/toolbar_view.cc
+++ b/chrome/browser/views/toolbar_view.cc
@@ -415,6 +415,10 @@ bool BrowserToolbarView::OnKeyPressed(const ChromeViews::KeyEvent& e) {
GetViewContainer()->GetTooltipManager()->HideKeyboardTooltip();
// Safe to cast, given to above view id check.
static_cast<ChromeViews::MenuButton*>(acc_focused_view_)->Activate();
+ if (!acc_focused_view_) {
+ // Activate triggered a focus change, don't try to change focus.
+ return true;
+ }
// Re-enable hot-tracking, as Activate() will disable it.
acc_focused_view_->SetHotTracked(true);
break;