Chromium Code Reviews| 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..78e5bb985173ed498feea647f705b38d59bc04d7 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. |
|
sky
2011/06/13 22:20:16
'ActiveTabChanged' -> |ActiveTabChanged|
dpapad
2011/06/14 16:58:23
Done.
|
| + // 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, |