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_UI_VIEWS_TABS_BROWSER_TAB_STRIP_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TABS_BROWSER_TAB_STRIP_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_TABS_BROWSER_TAB_STRIP_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TABS_BROWSER_TAB_STRIP_CONTROLLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "chrome/browser/tabs/tab_strip_model.h" | 10 #include "chrome/browser/tabs/tab_strip_model.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
90 virtual void TabMiniStateChanged(TabContentsWrapper* contents, | 90 virtual void TabMiniStateChanged(TabContentsWrapper* contents, |
91 int model_index) OVERRIDE; | 91 int model_index) OVERRIDE; |
92 virtual void TabBlockedStateChanged(TabContentsWrapper* contents, | 92 virtual void TabBlockedStateChanged(TabContentsWrapper* contents, |
93 int model_index) OVERRIDE; | 93 int model_index) OVERRIDE; |
94 | 94 |
95 // NotificationObserver implementation: | 95 // NotificationObserver implementation: |
96 virtual void Observe(NotificationType type, | 96 virtual void Observe(NotificationType type, |
97 const NotificationSource& source, | 97 const NotificationSource& source, |
98 const NotificationDetails& details) OVERRIDE; | 98 const NotificationDetails& details) OVERRIDE; |
99 | 99 |
100 protected: | |
101 // Sets the TabRendererData from the TabStripModel. | |
102 virtual void SetTabRendererDataFromModel(TabContents* contents, | |
sky
2011/06/16 15:43:41
Position of definition should match that of declar
Emmanuel Saint-loubert-Bié
2011/06/17 00:01:44
Done.
| |
103 int model_index, | |
104 TabRendererData* data, | |
105 bool new_tab); | |
sky
2011/06/16 15:43:41
Use an enum instead of a boolean.
Emmanuel Saint-loubert-Bié
2011/06/17 00:01:44
Done.
| |
106 | |
107 Profile* profile() const { return model_->profile(); } | |
108 | |
109 TabStripModel* model_; | |
sky
2011/06/16 15:43:41
No protected members. Add protected accessors inst
Emmanuel Saint-loubert-Bié
2011/06/17 00:01:44
Done.
| |
110 | |
111 BaseTabStrip* tabstrip_; | |
112 | |
113 // Non-owning pointer to the browser which is using this controller. | |
114 Browser* browser_; | |
115 | |
100 private: | 116 private: |
101 class TabContextMenuContents; | 117 class TabContextMenuContents; |
102 | 118 |
103 // Invokes tabstrip_->SetTabData. | 119 // Invokes tabstrip_->SetTabData. |
104 void SetTabDataAt(TabContentsWrapper* contents, int model_index); | 120 void SetTabDataAt(TabContentsWrapper* contents, int model_index); |
105 | 121 |
106 // Sets the TabRendererData from the TabStripModel. | |
107 void SetTabRendererDataFromModel(TabContents* contents, | |
108 int model_index, | |
109 TabRendererData* data); | |
110 | |
111 void StartHighlightTabsForCommand( | 122 void StartHighlightTabsForCommand( |
112 TabStripModel::ContextMenuCommand command_id, | 123 TabStripModel::ContextMenuCommand command_id, |
113 BaseTab* tab); | 124 BaseTab* tab); |
114 void StopHighlightTabsForCommand( | 125 void StopHighlightTabsForCommand( |
115 TabStripModel::ContextMenuCommand command_id, | 126 TabStripModel::ContextMenuCommand command_id, |
116 BaseTab* tab); | 127 BaseTab* tab); |
117 | 128 |
118 Profile* profile() const { return model_->profile(); } | |
119 | |
120 TabStripModel* model_; | |
121 | |
122 BaseTabStrip* tabstrip_; | |
123 | |
124 // Non-owning pointer to the browser which is using this controller. | |
125 Browser* browser_; | |
126 | |
127 // If non-NULL it means we're showing a menu for the tab. | 129 // If non-NULL it means we're showing a menu for the tab. |
128 scoped_ptr<TabContextMenuContents> context_menu_contents_; | 130 scoped_ptr<TabContextMenuContents> context_menu_contents_; |
129 | 131 |
130 NotificationRegistrar notification_registrar_; | 132 NotificationRegistrar notification_registrar_; |
131 | 133 |
132 // Helper for performing tab selection as a result of dragging over a tab. | 134 // Helper for performing tab selection as a result of dragging over a tab. |
133 HoverTabSelector hover_tab_selector_; | 135 HoverTabSelector hover_tab_selector_; |
134 | 136 |
135 DISALLOW_COPY_AND_ASSIGN(BrowserTabStripController); | 137 DISALLOW_COPY_AND_ASSIGN(BrowserTabStripController); |
136 }; | 138 }; |
137 | 139 |
138 #endif // CHROME_BROWSER_UI_VIEWS_TABS_BROWSER_TAB_STRIP_CONTROLLER_H_ | 140 #endif // CHROME_BROWSER_UI_VIEWS_TABS_BROWSER_TAB_STRIP_CONTROLLER_H_ |
OLD | NEW |