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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 261013005: BrowserPlugin: Move CreateGuest to chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@guestview_manager_simplify_api
Patch Set: Fixed content_browsertests after a change Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 0f3ea7ac1356c034e74a790b789de07e2a5043d5..cf8730c610e7a4d183c543189d0f2957cf340e6f 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -431,33 +431,23 @@ WebContentsImpl* WebContentsImpl::CreateWithOpener(
WebContentsImpl* new_contents = new WebContentsImpl(
params.browser_context, opener);
+ if (params.guest_instance_id) {
+ scoped_ptr<base::DictionaryValue> extra_params(
+ params.guest_extra_params->DeepCopy());
+ // This makes |new_contents| act as a guest.
+ // For more info, see comment above class BrowserPluginGuest.
+ BrowserPluginGuest::Create(params.guest_instance_id,
+ params.site_instance,
+ new_contents,
+ extra_params.Pass());
+ // We are instantiating a WebContents for browser plugin. Set its subframe
+ // bit to true.
+ new_contents->is_subframe_ = true;
+ }
new_contents->Init(params);
return new_contents;
}
-// static
-BrowserPluginGuest* WebContentsImpl::CreateGuest(
- BrowserContext* browser_context,
- SiteInstance* site_instance,
- int guest_instance_id,
- scoped_ptr<base::DictionaryValue> extra_params) {
- WebContentsImpl* new_contents = new WebContentsImpl(browser_context, NULL);
-
- // This makes |new_contents| act as a guest.
- // For more info, see comment above class BrowserPluginGuest.
- BrowserPluginGuest::Create(
- guest_instance_id, site_instance, new_contents, extra_params.Pass());
-
- WebContents::CreateParams create_params(browser_context, site_instance);
- new_contents->Init(create_params);
-
- // We are instantiating a WebContents for browser plugin. Set its subframe bit
- // to true.
- new_contents->is_subframe_ = true;
-
- return new_contents->browser_plugin_guest_.get();
-}
-
RenderFrameHostManager* WebContentsImpl::GetRenderManagerForTesting() {
return GetRenderManager();
}
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/public/browser/browser_plugin_guest_manager_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698