OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 void PerformDrop(bool drop_before, int index, const GURL& url) override; | 69 void PerformDrop(bool drop_before, int index, const GURL& url) override; |
70 bool IsCompatibleWith(TabStrip* other) const override; | 70 bool IsCompatibleWith(TabStrip* other) const override; |
71 void CreateNewTab() override; | 71 void CreateNewTab() override; |
72 void CreateNewTabWithLocation(const base::string16& loc) override; | 72 void CreateNewTabWithLocation(const base::string16& loc) override; |
73 bool IsIncognito() override; | 73 bool IsIncognito() override; |
74 void StackedLayoutMaybeChanged() override; | 74 void StackedLayoutMaybeChanged() override; |
75 void OnStartedDraggingTabs() override; | 75 void OnStartedDraggingTabs() override; |
76 void OnStoppedDraggingTabs() override; | 76 void OnStoppedDraggingTabs() override; |
77 void CheckFileSupported(const GURL& url) override; | 77 void CheckFileSupported(const GURL& url) override; |
78 SkColor GetToolbarTopSeparatorColor() const override; | 78 SkColor GetToolbarTopSeparatorColor() const override; |
79 base::string16 GetAccessibleTabName() const override; | |
80 | 79 |
81 // TabStripModelObserver implementation: | 80 // TabStripModelObserver implementation: |
82 void TabInsertedAt(TabStripModel* tab_strip_model, | 81 void TabInsertedAt(TabStripModel* tab_strip_model, |
83 content::WebContents* contents, | 82 content::WebContents* contents, |
84 int model_index, | 83 int model_index, |
85 bool is_active) override; | 84 bool is_active) override; |
86 void TabDetachedAt(content::WebContents* contents, int model_index) override; | 85 void TabDetachedAt(content::WebContents* contents, int model_index) override; |
87 void TabSelectionChanged(TabStripModel* tab_strip_model, | 86 void TabSelectionChanged(TabStripModel* tab_strip_model, |
88 const ui::ListSelectionModel& old_model) override; | 87 const ui::ListSelectionModel& old_model) override; |
89 void TabMoved(content::WebContents* contents, | 88 void TabMoved(content::WebContents* contents, |
90 int from_model_index, | 89 int from_model_index, |
91 int to_model_index) override; | 90 int to_model_index) override; |
92 void TabChangedAt(content::WebContents* contents, | 91 void TabChangedAt(content::WebContents* contents, |
93 int model_index, | 92 int model_index, |
94 TabChangeType change_type) override; | 93 TabChangeType change_type) override; |
95 void TabReplacedAt(TabStripModel* tab_strip_model, | 94 void TabReplacedAt(TabStripModel* tab_strip_model, |
96 content::WebContents* old_contents, | 95 content::WebContents* old_contents, |
97 content::WebContents* new_contents, | 96 content::WebContents* new_contents, |
98 int model_index) override; | 97 int model_index) override; |
99 void TabPinnedStateChanged(TabStripModel* tab_strip_model, | 98 void TabPinnedStateChanged(TabStripModel* tab_strip_model, |
100 content::WebContents* contents, | 99 content::WebContents* contents, |
101 int model_index) override; | 100 int model_index) override; |
102 void TabBlockedStateChanged(content::WebContents* contents, | 101 void TabBlockedStateChanged(content::WebContents* contents, |
103 int model_index) override; | 102 int model_index) override; |
104 | 103 |
105 const Browser* browser() const { return browser_; } | |
106 | |
107 protected: | 104 protected: |
108 // The context in which SetTabRendererDataFromModel is being called. | 105 // The context in which SetTabRendererDataFromModel is being called. |
109 enum TabStatus { | 106 enum TabStatus { |
110 NEW_TAB, | 107 NEW_TAB, |
111 EXISTING_TAB | 108 EXISTING_TAB |
112 }; | 109 }; |
113 | 110 |
114 // Sets the TabRendererData from the TabStripModel. | 111 // Sets the TabRendererData from the TabStripModel. |
115 virtual void SetTabRendererDataFromModel(content::WebContents* contents, | 112 virtual void SetTabRendererDataFromModel(content::WebContents* contents, |
116 int model_index, | 113 int model_index, |
117 TabRendererData* data, | 114 TabRendererData* data, |
118 TabStatus tab_status); | 115 TabStatus tab_status); |
119 | 116 |
120 Profile* profile() const { return model_->profile(); } | 117 Profile* profile() const { return model_->profile(); } |
121 | 118 |
122 const TabStrip* tabstrip() const { return tabstrip_; } | 119 const TabStrip* tabstrip() const { return tabstrip_; } |
123 | 120 |
| 121 const Browser* browser() const { return browser_; } |
| 122 |
124 private: | 123 private: |
125 class TabContextMenuContents; | 124 class TabContextMenuContents; |
126 | 125 |
127 // Invokes tabstrip_->SetTabData. | 126 // Invokes tabstrip_->SetTabData. |
128 void SetTabDataAt(content::WebContents* web_contents, int model_index); | 127 void SetTabDataAt(content::WebContents* web_contents, int model_index); |
129 | 128 |
130 void StartHighlightTabsForCommand( | 129 void StartHighlightTabsForCommand( |
131 TabStripModel::ContextMenuCommand command_id, | 130 TabStripModel::ContextMenuCommand command_id, |
132 Tab* tab); | 131 Tab* tab); |
133 void StopHighlightTabsForCommand( | 132 void StopHighlightTabsForCommand( |
(...skipping 30 matching lines...) Expand all Loading... |
164 std::unique_ptr<ImmersiveRevealedLock> immersive_reveal_lock_; | 163 std::unique_ptr<ImmersiveRevealedLock> immersive_reveal_lock_; |
165 | 164 |
166 PrefChangeRegistrar local_pref_registrar_; | 165 PrefChangeRegistrar local_pref_registrar_; |
167 | 166 |
168 base::WeakPtrFactory<BrowserTabStripController> weak_ptr_factory_; | 167 base::WeakPtrFactory<BrowserTabStripController> weak_ptr_factory_; |
169 | 168 |
170 DISALLOW_COPY_AND_ASSIGN(BrowserTabStripController); | 169 DISALLOW_COPY_AND_ASSIGN(BrowserTabStripController); |
171 }; | 170 }; |
172 | 171 |
173 #endif // CHROME_BROWSER_UI_VIEWS_TABS_BROWSER_TAB_STRIP_CONTROLLER_H_ | 172 #endif // CHROME_BROWSER_UI_VIEWS_TABS_BROWSER_TAB_STRIP_CONTROLLER_H_ |
OLD | NEW |