summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tabs
diff options
context:
space:
mode:
authordpapad@chromium.org <dpapad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-31 19:34:25 +0000
committerdpapad@chromium.org <dpapad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-31 19:34:25 +0000
commitaeab0721a935b97f452509620921cb705aa4cbb1 (patch)
tree42ea9428ea835ff6183c98423028b91f91aef224 /chrome/browser/tabs
parente1b261ef2f9004e5a9e942908eee28cb6aada36f (diff)
downloadchromium_src-aeab0721a935b97f452509620921cb705aa4cbb1.zip
chromium_src-aeab0721a935b97f452509620921cb705aa4cbb1.tar.gz
chromium_src-aeab0721a935b97f452509620921cb705aa4cbb1.tar.bz2
Multi-tab: Renaming NotifySelectionChanged to NotifyActiveTabChanged
Reasons for renaming 1) The old name no longer reflects the cause of the notification. 2) A new NotifySelectionChanged method will be written (in http://codereview.chromium.org/6933037/) to notify observers which tabs were affected (either selected or deselcted) by a selection change. BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/6965019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87344 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tabs')
-rw-r--r--chrome/browser/tabs/tab_strip_model.cc14
-rw-r--r--chrome/browser/tabs/tab_strip_model.h6
2 files changed, 10 insertions, 10 deletions
diff --git a/chrome/browser/tabs/tab_strip_model.cc b/chrome/browser/tabs/tab_strip_model.cc
index 8948d3f..ea3977e 100644
--- a/chrome/browser/tabs/tab_strip_model.cc
+++ b/chrome/browser/tabs/tab_strip_model.cc
@@ -572,7 +572,7 @@ void TabStripModel::ExtendSelectionTo(int index) {
int old_active = active_index();
selection_model_.SetSelectionFromAnchorTo(index);
// This may not have resulted in a change, but we assume it did.
- NotifySelectionChanged(old_active);
+ NotifyActiveTabChanged(old_active);
}
void TabStripModel::ToggleSelectionAt(int index) {
@@ -593,13 +593,13 @@ void TabStripModel::ToggleSelectionAt(int index) {
selection_model_.set_anchor(index);
selection_model_.set_active(index);
}
- NotifySelectionChanged(old_active);
+ NotifyActiveTabChanged(old_active);
}
void TabStripModel::AddSelectionFromAnchorTo(int index) {
int old_active = active_index();
selection_model_.AddSelectionFromAnchorTo(index);
- NotifySelectionChanged(old_active);
+ NotifyActiveTabChanged(old_active);
}
bool TabStripModel::IsTabSelected(int index) const {
@@ -613,7 +613,7 @@ void TabStripModel::SetSelectionFromModel(
int old_active_index = active_index();
selection_model_.Copy(source);
// This may not have resulted in a change, but we assume it did.
- NotifySelectionChanged(old_active_index);
+ NotifyActiveTabChanged(old_active_index);
}
void TabStripModel::AddTabContents(TabContentsWrapper* contents,
@@ -1225,10 +1225,10 @@ void TabStripModel::NotifyTabSelectedIfChanged(TabContentsWrapper* old_contents,
active_index(), user_gesture));
}
-void TabStripModel::NotifySelectionChanged(int old_selected_index) {
+void TabStripModel::NotifyActiveTabChanged(int old_active_index) {
TabContentsWrapper* old_tab =
- old_selected_index == TabStripSelectionModel::kUnselectedIndex ?
- NULL : GetTabContentsAt(old_selected_index);
+ old_active_index == TabStripSelectionModel::kUnselectedIndex ?
+ NULL : GetTabContentsAt(old_active_index);
TabContentsWrapper* new_tab =
active_index() == TabStripSelectionModel::kUnselectedIndex ?
NULL : GetTabContentsAt(active_index());
diff --git a/chrome/browser/tabs/tab_strip_model.h b/chrome/browser/tabs/tab_strip_model.h
index c0d1e0b..e711b49 100644
--- a/chrome/browser/tabs/tab_strip_model.h
+++ b/chrome/browser/tabs/tab_strip_model.h
@@ -521,9 +521,9 @@ class TabStripModel : public NotificationObserver {
int to_index,
bool user_gesture);
- // Notifies the observers the selection changed. |old_selected_index| gives
- // the old selected index.
- void NotifySelectionChanged(int old_selected_index);
+ // Notifies the observers the active tab changed. |old_active_index| gives
+ // the old active index.
+ void NotifyActiveTabChanged(int old_active_index);
// Returns the number of New Tab tabs in the TabStripModel.
int GetNewTabCount() const;