summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-25 22:27:41 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-25 22:27:41 +0000
commit7f2855f8e27cca78479481d80a06618568c8d10a (patch)
tree21ccd397787afa9c1f33bb4141a23b56b01c789f /chrome/browser/views
parent7e2639413fc87b91d1327a57303493d84823f070 (diff)
downloadchromium_src-7f2855f8e27cca78479481d80a06618568c8d10a.zip
chromium_src-7f2855f8e27cca78479481d80a06618568c8d10a.tar.gz
chromium_src-7f2855f8e27cca78479481d80a06618568c8d10a.tar.bz2
Some crashes reported from the field seems to indicate that when
storing/restoring the focused view on a tab, the focus manager or focused view is garbage. I have not been able to repro any of these crashers and was not able to discover much from the mini-dumps. This is a simple work-around that just prevents the storing/restoring of focus when closing a tab, to avoid the cases reported in the crasher. Note this is the equivalent of CL 12622 (which is on the release branck), which was reviewed by Ben. BUG=4633 Review URL: http://codereview.chromium.org/12652 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6000 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r--chrome/browser/views/frame/browser_view.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc
index 91b148c..019fdc8 100644
--- a/chrome/browser/views/frame/browser_view.cc
+++ b/chrome/browser/views/frame/browser_view.cc
@@ -647,7 +647,10 @@ void BrowserView::TabSelectedAt(TabContents* old_contents,
bool user_gesture) {
DCHECK(old_contents != new_contents);
- if (old_contents)
+ // We do not store the focus when closing the tab to work-around bug 4633.
+ // Some reports seem to show that the focus manager and/or focused view can
+ // be garbage at that point, it is not clear why.
+ if (old_contents && !old_contents->is_being_destroyed())
old_contents->StoreFocus();
// Update various elements that are interested in knowing the current
@@ -659,8 +662,10 @@ void BrowserView::TabSelectedAt(TabContents* old_contents,
// required to make features like Duplicate Tab, Undo Close Tab,
// etc not result in sad tab.
new_contents->DidBecomeSelected();
- if (BrowserList::GetLastActive() == browser_)
+ if (BrowserList::GetLastActive() == browser_ &&
+ !browser_->tabstrip_model()->closing_all()) {
new_contents->RestoreFocus();
+ }
// Update all the UI bits.
UpdateTitleBar();