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

Unified Diff: chrome/browser/tabs/tab_strip_model_observer.h

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/tabs/tab_strip_model.cc ('k') | chrome/browser/tabs/tab_strip_model_observer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tabs/tab_strip_model_observer.h
diff --git a/chrome/browser/tabs/tab_strip_model_observer.h b/chrome/browser/tabs/tab_strip_model_observer.h
index b2753508c3a3b43e9da450429fcab804dad735de..5a69eb55b187234ce6d333d19b39e3966599ba2a 100644
--- a/chrome/browser/tabs/tab_strip_model_observer.h
+++ b/chrome/browser/tabs/tab_strip_model_observer.h
@@ -8,6 +8,7 @@
class TabContentsWrapper;
class TabStripModel;
+class TabStripSelectionModel;
////////////////////////////////////////////////////////////////////////////////
//
@@ -61,24 +62,26 @@ class TabStripModelObserver {
// happens.
virtual void TabDeactivated(TabContentsWrapper* contents);
- // Sent when the selection changes. The previously selected tab is identified
- // by |old_contents| and the newly selected tab by |new_contents|. |index| is
- // the index of |new_contents|. When using multiple selection this may be sent
- // even when the active tab has not changed. For example, if the selection is
- // extended this method is invoked to inform observers the selection has
- // changed, but |old_contents| and |new_contents| are the same. If you only
- // care about when the active tab changes, check for when |old_contents|
- // differs from |new_contents|. |user_gesture| specifies whether or not this
+ // Sent when the active tab changes. The previously active tab is identified
+ // by |old_contents| and the newly active tab by |new_contents|. |index| is
+ // the index of |new_contents|. |user_gesture| specifies whether or not this
// was done by a user input event (e.g. clicking on a tab, keystroke) or as a
// side-effect of some other function.
- //
- // TODO(dpapad): Add TabSelectionChanged method for when the selected tabs
- // change.
+ // Note: It is possible for the selection to change while the active tab
+ // remains unchanged. For example, control-click may not change the active tab
+ // but does change the selection. In this case |ActiveTabChanged| is not sent.
+ // If you care about any changes to the selection, override
+ // TabSelectionChanged.
virtual void ActiveTabChanged(TabContentsWrapper* old_contents,
TabContentsWrapper* new_contents,
int index,
bool user_gesture);
+ // Sent when the selection changes. More precisely when selected tabs, anchor
+ // tab or active tab change. |old_model| is a snapshot of the selection model
+ // before the change. See also ActiveTabChanged for details.
+ virtual void TabSelectionChanged(const TabStripSelectionModel& old_model);
+
// The specified TabContents at |from_index| was moved to |to_index|.
virtual void TabMoved(TabContentsWrapper* contents,
int from_index,
« no previous file with comments | « chrome/browser/tabs/tab_strip_model.cc ('k') | chrome/browser/tabs/tab_strip_model_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698