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 CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ | 5 #ifndef CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ |
6 #define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ | 6 #define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 13 matching lines...) Expand all Loading... |
24 class Point; | 24 class Point; |
25 class Rect; | 25 class Rect; |
26 class Size; | 26 class Size; |
27 } | 27 } |
28 | 28 |
29 namespace history { | 29 namespace history { |
30 class HistoryAddPageArgs; | 30 class HistoryAddPageArgs; |
31 } | 31 } |
32 | 32 |
33 struct ContextMenuParams; | 33 struct ContextMenuParams; |
| 34 class DownloadItem; |
34 class GURL; | 35 class GURL; |
35 class HtmlDialogUIDelegate; | 36 class HtmlDialogUIDelegate; |
36 struct NativeWebKeyboardEvent; | 37 struct NativeWebKeyboardEvent; |
37 class Profile; | 38 class Profile; |
38 class RenderViewHost; | 39 class RenderViewHost; |
39 class TabContents; | 40 class TabContents; |
40 | 41 |
41 // Objects implement this interface to get notified about changes in the | 42 // Objects implement this interface to get notified about changes in the |
42 // TabContents and to provide necessary functionality. | 43 // TabContents and to provide necessary functionality. |
43 class TabContentsDelegate { | 44 class TabContentsDelegate { |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 | 184 |
184 // Changes the blocked state of the tab at |index|. TabContents are | 185 // Changes the blocked state of the tab at |index|. TabContents are |
185 // considered blocked while displaying a tab modal dialog. During that time | 186 // considered blocked while displaying a tab modal dialog. During that time |
186 // renderer host will ignore any UI interaction within TabContent outside of | 187 // renderer host will ignore any UI interaction within TabContent outside of |
187 // the currently displaying dialog. | 188 // the currently displaying dialog. |
188 virtual void SetTabContentBlocked(TabContents* contents, bool blocked); | 189 virtual void SetTabContentBlocked(TabContents* contents, bool blocked); |
189 | 190 |
190 // Notification that |tab_contents| has gained focus. | 191 // Notification that |tab_contents| has gained focus. |
191 virtual void TabContentsFocused(TabContents* tab_content); | 192 virtual void TabContentsFocused(TabContents* tab_content); |
192 | 193 |
| 194 // Asks the delegate if the given tab can download. |
| 195 virtual bool CanDownload(TabContents* source, int request_id); |
| 196 |
| 197 // Notifies the delegate that a download is starting. |
| 198 virtual void OnStartDownload(TabContents* source, DownloadItem* download); |
| 199 |
193 // Return much extra vertical space should be allotted to the | 200 // Return much extra vertical space should be allotted to the |
194 // render view widget during various animations (e.g. infobar closing). | 201 // render view widget during various animations (e.g. infobar closing). |
195 // This is used to make painting look smoother. | 202 // This is used to make painting look smoother. |
196 virtual int GetExtraRenderViewHeight() const; | 203 virtual int GetExtraRenderViewHeight() const; |
197 | 204 |
198 // Returns true if the context menu operation was handled by the delegate. | 205 // Returns true if the context menu operation was handled by the delegate. |
199 virtual bool HandleContextMenu(const ContextMenuParams& params); | 206 virtual bool HandleContextMenu(const ContextMenuParams& params); |
200 | 207 |
201 // Returns true if the context menu command was handled | 208 // Returns true if the context menu command was handled |
202 virtual bool ExecuteContextMenuCommand(int command); | 209 virtual bool ExecuteContextMenuCommand(int command); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 void Attach(TabContents* source); | 299 void Attach(TabContents* source); |
293 | 300 |
294 // Called when |this| is no longer the TabContentsDelegate for |source|. | 301 // Called when |this| is no longer the TabContentsDelegate for |source|. |
295 void Detach(TabContents* source); | 302 void Detach(TabContents* source); |
296 | 303 |
297 // The TabContents that this is currently a delegate for. | 304 // The TabContents that this is currently a delegate for. |
298 std::set<TabContents*> attached_contents_; | 305 std::set<TabContents*> attached_contents_; |
299 }; | 306 }; |
300 | 307 |
301 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ | 308 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ |
OLD | NEW |