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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 // Returns whether this tab contents should add the specified navigation to | 266 // Returns whether this tab contents should add the specified navigation to |
267 // history. | 267 // history. |
268 virtual bool ShouldAddNavigationToHistory( | 268 virtual bool ShouldAddNavigationToHistory( |
269 const history::HistoryAddPageArgs& add_page_args, | 269 const history::HistoryAddPageArgs& add_page_args, |
270 NavigationType navigation_type); | 270 NavigationType navigation_type); |
271 | 271 |
272 // Returns the native window framing the view containing the tab contents. | 272 // Returns the native window framing the view containing the tab contents. |
273 virtual gfx::NativeWindow GetFrameNativeWindow(); | 273 virtual gfx::NativeWindow GetFrameNativeWindow(); |
274 | 274 |
275 // Allows delegate to control whether a WebContents will be created. Returns | 275 // Allows delegate to control whether a WebContents will be created. Returns |
276 // true to allow the creation. Default is to allow it. | 276 // true to allow the creation. Default is to allow it. In cases where the |
| 277 // delegate handles the creation/navigation itself, it will use |target_url|. |
277 virtual bool ShouldCreateWebContents( | 278 virtual bool ShouldCreateWebContents( |
278 WebContents* web_contents, | 279 WebContents* web_contents, |
279 int route_id, | 280 int route_id, |
280 WindowContainerType window_container_type, | 281 WindowContainerType window_container_type, |
281 const string16& frame_name); | 282 const string16& frame_name, |
| 283 const GURL& target_url); |
282 | 284 |
283 // Notifies the delegate about the creation of a new WebContents. This | 285 // Notifies the delegate about the creation of a new WebContents. This |
284 // typically happens when popups are created. | 286 // typically happens when popups are created. |
285 virtual void WebContentsCreated(WebContents* source_contents, | 287 virtual void WebContentsCreated(WebContents* source_contents, |
286 int64 source_frame_id, | 288 int64 source_frame_id, |
287 const GURL& target_url, | 289 const GURL& target_url, |
288 WebContents* new_contents) {} | 290 WebContents* new_contents) {} |
289 | 291 |
290 // Notifies the delegate that the content restrictions for this tab has | 292 // Notifies the delegate that the content restrictions for this tab has |
291 // changed. | 293 // changed. |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 // Called when |this| is no longer the WebContentsDelegate for |source|. | 406 // Called when |this| is no longer the WebContentsDelegate for |source|. |
405 void Detach(WebContents* source); | 407 void Detach(WebContents* source); |
406 | 408 |
407 // The WebContents that this is currently a delegate for. | 409 // The WebContents that this is currently a delegate for. |
408 std::set<WebContents*> attached_contents_; | 410 std::set<WebContents*> attached_contents_; |
409 }; | 411 }; |
410 | 412 |
411 } // namespace content | 413 } // namespace content |
412 | 414 |
413 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ | 415 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ |
OLD | NEW |