diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-16 01:02:58 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-16 01:02:58 +0000 |
commit | a7867d3df5de7ac0ec6c69d6b721a6b581ba142b (patch) | |
tree | 6ee755aa5eb150b45d9ca905e4a3e6bd54ffb13c /chrome/browser/tabs | |
parent | 85b024483a5f41fe130e86b2a21f278494fff6c9 (diff) | |
download | chromium_src-a7867d3df5de7ac0ec6c69d6b721a6b581ba142b.zip chromium_src-a7867d3df5de7ac0ec6c69d6b721a6b581ba142b.tar.gz chromium_src-a7867d3df5de7ac0ec6c69d6b721a6b581ba142b.tar.bz2 |
Fix an erroneous set of tab change notifications sent whenever closing a tab before the current one. GetSelectedTabContents() was using the old |selected_index_|, which was no longer the selected tab, leading to bogus notifications, which in turn caused other problems.
BUG=16753
TEST=Open Chrome. Hit ctrl-t twice. Type a few letters. Middle click the tab to the left of the current tab (the first "New Tab" you opened). Your typing should not disappear.
Review URL: http://codereview.chromium.org/276052
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29233 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tabs')
-rw-r--r-- | chrome/browser/tabs/tab_strip_model.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/chrome/browser/tabs/tab_strip_model.cc b/chrome/browser/tabs/tab_strip_model.cc index fddeed7..2d3126c 100644 --- a/chrome/browser/tabs/tab_strip_model.cc +++ b/chrome/browser/tabs/tab_strip_model.cc @@ -152,9 +152,9 @@ TabContents* TabStripModel::DetachTabContentsAt(int index) { ChangeSelectedContentsFrom(removed_contents, next_selected_index_, false); } else if (index < selected_index_) { - // If the removed tab was before the selected index, we need to account - // for this in the selected index... - SelectTabContentsAt(selected_index_ - 1, false); + // The selected tab didn't change, but its position shifted; update our + // index to continue to point at it. + --selected_index_; } } next_selected_index_ = selected_index_; |