OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 1320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1331 return &service_registry_; | 1331 return &service_registry_; |
1332 } | 1332 } |
1333 | 1333 |
1334 // blink::WebFrameClient implementation ---------------------------------------- | 1334 // blink::WebFrameClient implementation ---------------------------------------- |
1335 | 1335 |
1336 blink::WebPlugin* RenderFrameImpl::createPlugin( | 1336 blink::WebPlugin* RenderFrameImpl::createPlugin( |
1337 blink::WebLocalFrame* frame, | 1337 blink::WebLocalFrame* frame, |
1338 const blink::WebPluginParams& params) { | 1338 const blink::WebPluginParams& params) { |
1339 DCHECK_EQ(frame_, frame); | 1339 DCHECK_EQ(frame_, frame); |
1340 blink::WebPlugin* plugin = NULL; | 1340 blink::WebPlugin* plugin = NULL; |
| 1341 int instance_id; |
1341 if (GetContentClient()->renderer()->OverrideCreatePlugin( | 1342 if (GetContentClient()->renderer()->OverrideCreatePlugin( |
1342 this, frame, params, &plugin)) { | 1343 this, frame, params, &instance_id, &plugin)) { |
1343 return plugin; | 1344 return plugin; |
1344 } | 1345 } |
1345 | 1346 |
1346 if (base::UTF16ToUTF8(params.mimeType) == kBrowserPluginMimeType) { | 1347 if (base::UTF16ToUTF8(params.mimeType) == kBrowserPluginMimeType) { |
1347 return render_view_->GetBrowserPluginManager()->CreateBrowserPlugin( | 1348 return render_view_->GetBrowserPluginManager()->CreateBrowserPlugin( |
1348 render_view_.get(), frame, false); | 1349 render_view_.get(), frame, false); |
1349 } | 1350 } |
1350 | 1351 |
1351 #if defined(ENABLE_PLUGINS) | 1352 #if defined(ENABLE_PLUGINS) |
1352 WebPluginInfo info; | 1353 WebPluginInfo info; |
1353 std::string mime_type; | 1354 std::string mime_type; |
1354 bool found = false; | 1355 bool found = false; |
1355 Send(new FrameHostMsg_GetPluginInfo( | 1356 Send(new FrameHostMsg_GetPluginInfo( |
1356 routing_id_, params.url, frame->top()->document().url(), | 1357 routing_id_, params.url, frame->top()->document().url(), |
1357 params.mimeType.utf8(), &found, &info, &mime_type)); | 1358 params.mimeType.utf8(), &found, &info, &mime_type)); |
1358 if (!found) | 1359 if (!found) |
1359 return NULL; | 1360 return NULL; |
1360 | 1361 |
1361 if (info.type == content::WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN) { | 1362 if (info.type == content::WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN) { |
1362 return render_view_->GetBrowserPluginManager()->CreateBrowserPlugin( | 1363 BrowserPlugin* plugin = |
1363 render_view_.get(), frame, true); | 1364 render_view_->GetBrowserPluginManager()->CreateBrowserPlugin( |
| 1365 render_view_.get(), frame, true); |
| 1366 plugin->AttachToPlugin(instance_id); |
| 1367 return plugin; |
1364 } | 1368 } |
1365 | 1369 |
1366 | 1370 |
1367 WebPluginParams params_to_use = params; | 1371 WebPluginParams params_to_use = params; |
1368 params_to_use.mimeType = WebString::fromUTF8(mime_type); | 1372 params_to_use.mimeType = WebString::fromUTF8(mime_type); |
1369 return CreatePlugin(frame, info, params_to_use); | 1373 return CreatePlugin(frame, info, params_to_use); |
1370 #else | 1374 #else |
1371 return NULL; | 1375 return NULL; |
1372 #endif // defined(ENABLE_PLUGINS) | 1376 #endif // defined(ENABLE_PLUGINS) |
1373 } | 1377 } |
(...skipping 2204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3578 | 3582 |
3579 #if defined(ENABLE_BROWSER_CDMS) | 3583 #if defined(ENABLE_BROWSER_CDMS) |
3580 RendererCdmManager* RenderFrameImpl::GetCdmManager() { | 3584 RendererCdmManager* RenderFrameImpl::GetCdmManager() { |
3581 if (!cdm_manager_) | 3585 if (!cdm_manager_) |
3582 cdm_manager_ = new RendererCdmManager(this); | 3586 cdm_manager_ = new RendererCdmManager(this); |
3583 return cdm_manager_; | 3587 return cdm_manager_; |
3584 } | 3588 } |
3585 #endif // defined(ENABLE_BROWSER_CDMS) | 3589 #endif // defined(ENABLE_BROWSER_CDMS) |
3586 | 3590 |
3587 } // namespace content | 3591 } // namespace content |
OLD | NEW |