Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: content/public/browser/web_contents.h

Issue 20924002: Try to restore window.opener when opening blocked popups (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 gfx::NativeView context; 91 gfx::NativeView context;
92 }; 92 };
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). If |opener| is non-NULL, the created
102 // WebContents will have its opener set to |opener|.
102 // 103 //
103 // You do not want to call this. If you think you do, make sure you completely 104 // You do not want to call this. If you think you do, make sure you completely
104 // understand when SessionStorageNamespace objects should be cloned, why 105 // understand when SessionStorageNamespace objects should be cloned, why
105 // they should not be shared by multiple WebContents, and what bad things 106 // they should not be shared by multiple WebContents, and what bad things
106 // can happen if you share the object. 107 // can happen if you share the object.
107 CONTENT_EXPORT static WebContents* CreateWithSessionStorage( 108 CONTENT_EXPORT static WebContents* CreateWithSessionStorage(
108 const CreateParams& params, 109 const CreateParams& params,
109 const SessionStorageNamespaceMap& session_storage_namespace_map); 110 const SessionStorageNamespaceMap& session_storage_namespace_map,
111 WebContents* opener);
110 112
111 // Adds/removes a callback called on creation of each new WebContents. 113 // Adds/removes a callback called on creation of each new WebContents.
112 typedef base::Callback<void(WebContents*)> CreatedCallback; 114 typedef base::Callback<void(WebContents*)> CreatedCallback;
113 CONTENT_EXPORT static void AddCreatedCallback( 115 CONTENT_EXPORT static void AddCreatedCallback(
114 const CreatedCallback& callback); 116 const CreatedCallback& callback);
115 CONTENT_EXPORT static void RemoveCreatedCallback( 117 CONTENT_EXPORT static void RemoveCreatedCallback(
116 const CreatedCallback& callback); 118 const CreatedCallback& callback);
117 119
118 // Returns a WebContents that wraps the RenderViewHost, or NULL if the 120 // Returns a WebContents that wraps the RenderViewHost, or NULL if the
119 // render view host's delegate isn't a WebContents. 121 // render view host's delegate isn't a WebContents.
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 454
453 private: 455 private:
454 // This interface should only be implemented inside content. 456 // This interface should only be implemented inside content.
455 friend class WebContentsImpl; 457 friend class WebContentsImpl;
456 WebContents() {} 458 WebContents() {}
457 }; 459 };
458 460
459 } // namespace content 461 } // namespace content
460 462
461 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ 463 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698