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 <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "content/browser/tab_contents/navigation_entry.h" | 12 #include "content/browser/tab_contents/navigation_entry.h" |
13 #include "content/common/navigation_types.h" | 13 #include "content/common/navigation_types.h" |
14 #include "content/common/page_transition_types.h" | 14 #include "content/common/page_transition_types.h" |
15 #include "ui/gfx/native_widget_types.h" | 15 #include "ui/gfx/native_widget_types.h" |
16 #include "webkit/glue/window_open_disposition.h" | 16 #include "webkit/glue/window_open_disposition.h" |
17 | 17 |
18 namespace gfx { | 18 namespace gfx { |
19 class Point; | 19 class Point; |
20 class Rect; | 20 class Rect; |
21 class Size; | 21 class Size; |
22 } | 22 } |
23 | 23 |
24 namespace history { | 24 namespace history { |
25 class HistoryAddPageArgs; | 25 class HistoryAddPageArgs; |
26 } | 26 } |
27 | 27 |
28 struct ContextMenuParams; | 28 struct ContextMenuParams; |
| 29 class DownloadItem; |
29 class GURL; | 30 class GURL; |
30 class HtmlDialogUIDelegate; | 31 class HtmlDialogUIDelegate; |
31 struct NativeWebKeyboardEvent; | 32 struct NativeWebKeyboardEvent; |
32 class Profile; | 33 class Profile; |
33 class RenderViewHost; | 34 class RenderViewHost; |
34 class TabContents; | 35 class TabContents; |
35 | 36 |
36 // Objects implement this interface to get notified about changes in the | 37 // Objects implement this interface to get notified about changes in the |
37 // TabContents and to provide necessary functionality. | 38 // TabContents and to provide necessary functionality. |
38 class TabContentsDelegate { | 39 class TabContentsDelegate { |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 virtual void SetTabContentBlocked(TabContents* contents, bool blocked); | 195 virtual void SetTabContentBlocked(TabContents* contents, bool blocked); |
195 | 196 |
196 // Notification that |tab_contents| has gained focus. | 197 // Notification that |tab_contents| has gained focus. |
197 virtual void TabContentsFocused(TabContents* tab_content); | 198 virtual void TabContentsFocused(TabContents* tab_content); |
198 | 199 |
199 // Return much extra vertical space should be allotted to the | 200 // Return much extra vertical space should be allotted to the |
200 // render view widget during various animations (e.g. infobar closing). | 201 // render view widget during various animations (e.g. infobar closing). |
201 // This is used to make painting look smoother. | 202 // This is used to make painting look smoother. |
202 virtual int GetExtraRenderViewHeight() const; | 203 virtual int GetExtraRenderViewHeight() const; |
203 | 204 |
| 205 virtual bool CanDownload(int request_id); |
| 206 |
| 207 virtual void OnStartDownload(DownloadItem* download, TabContents* tab); |
| 208 |
204 // Returns true if the context menu operation was handled by the delegate. | 209 // Returns true if the context menu operation was handled by the delegate. |
205 virtual bool HandleContextMenu(const ContextMenuParams& params); | 210 virtual bool HandleContextMenu(const ContextMenuParams& params); |
206 | 211 |
207 // Returns true if the context menu command was handled | 212 // Returns true if the context menu command was handled |
208 virtual bool ExecuteContextMenuCommand(int command); | 213 virtual bool ExecuteContextMenuCommand(int command); |
209 | 214 |
210 // Shows the page info using the specified information. | 215 // Shows the page info using the specified information. |
211 // |url| is the url of the page/frame the info applies to, |ssl| is the SSL | 216 // |url| is the url of the page/frame the info applies to, |ssl| is the SSL |
212 // information for that page/frame. If |show_history| is true, a section | 217 // information for that page/frame. If |show_history| is true, a section |
213 // showing how many times that URL has been visited is added to the page info. | 218 // showing how many times that URL has been visited is added to the page info. |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 virtual bool ShouldShowHungRendererDialog(); | 291 virtual bool ShouldShowHungRendererDialog(); |
287 | 292 |
288 // Notification that a worker associated with this tab has crashed. | 293 // Notification that a worker associated with this tab has crashed. |
289 virtual void WorkerCrashed(); | 294 virtual void WorkerCrashed(); |
290 | 295 |
291 protected: | 296 protected: |
292 virtual ~TabContentsDelegate(); | 297 virtual ~TabContentsDelegate(); |
293 }; | 298 }; |
294 | 299 |
295 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ | 300 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ |
OLD | NEW |