summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tabs/tab_strip_model.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/tabs/tab_strip_model.cc')
-rw-r--r--chrome/browser/tabs/tab_strip_model.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/chrome/browser/tabs/tab_strip_model.cc b/chrome/browser/tabs/tab_strip_model.cc
index e1a93f3..e5a509f 100644
--- a/chrome/browser/tabs/tab_strip_model.cc
+++ b/chrome/browser/tabs/tab_strip_model.cc
@@ -561,9 +561,14 @@ void TabStripModel::ChangeSelectedContentsFrom(
TabContents* new_contents = GetContentsAt(to_index);
if (old_contents == new_contents)
return;
+
TabContents* last_selected_contents = old_contents;
- selected_index_ = to_index;
+ if (last_selected_contents) {
+ FOR_EACH_OBSERVER(TabStripModelObserver, observers_,
+ TabDeselectedAt(last_selected_contents, selected_index_));
+ }
+ selected_index_ = to_index;
FOR_EACH_OBSERVER(TabStripModelObserver, observers_,
TabSelectedAt(last_selected_contents, new_contents, selected_index_,
user_gesture));