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 1316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1327 return &service_registry_; | 1327 return &service_registry_; |
1328 } | 1328 } |
1329 | 1329 |
1330 // blink::WebFrameClient implementation ---------------------------------------- | 1330 // blink::WebFrameClient implementation ---------------------------------------- |
1331 | 1331 |
1332 blink::WebPlugin* RenderFrameImpl::createPlugin( | 1332 blink::WebPlugin* RenderFrameImpl::createPlugin( |
1333 blink::WebLocalFrame* frame, | 1333 blink::WebLocalFrame* frame, |
1334 const blink::WebPluginParams& params) { | 1334 const blink::WebPluginParams& params) { |
1335 DCHECK_EQ(frame_, frame); | 1335 DCHECK_EQ(frame_, frame); |
1336 blink::WebPlugin* plugin = NULL; | 1336 blink::WebPlugin* plugin = NULL; |
| 1337 int instance_id; |
1337 if (GetContentClient()->renderer()->OverrideCreatePlugin( | 1338 if (GetContentClient()->renderer()->OverrideCreatePlugin( |
1338 this, frame, params, &plugin)) { | 1339 this, frame, params, &instance_id, &plugin)) { |
1339 return plugin; | 1340 return plugin; |
1340 } | 1341 } |
1341 | 1342 |
1342 if (base::UTF16ToUTF8(params.mimeType) == kBrowserPluginMimeType) { | 1343 if (base::UTF16ToUTF8(params.mimeType) == kBrowserPluginMimeType) { |
1343 return render_view_->GetBrowserPluginManager()->CreateBrowserPlugin( | 1344 return render_view_->GetBrowserPluginManager()->CreateBrowserPlugin( |
1344 render_view_.get(), frame, false); | 1345 render_view_.get(), frame, false); |
1345 } | 1346 } |
1346 | 1347 |
1347 #if defined(ENABLE_PLUGINS) | 1348 #if defined(ENABLE_PLUGINS) |
1348 WebPluginInfo info; | 1349 WebPluginInfo info; |
1349 std::string mime_type; | 1350 std::string mime_type; |
1350 bool found = false; | 1351 bool found = false; |
1351 Send(new FrameHostMsg_GetPluginInfo( | 1352 Send(new FrameHostMsg_GetPluginInfo( |
1352 routing_id_, params.url, frame->top()->document().url(), | 1353 routing_id_, params.url, frame->top()->document().url(), |
1353 params.mimeType.utf8(), &found, &info, &mime_type)); | 1354 params.mimeType.utf8(), &found, &info, &mime_type)); |
1354 if (!found) | 1355 if (!found) |
1355 return NULL; | 1356 return NULL; |
1356 | 1357 |
1357 if (info.type == content::WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN) { | 1358 if (info.type == content::WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN) { |
1358 return render_view_->GetBrowserPluginManager()->CreateBrowserPlugin( | 1359 //printf("Creating auto_navigate_ stuff\n"); |
| 1360 BrowserPlugin* p = render_view_->GetBrowserPluginManager()->CreateBrowserPlu
gin( |
1359 render_view_.get(), frame, true); | 1361 render_view_.get(), frame, true); |
| 1362 p->AttachToPlugin(instance_id); |
| 1363 return p; |
1360 } | 1364 } |
1361 | 1365 |
1362 | 1366 |
1363 WebPluginParams params_to_use = params; | 1367 WebPluginParams params_to_use = params; |
1364 params_to_use.mimeType = WebString::fromUTF8(mime_type); | 1368 params_to_use.mimeType = WebString::fromUTF8(mime_type); |
1365 return CreatePlugin(frame, info, params_to_use); | 1369 return CreatePlugin(frame, info, params_to_use); |
1366 #else | 1370 #else |
1367 return NULL; | 1371 return NULL; |
1368 #endif // defined(ENABLE_PLUGINS) | 1372 #endif // defined(ENABLE_PLUGINS) |
1369 } | 1373 } |
(...skipping 2201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3571 | 3575 |
3572 #if defined(ENABLE_BROWSER_CDMS) | 3576 #if defined(ENABLE_BROWSER_CDMS) |
3573 RendererCdmManager* RenderFrameImpl::GetCdmManager() { | 3577 RendererCdmManager* RenderFrameImpl::GetCdmManager() { |
3574 if (!cdm_manager_) | 3578 if (!cdm_manager_) |
3575 cdm_manager_ = new RendererCdmManager(this); | 3579 cdm_manager_ = new RendererCdmManager(this); |
3576 return cdm_manager_; | 3580 return cdm_manager_; |
3577 } | 3581 } |
3578 #endif // defined(ENABLE_BROWSER_CDMS) | 3582 #endif // defined(ENABLE_BROWSER_CDMS) |
3579 | 3583 |
3580 } // namespace content | 3584 } // namespace content |
OLD | NEW |