Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2984)

Unified Diff: chrome/browser/ui/views/tabs/tab_strip.cc

Issue 7033048: Multi-tab: Adding new Notification when tab selection changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressing comments Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 990bcecac37ce35856924931ab33f5bf3c77332b..b031d9a0f2c2f4d3fe18d2d7806ce53de2ae6759 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -229,7 +229,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_;
@@ -239,8 +240,14 @@ 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::set_difference(old_selection.selected_indices().begin(),
+ old_selection.selected_indices().end(),
+ new_selection.selected_indices().begin(),
+ new_selection.selected_indices().end(),
+ no_longer_selected.begin());
+ for (size_t i = 0; i < no_longer_selected.size(); ++i) {
+ GetTabAtTabDataIndex(ModelIndexToTabIndex(no_longer_selected[i]))->
StopMiniTabTitleAnimation();
}
}
« chrome/browser/ui/views/tabs/side_tab_strip.h ('K') | « chrome/browser/ui/views/tabs/tab_strip.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698