| 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 <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 | 269 |
| 270 // Shows the repost form confirmation dialog box. | 270 // Shows the repost form confirmation dialog box. |
| 271 virtual void ShowRepostFormWarningDialog(WebContents* source) {} | 271 virtual void ShowRepostFormWarningDialog(WebContents* source) {} |
| 272 | 272 |
| 273 // Allows delegate to override navigation to the history entries. | 273 // Allows delegate to override navigation to the history entries. |
| 274 // Returns true to allow WebContents to continue with the default processing. | 274 // Returns true to allow WebContents to continue with the default processing. |
| 275 virtual bool OnGoToEntryOffset(int offset); | 275 virtual bool OnGoToEntryOffset(int offset); |
| 276 | 276 |
| 277 // Allows delegate to control whether a WebContents will be created. Returns | 277 // Allows delegate to control whether a WebContents will be created. Returns |
| 278 // true to allow the creation. Default is to allow it. In cases where the | 278 // true to allow the creation. Default is to allow it. In cases where the |
| 279 // delegate handles the creation/navigation itself, it will use |target_url|. | 279 // delegate handles the creation/navigation itself, it will use the values |
| 280 // within |target_url| and |params| to get information on the target site, |
| 281 // size and position of the window, etc. |
| 280 virtual bool ShouldCreateWebContents( | 282 virtual bool ShouldCreateWebContents( |
| 281 WebContents* web_contents, | 283 WebContents* web_contents, |
| 282 int route_id, | 284 int route_id, |
| 283 WindowContainerType window_container_type, | 285 WindowContainerType window_container_type, |
| 284 const string16& frame_name, | 286 const string16& frame_name, |
| 285 const GURL& target_url); | 287 const GURL& target_url, |
| 288 const WebKit::WindowFeatures& web_window_features); |
| 286 | 289 |
| 287 // Notifies the delegate about the creation of a new WebContents. This | 290 // Notifies the delegate about the creation of a new WebContents. This |
| 288 // typically happens when popups are created. | 291 // typically happens when popups are created. |
| 289 virtual void WebContentsCreated(WebContents* source_contents, | 292 virtual void WebContentsCreated( |
| 290 int64 source_frame_id, | 293 WebContents* source_contents, |
| 291 const string16& frame_name, | 294 int64 source_frame_id, |
| 292 const GURL& target_url, | 295 const string16& frame_name, |
| 293 WebContents* new_contents) {} | 296 const GURL& target_url, |
| 297 const WebKit::WindowFeatures& web_window_features, |
| 298 WebContents* new_contents) {} |
| 294 | 299 |
| 295 // Notifies the delegate that the content restrictions for this tab has | 300 // Notifies the delegate that the content restrictions for this tab has |
| 296 // changed. | 301 // changed. |
| 297 virtual void ContentRestrictionsChanged(WebContents* source) {} | 302 virtual void ContentRestrictionsChanged(WebContents* source) {} |
| 298 | 303 |
| 299 // Notification that the tab is hung. | 304 // Notification that the tab is hung. |
| 300 virtual void RendererUnresponsive(WebContents* source) {} | 305 virtual void RendererUnresponsive(WebContents* source) {} |
| 301 | 306 |
| 302 // Notification that the tab is no longer hung. | 307 // Notification that the tab is no longer hung. |
| 303 virtual void RendererResponsive(WebContents* source) {} | 308 virtual void RendererResponsive(WebContents* source) {} |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 // Called when |this| is no longer the WebContentsDelegate for |source|. | 433 // Called when |this| is no longer the WebContentsDelegate for |source|. |
| 429 void Detach(WebContents* source); | 434 void Detach(WebContents* source); |
| 430 | 435 |
| 431 // The WebContents that this is currently a delegate for. | 436 // The WebContents that this is currently a delegate for. |
| 432 std::set<WebContents*> attached_contents_; | 437 std::set<WebContents*> attached_contents_; |
| 433 }; | 438 }; |
| 434 | 439 |
| 435 } // namespace content | 440 } // namespace content |
| 436 | 441 |
| 437 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ | 442 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ |
| OLD | NEW |