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_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ | 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 93 | 93 |
| 94 // Creates a new WebContents. | 94 // Creates a new WebContents. |
| 95 CONTENT_EXPORT static WebContents* Create(const CreateParams& params); | 95 CONTENT_EXPORT static WebContents* Create(const CreateParams& params); |
| 96 | 96 |
| 97 // Similar to Create() above but should be used when you need to prepopulate | 97 // Similar to Create() above but should be used when you need to prepopulate |
| 98 // the SessionStorageNamespaceMap of the WebContents. This can happen if | 98 // the SessionStorageNamespaceMap of the WebContents. This can happen if |
| 99 // you duplicate a WebContents, try to reconstitute it from a saved state, | 99 // you duplicate a WebContents, try to reconstitute it from a saved state, |
| 100 // or when you create a new WebContents based on another one (eg., when | 100 // or when you create a new WebContents based on another one (eg., when |
| 101 // servicing a window.open() call). | 101 // servicing a window.open() call). |
| 102 // | 102 // |
| 103 // You do not want to call this. If you think you do, make sure you completely | 103 // You do not want to call this. If you think you do, make sure you completely |
|
Charlie Reis
2013/07/30 01:26:30
Albert's the one to confirm with if we end up call
| |
| 104 // understand when SessionStorageNamespace objects should be cloned, why | 104 // understand when SessionStorageNamespace objects should be cloned, why |
| 105 // they should not be shared by multiple WebContents, and what bad things | 105 // they should not be shared by multiple WebContents, and what bad things |
| 106 // can happen if you share the object. | 106 // can happen if you share the object. |
| 107 CONTENT_EXPORT static WebContents* CreateWithSessionStorage( | 107 CONTENT_EXPORT static WebContents* CreateWithSessionStorage( |
| 108 const CreateParams& params, | 108 const CreateParams& params, |
| 109 const SessionStorageNamespaceMap& session_storage_namespace_map); | 109 const SessionStorageNamespaceMap& session_storage_namespace_map); |
| 110 | 110 |
| 111 // Similar to Create() above but clones the session storage namespace from | |
| 112 // |opener| if it is non-NULL. If |propage_opener| is true, |opener| is also | |
|
Charlie Reis
2013/07/30 01:26:30
nit: typo in propagate_opener
| |
| 113 // set as the opener of the returned WebContents. | |
| 114 // | |
| 115 // This call should be used e.g. to create a popup window. | |
| 116 CONTENT_EXPORT static WebContents* CreateWithOpener( | |
| 117 const CreateParams& params, WebContents* opener, bool propagate_opener); | |
| 118 | |
| 111 // Adds/removes a callback called on creation of each new WebContents. | 119 // Adds/removes a callback called on creation of each new WebContents. |
| 112 typedef base::Callback<void(WebContents*)> CreatedCallback; | 120 typedef base::Callback<void(WebContents*)> CreatedCallback; |
| 113 CONTENT_EXPORT static void AddCreatedCallback( | 121 CONTENT_EXPORT static void AddCreatedCallback( |
| 114 const CreatedCallback& callback); | 122 const CreatedCallback& callback); |
| 115 CONTENT_EXPORT static void RemoveCreatedCallback( | 123 CONTENT_EXPORT static void RemoveCreatedCallback( |
| 116 const CreatedCallback& callback); | 124 const CreatedCallback& callback); |
| 117 | 125 |
| 118 // Returns a WebContents that wraps the RenderViewHost, or NULL if the | 126 // Returns a WebContents that wraps the RenderViewHost, or NULL if the |
| 119 // render view host's delegate isn't a WebContents. | 127 // render view host's delegate isn't a WebContents. |
| 120 CONTENT_EXPORT static WebContents* FromRenderViewHost( | 128 CONTENT_EXPORT static WebContents* FromRenderViewHost( |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 452 | 460 |
| 453 private: | 461 private: |
| 454 // This interface should only be implemented inside content. | 462 // This interface should only be implemented inside content. |
| 455 friend class WebContentsImpl; | 463 friend class WebContentsImpl; |
| 456 WebContents() {} | 464 WebContents() {} |
| 457 }; | 465 }; |
| 458 | 466 |
| 459 } // namespace content | 467 } // namespace content |
| 460 | 468 |
| 461 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ | 469 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ |
| OLD | NEW |