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

Side by Side Diff: content/browser/browser_plugin/browser_plugin_embedder.cc

Issue 336283002: Remove GuestWebContentsCreated (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@simplify_creation
Patch Set: Addressed comments Created 6 years, 6 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
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 #include "content/browser/browser_plugin/browser_plugin_embedder.h" 5 #include "content/browser/browser_plugin/browser_plugin_embedder.h"
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "content/browser/browser_plugin/browser_plugin_guest.h" 8 #include "content/browser/browser_plugin/browser_plugin_guest.h"
9 #include "content/browser/renderer_host/render_view_host_impl.h" 9 #include "content/browser/renderer_host/render_view_host_impl.h"
10 #include "content/browser/web_contents/web_contents_impl.h" 10 #include "content/browser/web_contents/web_contents_impl.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 } 116 }
117 117
118 void BrowserPluginEmbedder::OnGuestCallback( 118 void BrowserPluginEmbedder::OnGuestCallback(
119 int instance_id, 119 int instance_id,
120 const BrowserPluginHostMsg_Attach_Params& params, 120 const BrowserPluginHostMsg_Attach_Params& params,
121 const base::DictionaryValue* extra_params, 121 const base::DictionaryValue* extra_params,
122 WebContents* guest_web_contents) { 122 WebContents* guest_web_contents) {
123 BrowserPluginGuest* guest = guest_web_contents ? 123 BrowserPluginGuest* guest = guest_web_contents ?
124 static_cast<WebContentsImpl*>(guest_web_contents)-> 124 static_cast<WebContentsImpl*>(guest_web_contents)->
125 GetBrowserPluginGuest() : NULL; 125 GetBrowserPluginGuest() : NULL;
126 if (!guest) {
127 scoped_ptr<base::DictionaryValue> copy_extra_params(
128 extra_params->DeepCopy());
129 guest_web_contents = GetBrowserPluginGuestManager()->CreateGuest(
130 GetWebContents()->GetSiteInstance(),
131 instance_id,
132 copy_extra_params.Pass());
133 guest = guest_web_contents
134 ? static_cast<WebContentsImpl*>(guest_web_contents)
135 ->GetBrowserPluginGuest()
136 : NULL;
137 }
138
139 if (guest) 126 if (guest)
140 guest->Attach(GetWebContents(), params, *extra_params); 127 guest->Attach(GetWebContents(), params, *extra_params);
141 } 128 }
142 129
143 void BrowserPluginEmbedder::OnAttach( 130 void BrowserPluginEmbedder::OnAttach(
144 int instance_id, 131 int instance_id,
145 const BrowserPluginHostMsg_Attach_Params& params, 132 const BrowserPluginHostMsg_Attach_Params& params,
146 const base::DictionaryValue& extra_params) { 133 const base::DictionaryValue& extra_params) {
147 GetBrowserPluginGuestManager()->MaybeGetGuestByInstanceIDOrKill( 134 GetBrowserPluginGuestManager()->MaybeGetGuestByInstanceIDOrKill(
148 instance_id, GetWebContents()->GetRenderProcessHost()->GetID(), 135 instance_id, GetWebContents()->GetRenderProcessHost()->GetID(),
149 base::Bind(&BrowserPluginEmbedder::OnGuestCallback, 136 base::Bind(&BrowserPluginEmbedder::OnGuestCallback,
150 base::Unretained(this), 137 base::Unretained(this),
151 instance_id, 138 instance_id,
152 params, 139 params,
153 &extra_params)); 140 &extra_params));
154 } 141 }
155 142
156 } // namespace content 143 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698