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 StorageInfo storage_info; |
| 193 storage_info.partition_id = params.storage_partition_id; |
| 194 storage_info.persist = params.persist_storage; |
192 guest = guest_manager->CreateGuest( | 195 guest = guest_manager->CreateGuest( |
193 GetWebContents()->GetSiteInstance(), | 196 GetWebContents()->GetSiteInstance(), |
194 instance_id, params, | 197 instance_id, storage_info, |
195 copy_extra_params.Pass()); | 198 copy_extra_params.Pass()); |
196 if (guest) { | 199 if (guest) { |
197 GetContentClient()->browser()->GuestWebContentsAttached( | 200 GetContentClient()->browser()->GuestWebContentsAttached( |
198 guest->GetWebContents(), | 201 guest->GetWebContents(), |
199 GetWebContents(), | 202 GetWebContents(), |
200 *extra_params); | 203 *extra_params); |
201 guest->Initialize(params, GetWebContents()); | 204 guest->Initialize(params, GetWebContents()); |
202 } | 205 } |
203 } | 206 } |
204 | 207 |
205 void BrowserPluginEmbedder::OnAttach( | 208 void BrowserPluginEmbedder::OnAttach( |
206 int instance_id, | 209 int instance_id, |
207 const BrowserPluginHostMsg_Attach_Params& params, | 210 const BrowserPluginHostMsg_Attach_Params& params, |
208 const base::DictionaryValue& extra_params) { | 211 const base::DictionaryValue& extra_params) { |
209 GetBrowserPluginGuestManager()->MaybeGetGuestByInstanceIDOrKill( | 212 GetBrowserPluginGuestManager()->MaybeGetGuestByInstanceIDOrKill( |
210 instance_id, GetWebContents()->GetRenderProcessHost()->GetID(), | 213 instance_id, GetWebContents()->GetRenderProcessHost()->GetID(), |
211 base::Bind(&BrowserPluginEmbedder::OnGuestCallback, | 214 base::Bind(&BrowserPluginEmbedder::OnGuestCallback, |
212 base::Unretained(this), | 215 base::Unretained(this), |
213 instance_id, | 216 instance_id, |
214 params, | 217 params, |
215 &extra_params)); | 218 &extra_params)); |
216 } | 219 } |
217 | 220 |
218 } // namespace content | 221 } // namespace content |
OLD | NEW |