| 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 #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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 // prior to attachment. | 182 // prior to attachment. |
| 183 GetContentClient()->browser()->GuestWebContentsAttached( | 183 GetContentClient()->browser()->GuestWebContentsAttached( |
| 184 guest->GetWebContents(), | 184 guest->GetWebContents(), |
| 185 GetWebContents(), | 185 GetWebContents(), |
| 186 *extra_params); | 186 *extra_params); |
| 187 guest->Attach(GetWebContents(), params, *extra_params); | 187 guest->Attach(GetWebContents(), params, *extra_params); |
| 188 return; | 188 return; |
| 189 } | 189 } |
| 190 | 190 |
| 191 scoped_ptr<base::DictionaryValue> copy_extra_params(extra_params->DeepCopy()); | 191 scoped_ptr<base::DictionaryValue> copy_extra_params(extra_params->DeepCopy()); |
| 192 guest = guest_manager->CreateGuest( | 192 guest = guest_manager->CreateGuest(GetWebContents()->GetSiteInstance(), |
| 193 GetWebContents()->GetSiteInstance(), | 193 instance_id, |
| 194 instance_id, params, | 194 params.storage_partition_id, |
| 195 copy_extra_params.Pass()); | 195 params.persist_storage, |
| 196 copy_extra_params.Pass()); |
| 196 if (guest) { | 197 if (guest) { |
| 197 GetContentClient()->browser()->GuestWebContentsAttached( | 198 GetContentClient()->browser()->GuestWebContentsAttached( |
| 198 guest->GetWebContents(), | 199 guest->GetWebContents(), |
| 199 GetWebContents(), | 200 GetWebContents(), |
| 200 *extra_params); | 201 *extra_params); |
| 201 guest->Initialize(params, GetWebContents()); | 202 guest->Initialize(params, GetWebContents()); |
| 202 } | 203 } |
| 203 } | 204 } |
| 204 | 205 |
| 205 void BrowserPluginEmbedder::OnAttach( | 206 void BrowserPluginEmbedder::OnAttach( |
| 206 int instance_id, | 207 int instance_id, |
| 207 const BrowserPluginHostMsg_Attach_Params& params, | 208 const BrowserPluginHostMsg_Attach_Params& params, |
| 208 const base::DictionaryValue& extra_params) { | 209 const base::DictionaryValue& extra_params) { |
| 209 GetBrowserPluginGuestManager()->MaybeGetGuestByInstanceIDOrKill( | 210 GetBrowserPluginGuestManager()->MaybeGetGuestByInstanceIDOrKill( |
| 210 instance_id, GetWebContents()->GetRenderProcessHost()->GetID(), | 211 instance_id, GetWebContents()->GetRenderProcessHost()->GetID(), |
| 211 base::Bind(&BrowserPluginEmbedder::OnGuestCallback, | 212 base::Bind(&BrowserPluginEmbedder::OnGuestCallback, |
| 212 base::Unretained(this), | 213 base::Unretained(this), |
| 213 instance_id, | 214 instance_id, |
| 214 params, | 215 params, |
| 215 &extra_params)); | 216 &extra_params)); |
| 216 } | 217 } |
| 217 | 218 |
| 218 } // namespace content | 219 } // namespace content |
| OLD | NEW |