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

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

Issue 261013005: BrowserPlugin: Move CreateGuest to chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@guestview_manager_simplify_api
Patch Set: Removed AddGuest/RemoveGuest from content API! w00t! 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 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/browser_plugin/browser_plugin_guest_manager.h" 9 #include "content/browser/browser_plugin/browser_plugin_guest_manager.h"
10 #include "content/browser/browser_plugin/browser_plugin_host_factory.h" 10 #include "content/browser/browser_plugin/browser_plugin_host_factory.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 // prior to attachment. 180 // prior to attachment.
181 GetContentClient()->browser()->GuestWebContentsAttached( 181 GetContentClient()->browser()->GuestWebContentsAttached(
182 guest->GetWebContents(), 182 guest->GetWebContents(),
183 GetWebContents(), 183 GetWebContents(),
184 *extra_params); 184 *extra_params);
185 guest->Attach(GetWebContents(), params, *extra_params); 185 guest->Attach(GetWebContents(), params, *extra_params);
186 return; 186 return;
187 } 187 }
188 188
189 scoped_ptr<base::DictionaryValue> copy_extra_params(extra_params->DeepCopy()); 189 scoped_ptr<base::DictionaryValue> copy_extra_params(extra_params->DeepCopy());
190 StorageInfo storage_info;
191 storage_info.partition_id = params.storage_partition_id;
192 storage_info.persist = params.persist_storage;
190 guest = guest_manager->CreateGuest( 193 guest = guest_manager->CreateGuest(
191 GetWebContents()->GetSiteInstance(), 194 GetWebContents()->GetSiteInstance(),
192 instance_id, params, 195 instance_id, storage_info,
193 copy_extra_params.Pass()); 196 copy_extra_params.Pass());
194 if (guest) { 197 if (guest) {
195 GetContentClient()->browser()->GuestWebContentsAttached( 198 GetContentClient()->browser()->GuestWebContentsAttached(
196 guest->GetWebContents(), 199 guest->GetWebContents(),
197 GetWebContents(), 200 GetWebContents(),
198 *extra_params); 201 *extra_params);
199 guest->Initialize(params, GetWebContents()); 202 guest->Initialize(params, GetWebContents());
200 } 203 }
201 } 204 }
202 205
203 void BrowserPluginEmbedder::OnAttach( 206 void BrowserPluginEmbedder::OnAttach(
204 int instance_id, 207 int instance_id,
205 const BrowserPluginHostMsg_Attach_Params& params, 208 const BrowserPluginHostMsg_Attach_Params& params,
206 const base::DictionaryValue& extra_params) { 209 const base::DictionaryValue& extra_params) {
207 GetBrowserPluginGuestManager()->MaybeGetGuestByInstanceIDOrKill( 210 GetBrowserPluginGuestManager()->MaybeGetGuestByInstanceIDOrKill(
208 instance_id, GetWebContents()->GetRenderProcessHost()->GetID(), 211 instance_id, GetWebContents()->GetRenderProcessHost()->GetID(),
209 base::Bind(&BrowserPluginEmbedder::GuestCallback, 212 base::Bind(&BrowserPluginEmbedder::GuestCallback,
210 base::Unretained(this), 213 base::Unretained(this),
211 instance_id, 214 instance_id,
212 params, 215 params,
213 &extra_params)); 216 &extra_params));
214 } 217 }
215 218
216 } // namespace content 219 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698