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 1357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1368 return &service_registry_; | 1368 return &service_registry_; |
1369 } | 1369 } |
1370 | 1370 |
1371 // blink::WebFrameClient implementation ---------------------------------------- | 1371 // blink::WebFrameClient implementation ---------------------------------------- |
1372 | 1372 |
1373 blink::WebPlugin* RenderFrameImpl::createPlugin( | 1373 blink::WebPlugin* RenderFrameImpl::createPlugin( |
1374 blink::WebLocalFrame* frame, | 1374 blink::WebLocalFrame* frame, |
1375 const blink::WebPluginParams& params) { | 1375 const blink::WebPluginParams& params) { |
1376 DCHECK_EQ(frame_, frame); | 1376 DCHECK_EQ(frame_, frame); |
1377 blink::WebPlugin* plugin = NULL; | 1377 blink::WebPlugin* plugin = NULL; |
| 1378 int instance_id; |
1378 if (GetContentClient()->renderer()->OverrideCreatePlugin( | 1379 if (GetContentClient()->renderer()->OverrideCreatePlugin( |
1379 this, frame, params, &plugin)) { | 1380 this, frame, params, &instance_id, &plugin)) { |
1380 return plugin; | 1381 return plugin; |
1381 } | 1382 } |
1382 | 1383 |
1383 if (base::UTF16ToUTF8(params.mimeType) == kBrowserPluginMimeType) { | 1384 if (base::UTF16ToUTF8(params.mimeType) == kBrowserPluginMimeType) { |
1384 return render_view_->GetBrowserPluginManager()->CreateBrowserPlugin( | 1385 return render_view_->GetBrowserPluginManager()->CreateBrowserPlugin( |
1385 render_view_.get(), frame, false); | 1386 render_view_.get(), frame, false); |
1386 } | 1387 } |
1387 | 1388 |
1388 #if defined(ENABLE_PLUGINS) | 1389 #if defined(ENABLE_PLUGINS) |
1389 WebPluginInfo info; | 1390 WebPluginInfo info; |
1390 std::string mime_type; | 1391 std::string mime_type; |
1391 bool found = false; | 1392 bool found = false; |
1392 Send(new FrameHostMsg_GetPluginInfo( | 1393 Send(new FrameHostMsg_GetPluginInfo( |
1393 routing_id_, params.url, frame->top()->document().url(), | 1394 routing_id_, params.url, frame->top()->document().url(), |
1394 params.mimeType.utf8(), &found, &info, &mime_type)); | 1395 params.mimeType.utf8(), &found, &info, &mime_type)); |
1395 if (!found) | 1396 if (!found) |
1396 return NULL; | 1397 return NULL; |
1397 | 1398 |
1398 if (info.type == content::WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN) { | 1399 if (info.type == content::WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN) { |
1399 return render_view_->GetBrowserPluginManager()->CreateBrowserPlugin( | 1400 BrowserPlugin* plugin = |
1400 render_view_.get(), frame, true); | 1401 render_view_->GetBrowserPluginManager()->CreateBrowserPlugin( |
| 1402 render_view_.get(), frame, true); |
| 1403 plugin->AttachToPlugin(instance_id); |
| 1404 return plugin; |
1401 } | 1405 } |
1402 | 1406 |
1403 | 1407 |
1404 WebPluginParams params_to_use = params; | 1408 WebPluginParams params_to_use = params; |
1405 params_to_use.mimeType = WebString::fromUTF8(mime_type); | 1409 params_to_use.mimeType = WebString::fromUTF8(mime_type); |
1406 return CreatePlugin(frame, info, params_to_use); | 1410 return CreatePlugin(frame, info, params_to_use); |
1407 #else | 1411 #else |
1408 return NULL; | 1412 return NULL; |
1409 #endif // defined(ENABLE_PLUGINS) | 1413 #endif // defined(ENABLE_PLUGINS) |
1410 } | 1414 } |
(...skipping 2193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3604 | 3608 |
3605 #if defined(ENABLE_BROWSER_CDMS) | 3609 #if defined(ENABLE_BROWSER_CDMS) |
3606 RendererCdmManager* RenderFrameImpl::GetCdmManager() { | 3610 RendererCdmManager* RenderFrameImpl::GetCdmManager() { |
3607 if (!cdm_manager_) | 3611 if (!cdm_manager_) |
3608 cdm_manager_ = new RendererCdmManager(this); | 3612 cdm_manager_ = new RendererCdmManager(this); |
3609 return cdm_manager_; | 3613 return cdm_manager_; |
3610 } | 3614 } |
3611 #endif // defined(ENABLE_BROWSER_CDMS) | 3615 #endif // defined(ENABLE_BROWSER_CDMS) |
3612 | 3616 |
3613 } // namespace content | 3617 } // namespace content |
OLD | NEW |