| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "config.h" | 5 #include "config.h" |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 | 10 |
| (...skipping 1429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1440 for (unsigned int i = 0; i < param_names.size(); i++) { | 1440 for (unsigned int i = 0; i < param_names.size(); i++) { |
| 1441 String lowercase_param_name = param_names[i].lower(); | 1441 String lowercase_param_name = param_names[i].lower(); |
| 1442 if (lowercase_param_name == "classid") { | 1442 if (lowercase_param_name == "classid") { |
| 1443 activex_shim::GetClsidFromClassidAttribute( | 1443 activex_shim::GetClsidFromClassidAttribute( |
| 1444 webkit_glue::CStringToStdString(param_values[i].latin1()), &clsid); | 1444 webkit_glue::CStringToStdString(param_values[i].latin1()), &clsid); |
| 1445 } else if (lowercase_param_name == "codebase") { | 1445 } else if (lowercase_param_name == "codebase") { |
| 1446 version = activex_shim::GetVersionFromCodebaseAttribute( | 1446 version = activex_shim::GetVersionFromCodebaseAttribute( |
| 1447 webkit_glue::CStringToStdString(param_values[i].latin1())); | 1447 webkit_glue::CStringToStdString(param_values[i].latin1())); |
| 1448 } | 1448 } |
| 1449 } | 1449 } |
| 1450 // We only allowed specific ActiveX controls to run from certain websites. | 1450 |
| 1451 if (!activex_shim::IsActiveXAllowed(clsid, url)) | 1451 // Attempt to map this clsid to a known NPAPI mime type if possible, failing |
| 1452 return NULL; | 1452 // which we attempt to load the activex shim for the clsid. |
| 1453 // We need to pass the combined clsid + version to PluginsList, so that it | 1453 if (!activex_shim::GetMimeTypeForClsid(clsid, &my_mime_type)) { |
| 1454 // would detect if the requested version is installed. If not, it needs | 1454 // We only allowed specific ActiveX controls to run from certain websites. |
| 1455 // to use the default plugin to update the control. | 1455 if (!activex_shim::IsActiveXAllowed(clsid, url)) |
| 1456 if (!version.empty()) | 1456 return NULL; |
| 1457 combined_clsid = clsid + "#" + version; | 1457 // We need to pass the combined clsid + version to PluginsList, so that it |
| 1458 else | 1458 // would detect if the requested version is installed. If not, it needs |
| 1459 combined_clsid = clsid; | 1459 // to use the default plugin to update the control. |
| 1460 if (!version.empty()) |
| 1461 combined_clsid = clsid + "#" + version; |
| 1462 else |
| 1463 combined_clsid = clsid; |
| 1464 } |
| 1460 } | 1465 } |
| 1461 #endif | 1466 #endif |
| 1462 | 1467 |
| 1463 std::string actual_mime_type; | 1468 std::string actual_mime_type; |
| 1464 WebPluginDelegate* plugin_delegate = | 1469 WebPluginDelegate* plugin_delegate = |
| 1465 d->CreatePluginDelegate(webframe_->webview_impl(), gurl, my_mime_type, | 1470 d->CreatePluginDelegate(webframe_->webview_impl(), gurl, my_mime_type, |
| 1466 combined_clsid, &actual_mime_type); | 1471 combined_clsid, &actual_mime_type); |
| 1467 if (!plugin_delegate) | 1472 if (!plugin_delegate) |
| 1468 return NULL; | 1473 return NULL; |
| 1469 | 1474 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1602 if (!web_view) { | 1607 if (!web_view) { |
| 1603 return NULL; | 1608 return NULL; |
| 1604 } | 1609 } |
| 1605 WebDevToolsAgentImpl* tools_agent = web_view->GetWebDevToolsAgentImpl(); | 1610 WebDevToolsAgentImpl* tools_agent = web_view->GetWebDevToolsAgentImpl(); |
| 1606 if (tools_agent) { | 1611 if (tools_agent) { |
| 1607 return tools_agent->net_agent_impl(); | 1612 return tools_agent->net_agent_impl(); |
| 1608 } else { | 1613 } else { |
| 1609 return NULL; | 1614 return NULL; |
| 1610 } | 1615 } |
| 1611 } | 1616 } |
| OLD | NEW |