Index: chrome/browser/ui/views/tabs/tab_strip.cc |
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc |
index e35af1d8c299ef3509a7bc869714664f6565720e..40d7fa48b81f976184848eef26a183e8c205feac 100644 |
--- a/chrome/browser/ui/views/tabs/tab_strip.cc |
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc |
@@ -11,6 +11,7 @@ |
#include "base/stl_util-inl.h" |
#include "base/utf_string_conversions.h" |
#include "chrome/browser/defaults.h" |
+#include "chrome/browser/tabs/tab_strip_selection_model.h" |
#include "chrome/browser/themes/theme_service.h" |
#include "chrome/browser/ui/view_ids.h" |
#include "chrome/browser/ui/views/tabs/tab.h" |
@@ -236,7 +237,8 @@ void TabStrip::RemoveTabAt(int model_index) { |
StartRemoveTabAnimation(model_index); |
} |
-void TabStrip::SelectTabAt(int old_model_index, int new_model_index) { |
+void TabStrip::SetSelection(const TabStripSelectionModel& old_selection, |
+ const TabStripSelectionModel& new_selection) { |
// We have "tiny tabs" if the tabs are so tiny that the unselected ones are |
// a different size to the selected ones. |
bool tiny_tabs = current_unselected_width_ != current_selected_width_; |
@@ -246,8 +248,16 @@ void TabStrip::SelectTabAt(int old_model_index, int new_model_index) { |
SchedulePaint(); |
} |
- if (old_model_index >= 0) { |
- GetTabAtTabDataIndex(ModelIndexToTabIndex(old_model_index))-> |
+ TabStripSelectionModel::SelectedIndices no_longer_selected; |
+ std::insert_iterator<TabStripSelectionModel::SelectedIndices> |
+ it(no_longer_selected, no_longer_selected.begin()); |
+ std::set_difference(old_selection.selected_indices().begin(), |
+ old_selection.selected_indices().end(), |
+ new_selection.selected_indices().begin(), |
+ new_selection.selected_indices().end(), |
+ it); |
+ for (size_t i = 0; i < no_longer_selected.size(); ++i) { |
+ GetTabAtTabDataIndex(ModelIndexToTabIndex(no_longer_selected[i]))-> |
StopMiniTabTitleAnimation(); |
} |
} |