diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-04 22:08:13 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-04 22:08:13 +0000 |
commit | 7de81411150d5f87ac52fcc5904763ed51dd9c57 (patch) | |
tree | 35cab38dda67cef786e3b89a0f6a1de3ca849537 /views/focus | |
parent | 4327e9a7b0a8d8da2e27122535ca9ff242d53d68 (diff) | |
download | chromium_src-7de81411150d5f87ac52fcc5904763ed51dd9c57.zip chromium_src-7de81411150d5f87ac52fcc5904763ed51dd9c57.tar.gz chromium_src-7de81411150d5f87ac52fcc5904763ed51dd9c57.tar.bz2 |
Fix: Alt+Tab not sending FocusWillChange events.
This causes a DCHECK in FindBarWin if the Find box is open when the user switches to another app with Alt+Tab.
The Focus manager now calls ClearFocus everywhere it used to set focused_view_ = NULL, to make sure the event reaches all listeners for FocusWillChange.
BUG=13350
TEST=Open Chrome, press Ctrl+F then Alt+Tab. Swith focus back to Chrome and press Esc multiple times and you should not see the Find box flash briefly.
Review URL: http://codereview.chromium.org/118267
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17678 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/focus')
-rw-r--r-- | views/focus/focus_manager.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/views/focus/focus_manager.cc b/views/focus/focus_manager.cc index 280aca4..bab4922 100644 --- a/views/focus/focus_manager.cc +++ b/views/focus/focus_manager.cc @@ -350,9 +350,8 @@ bool FocusManager::OnPostActivate(HWND window, void FocusManager::ValidateFocusedView() { if (focused_view_) { - if (!ContainsView(focused_view_)) { - focused_view_ = NULL; - } + if (!ContainsView(focused_view_)) + ClearFocus(); } } @@ -554,7 +553,7 @@ void FocusManager::StoreFocusedView() { view_storage->StoreView(stored_focused_view_storage_id_, focused_view_); View* v = focused_view_; - focused_view_ = NULL; + ClearFocus(); if (v) v->SchedulePaint(); // Remove focus border. @@ -716,7 +715,7 @@ bool FocusManager::IsTabTraversalKeyEvent(const KeyEvent& key_event) { void FocusManager::ViewRemoved(View* parent, View* removed) { if (focused_view_ && focused_view_ == removed) - focused_view_ = NULL; + ClearFocus(); } void FocusManager::AddKeystrokeListener(KeystrokeListener* listener) { |