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

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: Rebasing 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
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
}
« no previous file with comments | « 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