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