Chromium Code Reviews| 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 CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 namespace base { | 35 namespace base { |
| 36 class FilePath; | 36 class FilePath; |
| 37 class ListValue; | 37 class ListValue; |
| 38 } | 38 } |
| 39 | 39 |
| 40 namespace content { | 40 namespace content { |
| 41 class ColorChooser; | 41 class ColorChooser; |
| 42 class JavaScriptDialogManager; | 42 class JavaScriptDialogManager; |
| 43 class PageState; | 43 class PageState; |
| 44 class RenderFrameHost; | 44 class RenderFrameHost; |
| 45 class RenderWidgetHost; | |
| 45 class SessionStorageNamespace; | 46 class SessionStorageNamespace; |
| 47 class SiteInstance; | |
| 46 class WebContents; | 48 class WebContents; |
| 47 class WebContentsImpl; | 49 class WebContentsImpl; |
| 48 struct ColorSuggestion; | 50 struct ColorSuggestion; |
| 49 struct ContextMenuParams; | 51 struct ContextMenuParams; |
| 50 struct DropData; | 52 struct DropData; |
| 51 struct FileChooserParams; | 53 struct FileChooserParams; |
| 52 struct NativeWebKeyboardEvent; | 54 struct NativeWebKeyboardEvent; |
| 53 struct Referrer; | 55 struct Referrer; |
| 54 struct SecurityStyleExplanations; | 56 struct SecurityStyleExplanations; |
| 55 } // namespace content | 57 } // namespace content |
| 56 | 58 |
| 57 namespace gfx { | 59 namespace gfx { |
| 58 class Point; | 60 class Point; |
| 59 class Rect; | 61 class Rect; |
| 60 class Size; | 62 class Size; |
| 61 } | 63 } |
| 62 | 64 |
| 63 namespace net { | 65 namespace net { |
| 64 class X509Certificate; | 66 class X509Certificate; |
| 65 } | 67 } |
| 66 | 68 |
| 67 namespace blink { | 69 namespace blink { |
| 68 class WebGestureEvent; | 70 class WebGestureEvent; |
| 69 } | 71 } |
| 70 | 72 |
| 71 namespace content { | 73 namespace content { |
| 72 class RenderWidgetHost; | |
| 73 | 74 |
| 74 struct OpenURLParams; | 75 struct OpenURLParams; |
| 75 struct WebContentsUnresponsiveState; | 76 struct WebContentsUnresponsiveState; |
| 76 | 77 |
| 77 // Objects implement this interface to get notified about changes in the | 78 // Objects implement this interface to get notified about changes in the |
| 78 // WebContents and to provide necessary functionality. | 79 // WebContents and to provide necessary functionality. |
| 79 class CONTENT_EXPORT WebContentsDelegate { | 80 class CONTENT_EXPORT WebContentsDelegate { |
| 80 public: | 81 public: |
| 81 WebContentsDelegate(); | 82 WebContentsDelegate(); |
| 82 | 83 |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 285 // Shows the repost form confirmation dialog box. | 286 // Shows the repost form confirmation dialog box. |
| 286 virtual void ShowRepostFormWarningDialog(WebContents* source) {} | 287 virtual void ShowRepostFormWarningDialog(WebContents* source) {} |
| 287 | 288 |
| 288 // Allows delegate to override navigation to the history entries. | 289 // Allows delegate to override navigation to the history entries. |
| 289 // Returns true to allow WebContents to continue with the default processing. | 290 // Returns true to allow WebContents to continue with the default processing. |
| 290 virtual bool OnGoToEntryOffset(int offset); | 291 virtual bool OnGoToEntryOffset(int offset); |
| 291 | 292 |
| 292 // Allows delegate to control whether a WebContents will be created. Returns | 293 // Allows delegate to control whether a WebContents will be created. Returns |
| 293 // true to allow the creation. Default is to allow it. In cases where the | 294 // true to allow the creation. Default is to allow it. In cases where the |
| 294 // delegate handles the creation/navigation itself, it will use |target_url|. | 295 // delegate handles the creation/navigation itself, it will use |target_url|. |
| 295 // The embedder has to synchronously adopt |route_id| or else the view will | 296 // The embedder has to synchronously adopt |route_id| or else the view will |
|
Charlie Reis
2016/11/23 06:59:48
Is this comment wrong as well? We should probably
ncarter (slow)
2016/11/24 00:00:05
The comment wasn't wrong, just imprecise. In truth
Charlie Reis
2016/11/24 00:31:04
Wow. Yes, that sounds more accurate, and clearly
| |
| 296 // be destroyed. | 297 // be destroyed. |
| 297 virtual bool ShouldCreateWebContents( | 298 virtual bool ShouldCreateWebContents( |
| 298 WebContents* web_contents, | 299 WebContents* web_contents, |
| 300 SiteInstance* source_site_instance, | |
|
Charlie Reis
2016/11/23 06:59:48
Maybe also something in the comment about how web_
ncarter (slow)
2016/11/24 00:00:05
Done.
| |
| 299 int32_t route_id, | 301 int32_t route_id, |
| 300 int32_t main_frame_route_id, | 302 int32_t main_frame_route_id, |
| 301 int32_t main_frame_widget_route_id, | 303 int32_t main_frame_widget_route_id, |
| 302 WindowContainerType window_container_type, | 304 WindowContainerType window_container_type, |
| 305 const GURL& opener_url, | |
| 303 const std::string& frame_name, | 306 const std::string& frame_name, |
| 304 const GURL& target_url, | 307 const GURL& target_url, |
| 305 const std::string& partition_id, | 308 const std::string& partition_id, |
| 306 SessionStorageNamespace* session_storage_namespace); | 309 SessionStorageNamespace* session_storage_namespace); |
| 307 | 310 |
| 308 // Notifies the delegate about the creation of a new WebContents. This | 311 // Notifies the delegate about the creation of a new WebContents. This |
| 309 // typically happens when popups are created. | 312 // typically happens when popups are created. |
| 310 virtual void WebContentsCreated(WebContents* source_contents, | 313 virtual void WebContentsCreated(WebContents* source_contents, |
| 311 int opener_render_process_id, | 314 int opener_render_process_id, |
| 312 int opener_render_frame_id, | 315 int opener_render_frame_id, |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 547 // Called when |this| is no longer the WebContentsDelegate for |source|. | 550 // Called when |this| is no longer the WebContentsDelegate for |source|. |
| 548 void Detach(WebContents* source); | 551 void Detach(WebContents* source); |
| 549 | 552 |
| 550 // The WebContents that this is currently a delegate for. | 553 // The WebContents that this is currently a delegate for. |
| 551 std::set<WebContents*> attached_contents_; | 554 std::set<WebContents*> attached_contents_; |
| 552 }; | 555 }; |
| 553 | 556 |
| 554 } // namespace content | 557 } // namespace content |
| 555 | 558 |
| 556 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ | 559 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ |
| OLD | NEW |