summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-03 07:54:25 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-03 07:54:25 +0000
commit8db5d1d5105ca1a0ab4938b0bf6baba6fed5825f (patch)
tree27e2e5e98054457c216b3b719d757f78d89dda70 /chrome/browser/views
parent74aa80b4d1dcab7aeaf7251e048bb1cf7ae6733e (diff)
downloadchromium_src-8db5d1d5105ca1a0ab4938b0bf6baba6fed5825f.zip
chromium_src-8db5d1d5105ca1a0ab4938b0bf6baba6fed5825f.tar.gz
chromium_src-8db5d1d5105ca1a0ab4938b0bf6baba6fed5825f.tar.bz2
Roll back this change.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6279 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r--chrome/browser/views/frame/browser_view.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc
index 40b0d3b..ccbb950 100644
--- a/chrome/browser/views/frame/browser_view.cc
+++ b/chrome/browser/views/frame/browser_view.cc
@@ -629,10 +629,16 @@ void BrowserView::Observe(NotificationType type,
// BrowserView, TabStripModelObserver implementation:
void BrowserView::TabDetachedAt(TabContents* contents, int index) {
- // We need to break the TabContentsContainerView's attachment to whatever HWND
- // it's hosting since if the window is destroyed it'll try to hide it even
- // after the new window has parented it.
- contents_container_->SetTabContents(NULL);
+ // We use index here rather than comparing |contents| because by this time
+ // the model has already removed |contents| from its list, so
+ // browser_->GetSelectedTabContents() will return NULL or something else.
+ if (index == browser_->tabstrip_model()->selected_index()) {
+ // We need to reset the current tab contents to NULL before it gets
+ // freed. This is because the focus manager performs some operations
+ // on the selected TabContents when it is removed.
+ infobar_container_->ChangeTabContents(NULL);
+ contents_container_->SetTabContents(NULL);
+ }
}
void BrowserView::TabSelectedAt(TabContents* old_contents,