Chromium Code Reviews| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 60 if (plugin->is_public) { | 60 if (plugin->is_public) { |
| 61 filter->RestrictPluginToProfileAndOrigin( | 61 filter->RestrictPluginToProfileAndOrigin( |
| 62 plugin->path, profile_, GURL()); | 62 plugin->path, profile_, GURL()); |
| 63 } else { | 63 } else { |
| 64 filter->RestrictPluginToProfileAndOrigin( | 64 filter->RestrictPluginToProfileAndOrigin( |
| 65 plugin->path, profile_, extension->url()); | 65 plugin->path, profile_, extension->url()); |
| 66 } | 66 } |
| 67 } | 67 } |
| 68 } | 68 } |
| 69 | 69 |
| 70 #if !defined(DISABLE_NACL) | |
| 70 const NaClModuleInfo::List* nacl_modules = | 71 const NaClModuleInfo::List* nacl_modules = |
|
Lei Zhang
2014/07/17 05:33:47
RegisterNaClModule(), UnregisterNaClModule(), Upda
tzik
2014/07/17 05:53:31
Done.
| |
| 71 NaClModuleInfo::GetNaClModules(extension); | 72 NaClModuleInfo::GetNaClModules(extension); |
| 72 if (nacl_modules) { | 73 if (nacl_modules) { |
| 73 plugins_or_nacl_changed = true; | 74 plugins_or_nacl_changed = true; |
| 74 for (NaClModuleInfo::List::const_iterator module = nacl_modules->begin(); | 75 for (NaClModuleInfo::List::const_iterator module = nacl_modules->begin(); |
| 75 module != nacl_modules->end(); | 76 module != nacl_modules->end(); |
| 76 ++module) { | 77 ++module) { |
| 77 RegisterNaClModule(*module); | 78 RegisterNaClModule(*module); |
| 78 } | 79 } |
| 79 UpdatePluginListWithNaClModules(); | 80 UpdatePluginListWithNaClModules(); |
| 80 } | 81 } |
| 82 #endif | |
| 81 | 83 |
| 82 const MimeTypesHandler* handler = MimeTypesHandler::GetHandler(extension); | 84 const MimeTypesHandler* handler = MimeTypesHandler::GetHandler(extension); |
| 83 if (handler && !handler->handler_url().empty()) { | 85 if (handler && !handler->handler_url().empty()) { |
| 84 plugins_or_nacl_changed = true; | 86 plugins_or_nacl_changed = true; |
| 85 | 87 |
| 86 content::WebPluginInfo info; | 88 content::WebPluginInfo info; |
| 87 info.type = content::WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN; | 89 info.type = content::WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN; |
| 88 info.name = base::UTF8ToUTF16(handler->extension_id()); | 90 info.name = base::UTF8ToUTF16(handler->extension_id()); |
| 89 info.path = base::FilePath::FromUTF8Unsafe(handler->extension_id()); | 91 info.path = base::FilePath::FromUTF8Unsafe(handler->extension_id()); |
| 90 | 92 |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 115 for (PluginInfo::PluginVector::const_iterator plugin = plugins->begin(); | 117 for (PluginInfo::PluginVector::const_iterator plugin = plugins->begin(); |
| 116 plugin != plugins->end(); | 118 plugin != plugins->end(); |
| 117 ++plugin) { | 119 ++plugin) { |
| 118 PluginService::GetInstance()->ForcePluginShutdown(plugin->path); | 120 PluginService::GetInstance()->ForcePluginShutdown(plugin->path); |
| 119 PluginService::GetInstance()->RefreshPlugins(); | 121 PluginService::GetInstance()->RefreshPlugins(); |
| 120 PluginService::GetInstance()->RemoveExtraPluginPath(plugin->path); | 122 PluginService::GetInstance()->RemoveExtraPluginPath(plugin->path); |
| 121 ChromePluginServiceFilter::GetInstance()->UnrestrictPlugin(plugin->path); | 123 ChromePluginServiceFilter::GetInstance()->UnrestrictPlugin(plugin->path); |
| 122 } | 124 } |
| 123 } | 125 } |
| 124 | 126 |
| 127 #if !defined(DISABLE_NACL) | |
| 125 const NaClModuleInfo::List* nacl_modules = | 128 const NaClModuleInfo::List* nacl_modules = |
| 126 NaClModuleInfo::GetNaClModules(extension); | 129 NaClModuleInfo::GetNaClModules(extension); |
| 127 if (nacl_modules) { | 130 if (nacl_modules) { |
| 128 plugins_or_nacl_changed = true; | 131 plugins_or_nacl_changed = true; |
| 129 for (NaClModuleInfo::List::const_iterator module = nacl_modules->begin(); | 132 for (NaClModuleInfo::List::const_iterator module = nacl_modules->begin(); |
| 130 module != nacl_modules->end(); | 133 module != nacl_modules->end(); |
| 131 ++module) { | 134 ++module) { |
| 132 UnregisterNaClModule(*module); | 135 UnregisterNaClModule(*module); |
| 133 } | 136 } |
| 134 UpdatePluginListWithNaClModules(); | 137 UpdatePluginListWithNaClModules(); |
| 135 } | 138 } |
| 139 #endif | |
| 136 | 140 |
| 137 const MimeTypesHandler* handler = MimeTypesHandler::GetHandler(extension); | 141 const MimeTypesHandler* handler = MimeTypesHandler::GetHandler(extension); |
| 138 if (handler && !handler->handler_url().empty()) { | 142 if (handler && !handler->handler_url().empty()) { |
| 139 plugins_or_nacl_changed = true; | 143 plugins_or_nacl_changed = true; |
| 140 base::FilePath path = | 144 base::FilePath path = |
| 141 base::FilePath::FromUTF8Unsafe(handler->extension_id()); | 145 base::FilePath::FromUTF8Unsafe(handler->extension_id()); |
| 142 PluginService::GetInstance()->UnregisterInternalPlugin(path); | 146 PluginService::GetInstance()->UnregisterInternalPlugin(path); |
| 143 PluginService::GetInstance()->ForcePluginShutdown(path); | 147 PluginService::GetInstance()->ForcePluginShutdown(path); |
| 144 PluginService::GetInstance()->RefreshPlugins(); | 148 PluginService::GetInstance()->RefreshPlugins(); |
| 145 } | 149 } |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 210 NaClModuleInfo::List::iterator PluginManager::FindNaClModule(const GURL& url) { | 214 NaClModuleInfo::List::iterator PluginManager::FindNaClModule(const GURL& url) { |
| 211 for (NaClModuleInfo::List::iterator iter = nacl_module_list_.begin(); | 215 for (NaClModuleInfo::List::iterator iter = nacl_module_list_.begin(); |
| 212 iter != nacl_module_list_.end(); ++iter) { | 216 iter != nacl_module_list_.end(); ++iter) { |
| 213 if (iter->url == url) | 217 if (iter->url == url) |
| 214 return iter; | 218 return iter; |
| 215 } | 219 } |
| 216 return nacl_module_list_.end(); | 220 return nacl_module_list_.end(); |
| 217 } | 221 } |
| 218 | 222 |
| 219 } // namespace extensions | 223 } // namespace extensions |
| OLD | NEW |