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 "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/prefs/pref_change_registrar.h" | 10 #include "base/prefs/pref_change_registrar.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 virtual void PerformDrop(bool drop_before, | 67 virtual void PerformDrop(bool drop_before, |
68 int index, | 68 int index, |
69 const GURL& url) OVERRIDE; | 69 const GURL& url) OVERRIDE; |
70 virtual bool IsCompatibleWith(TabStrip* other) const OVERRIDE; | 70 virtual bool IsCompatibleWith(TabStrip* other) const OVERRIDE; |
71 virtual void CreateNewTab() OVERRIDE; | 71 virtual void CreateNewTab() OVERRIDE; |
72 virtual void CreateNewTabWithLocation(const base::string16& loc) OVERRIDE; | 72 virtual void CreateNewTabWithLocation(const base::string16& loc) OVERRIDE; |
73 virtual bool IsIncognito() OVERRIDE; | 73 virtual bool IsIncognito() OVERRIDE; |
74 virtual void LayoutTypeMaybeChanged() OVERRIDE; | 74 virtual void LayoutTypeMaybeChanged() OVERRIDE; |
75 virtual void OnStartedDraggingTabs() OVERRIDE; | 75 virtual void OnStartedDraggingTabs() OVERRIDE; |
76 virtual void OnStoppedDraggingTabs() OVERRIDE; | 76 virtual void OnStoppedDraggingTabs() OVERRIDE; |
| 77 virtual void CheckFileSupported(const GURL& url) OVERRIDE; |
77 | 78 |
78 // TabStripModelObserver implementation: | 79 // TabStripModelObserver implementation: |
79 virtual void TabInsertedAt(content::WebContents* contents, | 80 virtual void TabInsertedAt(content::WebContents* contents, |
80 int model_index, | 81 int model_index, |
81 bool is_active) OVERRIDE; | 82 bool is_active) OVERRIDE; |
82 virtual void TabDetachedAt(content::WebContents* contents, | 83 virtual void TabDetachedAt(content::WebContents* contents, |
83 int model_index) OVERRIDE; | 84 int model_index) OVERRIDE; |
84 virtual void TabSelectionChanged( | 85 virtual void TabSelectionChanged( |
85 TabStripModel* tab_strip_model, | 86 TabStripModel* tab_strip_model, |
86 const ui::ListSelectionModel& old_model) OVERRIDE; | 87 const ui::ListSelectionModel& old_model) OVERRIDE; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 void StopHighlightTabsForCommand( | 133 void StopHighlightTabsForCommand( |
133 TabStripModel::ContextMenuCommand command_id, | 134 TabStripModel::ContextMenuCommand command_id, |
134 Tab* tab); | 135 Tab* tab); |
135 | 136 |
136 // Adds a tab. | 137 // Adds a tab. |
137 void AddTab(content::WebContents* contents, int index, bool is_active); | 138 void AddTab(content::WebContents* contents, int index, bool is_active); |
138 | 139 |
139 // Resets the tabstrips layout type from prefs. | 140 // Resets the tabstrips layout type from prefs. |
140 void UpdateLayoutType(); | 141 void UpdateLayoutType(); |
141 | 142 |
| 143 // Notifies the tabstrip whether |url| is supported once a MIME type request |
| 144 // has completed. |
| 145 void OnFindURLMimeTypeCompleted(const GURL& url, |
| 146 const std::string& mime_type); |
| 147 |
142 TabStripModel* model_; | 148 TabStripModel* model_; |
143 | 149 |
144 TabStrip* tabstrip_; | 150 TabStrip* tabstrip_; |
145 | 151 |
146 // Non-owning pointer to the browser which is using this controller. | 152 // Non-owning pointer to the browser which is using this controller. |
147 Browser* browser_; | 153 Browser* browser_; |
148 | 154 |
149 // If non-NULL it means we're showing a menu for the tab. | 155 // If non-NULL it means we're showing a menu for the tab. |
150 scoped_ptr<TabContextMenuContents> context_menu_contents_; | 156 scoped_ptr<TabContextMenuContents> context_menu_contents_; |
151 | 157 |
152 // Helper for performing tab selection as a result of dragging over a tab. | 158 // Helper for performing tab selection as a result of dragging over a tab. |
153 HoverTabSelector hover_tab_selector_; | 159 HoverTabSelector hover_tab_selector_; |
154 | 160 |
155 // Forces the tabs to use the regular (non-immersive) style and the | 161 // Forces the tabs to use the regular (non-immersive) style and the |
156 // top-of-window views to be revealed when the user is dragging |tabstrip|'s | 162 // top-of-window views to be revealed when the user is dragging |tabstrip|'s |
157 // tabs. | 163 // tabs. |
158 scoped_ptr<ImmersiveRevealedLock> immersive_reveal_lock_; | 164 scoped_ptr<ImmersiveRevealedLock> immersive_reveal_lock_; |
159 | 165 |
160 PrefChangeRegistrar local_pref_registrar_; | 166 PrefChangeRegistrar local_pref_registrar_; |
161 | 167 |
| 168 base::WeakPtrFactory<BrowserTabStripController> weak_ptr_factory_; |
| 169 |
162 DISALLOW_COPY_AND_ASSIGN(BrowserTabStripController); | 170 DISALLOW_COPY_AND_ASSIGN(BrowserTabStripController); |
163 }; | 171 }; |
164 | 172 |
165 #endif // CHROME_BROWSER_UI_VIEWS_TABS_BROWSER_TAB_STRIP_CONTROLLER_H_ | 173 #endif // CHROME_BROWSER_UI_VIEWS_TABS_BROWSER_TAB_STRIP_CONTROLLER_H_ |
OLD | NEW |