Chromium Code Reviews| Index: chrome/browser/extensions/plugin_manager.cc |
| diff --git a/chrome/browser/extensions/plugin_manager.cc b/chrome/browser/extensions/plugin_manager.cc |
| index 3676bdb78bcf6a53cf739b4de2b7f31ac8135616..0dcbe0cf97e1a06b5285a5a27baa46ac7416c718 100644 |
| --- a/chrome/browser/extensions/plugin_manager.cc |
| +++ b/chrome/browser/extensions/plugin_manager.cc |
| @@ -23,6 +23,9 @@ |
| #include "components/nacl/common/nacl_constants.h" |
| #endif |
| +const char kPDFPluginExtension[] = "pdf"; |
| +const char kPDFPluginDescription[] = "Portable Document Format"; |
| + |
| using content::PluginService; |
| namespace extensions { |
| @@ -90,7 +93,8 @@ void PluginManager::OnExtensionLoaded(content::BrowserContext* browser_context, |
| content::WebPluginInfo info; |
| info.type = content::WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN; |
| info.name = base::UTF8ToUTF16(extension->name()); |
| - info.path = base::FilePath::FromUTF8Unsafe(handler->extension_id()); |
| + info.path = extension->path(); |
|
raymes
2015/01/22 03:23:40
The path is sort of unimportant. We could display
|
| + info.version = base::UTF8ToUTF16(extension->GetVersionForDisplay()); |
|
raymes
2015/01/22 03:23:40
Since this is bundled with Chrome, let's not versi
|
| for (std::set<std::string>::const_iterator mime_type = |
| handler->mime_type_set().begin(); |
| @@ -99,8 +103,13 @@ void PluginManager::OnExtensionLoaded(content::BrowserContext* browser_context, |
| mime_type_info.mime_type = *mime_type; |
| base::FilePath::StringType file_extension; |
| if (net::GetPreferredExtensionForMimeType(*mime_type, &file_extension)) { |
| - mime_type_info.file_extensions.push_back( |
| - base::FilePath(file_extension).AsUTF8Unsafe()); |
| + std::string mime_file_extension = |
| + base::FilePath(file_extension).AsUTF8Unsafe(); |
| + mime_type_info.file_extensions.push_back(mime_file_extension); |
| + if (!mime_file_extension.compare(std::string(kPDFPluginExtension))) { |
| + mime_type_info.description = |
| + base::UTF8ToUTF16(std::string(kPDFPluginDescription)); |
| + } |
|
raymes
2015/01/22 03:23:40
We don't need to have a description (there current
|
| } |
| info.mime_types.push_back(mime_type_info); |
| } |