| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/plugin_service.h" | 5 #include "chrome/browser/plugin_service.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 // service, since we only care about this for extensions. | 401 // service, since we only care about this for extensions. |
| 402 const GURL& required_url = it->second; | 402 const GURL& required_url = it->second; |
| 403 return (url.scheme() == required_url.scheme() && | 403 return (url.scheme() == required_url.scheme() && |
| 404 url.host() == required_url.host()); | 404 url.host() == required_url.host()); |
| 405 } | 405 } |
| 406 | 406 |
| 407 void PluginService::RegisterPepperPlugins() { | 407 void PluginService::RegisterPepperPlugins() { |
| 408 std::vector<PepperPluginInfo> plugins; | 408 std::vector<PepperPluginInfo> plugins; |
| 409 PepperPluginRegistry::GetList(&plugins); | 409 PepperPluginRegistry::GetList(&plugins); |
| 410 for (size_t i = 0; i < plugins.size(); ++i) { | 410 for (size_t i = 0; i < plugins.size(); ++i) { |
| 411 webkit::npapi::PluginVersionInfo info; | 411 webkit::npapi::WebPluginInfo info; |
| 412 info.path = plugins[i].path; | 412 info.path = plugins[i].path; |
| 413 info.product_name = plugins[i].name.empty() ? | 413 info.name = plugins[i].name.empty() ? |
| 414 plugins[i].path.BaseName().ToWStringHack() : | 414 WideToUTF16(plugins[i].path.BaseName().ToWStringHack()) : |
| 415 ASCIIToWide(plugins[i].name); | 415 ASCIIToUTF16(plugins[i].name); |
| 416 info.file_description = ASCIIToWide(plugins[i].description); | 416 info.desc = ASCIIToUTF16(plugins[i].description); |
| 417 info.file_extensions = ASCIIToWide(plugins[i].file_extensions); | 417 info.enabled = true; |
| 418 info.file_description = ASCIIToWide(plugins[i].type_descriptions); | |
| 419 info.mime_types = ASCIIToWide(JoinString(plugins[i].mime_types, '|')); | |
| 420 | 418 |
| 421 // These NPAPI entry points will never be called. TODO(darin): Come up | 419 // TODO(evan): Pepper shouldn't require us to parse strings to get |
| 422 // with a cleaner way to register pepper plugins with the NPAPI PluginList, | 420 // the list of mime types out. |
| 423 // or perhaps refactor the PluginList to be less specific to NPAPI. | 421 if (!webkit::npapi::PluginList::ParseMimeTypes( |
| 424 memset(&info.entry_points, 0, sizeof(info.entry_points)); | 422 JoinString(plugins[i].mime_types, '|'), |
| 423 plugins[i].file_extensions, |
| 424 ASCIIToUTF16(plugins[i].type_descriptions), |
| 425 &info.mime_types)) { |
| 426 LOG(ERROR) << "Error parsing mime types for " |
| 427 << plugins[i].path.ToWStringHack(); |
| 428 return; |
| 429 } |
| 425 | 430 |
| 426 webkit::npapi::PluginList::Singleton()->RegisterInternalPlugin(info); | 431 webkit::npapi::PluginList::Singleton()->RegisterInternalPlugin(info); |
| 427 } | 432 } |
| 428 } | 433 } |
| OLD | NEW |