| 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 "base/files/file_path.h" | 5 #include "base/files/file_path.h" |
| 6 #include "base/lazy_instance.h" | 6 #include "base/lazy_instance.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/extensions/plugin_manager.h" | 10 #include "chrome/browser/extensions/plugin_manager.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 } | 83 } |
| 84 #endif | 84 #endif |
| 85 | 85 |
| 86 const MimeTypesHandler* handler = MimeTypesHandler::GetHandler(extension); | 86 const MimeTypesHandler* handler = MimeTypesHandler::GetHandler(extension); |
| 87 if (handler && !handler->handler_url().empty()) { | 87 if (handler && !handler->handler_url().empty()) { |
| 88 plugins_or_nacl_changed = true; | 88 plugins_or_nacl_changed = true; |
| 89 | 89 |
| 90 content::WebPluginInfo info; | 90 content::WebPluginInfo info; |
| 91 info.type = content::WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN; | 91 info.type = content::WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN; |
| 92 info.name = base::UTF8ToUTF16(extension->name()); | 92 info.name = base::UTF8ToUTF16(extension->name()); |
| 93 info.path = base::FilePath::FromUTF8Unsafe(handler->extension_id()); | 93 info.path = base::FilePath::FromUTF8Unsafe(extension->url().spec()); |
| 94 | 94 |
| 95 for (std::set<std::string>::const_iterator mime_type = | 95 for (std::set<std::string>::const_iterator mime_type = |
| 96 handler->mime_type_set().begin(); | 96 handler->mime_type_set().begin(); |
| 97 mime_type != handler->mime_type_set().end(); ++mime_type) { | 97 mime_type != handler->mime_type_set().end(); ++mime_type) { |
| 98 content::WebPluginMimeType mime_type_info; | 98 content::WebPluginMimeType mime_type_info; |
| 99 mime_type_info.mime_type = *mime_type; | 99 mime_type_info.mime_type = *mime_type; |
| 100 base::FilePath::StringType file_extension; | 100 base::FilePath::StringType file_extension; |
| 101 if (net::GetPreferredExtensionForMimeType(*mime_type, &file_extension)) { | 101 if (net::GetPreferredExtensionForMimeType(*mime_type, &file_extension)) { |
| 102 mime_type_info.file_extensions.push_back( | 102 mime_type_info.file_extensions.push_back( |
| 103 base::FilePath(file_extension).AsUTF8Unsafe()); | 103 base::FilePath(file_extension).AsUTF8Unsafe()); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 iter != nacl_module_list_.end(); ++iter) { | 225 iter != nacl_module_list_.end(); ++iter) { |
| 226 if (iter->url == url) | 226 if (iter->url == url) |
| 227 return iter; | 227 return iter; |
| 228 } | 228 } |
| 229 return nacl_module_list_.end(); | 229 return nacl_module_list_.end(); |
| 230 } | 230 } |
| 231 | 231 |
| 232 #endif // !defined(DISABLE_NACL) | 232 #endif // !defined(DISABLE_NACL) |
| 233 | 233 |
| 234 } // namespace extensions | 234 } // namespace extensions |
| OLD | NEW |