OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_TABS_TAB_STRIP_MODEL_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_TABS_TAB_STRIP_MODEL_OBSERVER_H_ |
6 #define CHROME_BROWSER_TABS_TAB_STRIP_MODEL_OBSERVER_H_ | 6 #define CHROME_BROWSER_TABS_TAB_STRIP_MODEL_OBSERVER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 class TabContentsWrapper; | 9 class TabContentsWrapper; |
10 class TabStripModel; | 10 class TabStripModel; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // by |old_contents| and the newly selected tab by |new_contents|. |index| is | 65 // by |old_contents| and the newly selected tab by |new_contents|. |index| is |
66 // the index of |new_contents|. When using multiple selection this may be sent | 66 // the index of |new_contents|. When using multiple selection this may be sent |
67 // even when the active tab has not changed. For example, if the selection is | 67 // even when the active tab has not changed. For example, if the selection is |
68 // extended this method is invoked to inform observers the selection has | 68 // extended this method is invoked to inform observers the selection has |
69 // changed, but |old_contents| and |new_contents| are the same. If you only | 69 // changed, but |old_contents| and |new_contents| are the same. If you only |
70 // care about when the active tab changes, check for when |old_contents| | 70 // care about when the active tab changes, check for when |old_contents| |
71 // differs from |new_contents|. |user_gesture| specifies whether or not this | 71 // differs from |new_contents|. |user_gesture| specifies whether or not this |
72 // was done by a user input event (e.g. clicking on a tab, keystroke) or as a | 72 // was done by a user input event (e.g. clicking on a tab, keystroke) or as a |
73 // side-effect of some other function. | 73 // side-effect of some other function. |
74 // | 74 // |
75 // TODO(sky): consider not overloading this. Instead rename this to | 75 // TODO(dpapad): Add TabSelectionChanged method for when the selected tabs |
76 // TabActivatedAt (or something) and have TabSelectionChanged as well. | 76 // change. |
77 // TabSelectedAt. This requires renaming everyone to use new terms instead of | 77 virtual void ActiveTabChanged(TabContentsWrapper* old_contents, |
78 // selection. | 78 TabContentsWrapper* new_contents, |
79 virtual void TabSelectedAt(TabContentsWrapper* old_contents, | 79 int index, |
80 TabContentsWrapper* new_contents, | 80 bool user_gesture); |
81 int index, | |
82 bool user_gesture); | |
83 | 81 |
84 // The specified TabContents at |from_index| was moved to |to_index|. | 82 // The specified TabContents at |from_index| was moved to |to_index|. |
85 virtual void TabMoved(TabContentsWrapper* contents, | 83 virtual void TabMoved(TabContentsWrapper* contents, |
86 int from_index, | 84 int from_index, |
87 int to_index); | 85 int to_index); |
88 | 86 |
89 // The specified TabContents at |index| changed in some way. |contents| may | 87 // The specified TabContents at |index| changed in some way. |contents| may |
90 // be an entirely different object and the old value is no longer available | 88 // be an entirely different object and the old value is no longer available |
91 // by the time this message is delivered. | 89 // by the time this message is delivered. |
92 // | 90 // |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 127 |
130 // Invoked when an active/selected tab at |index| is selected again (ie - the | 128 // Invoked when an active/selected tab at |index| is selected again (ie - the |
131 // active/foreground tab is clicked). | 129 // active/foreground tab is clicked). |
132 virtual void ActiveTabClicked(int index); | 130 virtual void ActiveTabClicked(int index); |
133 | 131 |
134 protected: | 132 protected: |
135 virtual ~TabStripModelObserver() {} | 133 virtual ~TabStripModelObserver() {} |
136 }; | 134 }; |
137 | 135 |
138 #endif // CHROME_BROWSER_TABS_TAB_STRIP_MODEL_OBSERVER_H_ | 136 #endif // CHROME_BROWSER_TABS_TAB_STRIP_MODEL_OBSERVER_H_ |
OLD | NEW |