diff options
Diffstat (limited to 'chrome/browser/tabs/tab_strip_model.h')
-rw-r--r-- | chrome/browser/tabs/tab_strip_model.h | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/chrome/browser/tabs/tab_strip_model.h b/chrome/browser/tabs/tab_strip_model.h index 8c6f546..67a5243 100644 --- a/chrome/browser/tabs/tab_strip_model.h +++ b/chrome/browser/tabs/tab_strip_model.h @@ -105,8 +105,17 @@ class TabStripModelObserver { // Invoked when the mini state of a tab changes. This is not invoked if the // tab ends up moving as a result of the mini state changing. + // See note in TabMiniStateChanged as to how this relates to + // TabMiniStateChanged. virtual void TabPinnedStateChanged(TabContents* contents, int index) {} + // Invoked if the mini state of a tab changes. This is not invoked if the + // tab ends up moving as a result of the mini state changing. + // NOTE: this is sent when the pinned state of a non-app tab changes and is + // sent in addition to TabPinnedStateChanged. UI code typically need not care + // about TabPinnedStateChanged, but instead this. + virtual void TabMiniStateChanged(TabContents* contents, int index) {} + // Invoked when the blocked state of a tab changes. // NOTE: This is invoked when a tab becomes blocked/unblocked by a tab modal // window. @@ -294,9 +303,6 @@ class TabStripModel : public NotificationObserver { // Retrieve the index of the currently selected TabContents. int selected_index() const { return selected_index_; } - // See documentation for |next_selected_index_| below. - int next_selected_index() const { return next_selected_index_; } - // Returns true if the tabstrip is currently closing all open tabs (via a // call to CloseAllTabs). As tabs close, the selection in the tabstrip // changes which notifies observers, which can use this as an optimization to @@ -490,6 +496,13 @@ class TabStripModel : public NotificationObserver { // mini-tabs. int IndexOfFirstNonMiniTab() const; + // Returns a valid index for inserting a new tab into this model. |index| is + // the proposed index and |mini_tab| is true if inserting a tab will become + // mini (pinned or app). If |mini_tab| is true, the returned index is between + // 0 and IndexOfFirstNonMiniTab. If |mini_tab| is false, the returned index + // is between IndexOfFirstNonMiniTab and count(). + int ConstrainInsertionIndex(int index, bool mini_tab); + // Command level API ///////////////////////////////////////////////////////// // Adds a TabContents at the best position in the TabStripModel given the @@ -702,14 +715,6 @@ class TabStripModel : public NotificationObserver { // The index of the TabContents in |contents_| that is currently selected. int selected_index_; - // The index of the TabContnets in |contents_| that will be selected when the - // current composite operation completes. A Tab Detach is an example of a - // composite operation - it not only removes a tab from the strip, but also - // causes the selection to shift. Some code needs to know what the next - // selected index will be. In other cases, this value is equal to - // selected_index_. - int next_selected_index_; - // A profile associated with this TabStripModel, used when creating new Tabs. Profile* profile_; |