OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/extension_service.h" | 5 #include "chrome/browser/extensions/extension_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1100 } | 1100 } |
1101 #endif | 1101 #endif |
1102 | 1102 |
1103 // Same for chrome://thumb/ resources. | 1103 // Same for chrome://thumb/ resources. |
1104 if (extension->HasHostPermission(GURL(chrome::kChromeUIThumbnailURL))) { | 1104 if (extension->HasHostPermission(GURL(chrome::kChromeUIThumbnailURL))) { |
1105 ThumbnailSource* thumbnail_source = new ThumbnailSource(profile_); | 1105 ThumbnailSource* thumbnail_source = new ThumbnailSource(profile_); |
1106 ChromeURLDataManagerFactory::GetForProfile(profile_)-> | 1106 ChromeURLDataManagerFactory::GetForProfile(profile_)-> |
1107 AddDataSource(thumbnail_source); | 1107 AddDataSource(thumbnail_source); |
1108 } | 1108 } |
1109 | 1109 |
| 1110 #if defined(ENABLE_PLUGINS) |
1110 // TODO(mpcomplete): This ends up affecting all profiles. See crbug.com/80757. | 1111 // TODO(mpcomplete): This ends up affecting all profiles. See crbug.com/80757. |
1111 bool plugins_changed = false; | 1112 bool plugins_changed = false; |
1112 for (size_t i = 0; i < extension->plugins().size(); ++i) { | 1113 for (size_t i = 0; i < extension->plugins().size(); ++i) { |
1113 const Extension::PluginInfo& plugin = extension->plugins()[i]; | 1114 const Extension::PluginInfo& plugin = extension->plugins()[i]; |
1114 PluginService::GetInstance()->RefreshPlugins(); | 1115 PluginService::GetInstance()->RefreshPlugins(); |
1115 PluginService::GetInstance()->AddExtraPluginPath(plugin.path); | 1116 PluginService::GetInstance()->AddExtraPluginPath(plugin.path); |
1116 plugins_changed = true; | 1117 plugins_changed = true; |
1117 ChromePluginServiceFilter* filter = | 1118 ChromePluginServiceFilter* filter = |
1118 ChromePluginServiceFilter::GetInstance(); | 1119 ChromePluginServiceFilter::GetInstance(); |
1119 if (plugin.is_public) { | 1120 if (plugin.is_public) { |
(...skipping 10 matching lines...) Expand all Loading... |
1130 const Extension::NaClModuleInfo& module = extension->nacl_modules()[i]; | 1131 const Extension::NaClModuleInfo& module = extension->nacl_modules()[i]; |
1131 RegisterNaClModule(module.url, module.mime_type); | 1132 RegisterNaClModule(module.url, module.mime_type); |
1132 nacl_modules_changed = true; | 1133 nacl_modules_changed = true; |
1133 } | 1134 } |
1134 | 1135 |
1135 if (nacl_modules_changed) | 1136 if (nacl_modules_changed) |
1136 UpdatePluginListWithNaClModules(); | 1137 UpdatePluginListWithNaClModules(); |
1137 | 1138 |
1138 if (plugins_changed || nacl_modules_changed) | 1139 if (plugins_changed || nacl_modules_changed) |
1139 PluginService::GetInstance()->PurgePluginListCache(profile_, false); | 1140 PluginService::GetInstance()->PurgePluginListCache(profile_, false); |
| 1141 #endif // defined(ENABLE_PLUGINS) |
1140 | 1142 |
1141 #if defined(OS_CHROMEOS) | 1143 #if defined(OS_CHROMEOS) |
1142 for (std::vector<Extension::InputComponentInfo>::const_iterator component = | 1144 for (std::vector<Extension::InputComponentInfo>::const_iterator component = |
1143 extension->input_components().begin(); | 1145 extension->input_components().begin(); |
1144 component != extension->input_components().end(); | 1146 component != extension->input_components().end(); |
1145 ++component) { | 1147 ++component) { |
1146 if (component->type == Extension::INPUT_COMPONENT_TYPE_IME) { | 1148 if (component->type == Extension::INPUT_COMPONENT_TYPE_IME) { |
1147 extensions::InputImeEventRouter::GetInstance()->RegisterIme( | 1149 extensions::InputImeEventRouter::GetInstance()->RegisterIme( |
1148 profile_, extension->id(), *component); | 1150 profile_, extension->id(), *component); |
1149 } | 1151 } |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1198 } | 1200 } |
1199 | 1201 |
1200 if (extension->input_components().size() > 0) { | 1202 if (extension->input_components().size() > 0) { |
1201 extensions::InputImeEventRouter::GetInstance()->UnregisterAllImes( | 1203 extensions::InputImeEventRouter::GetInstance()->UnregisterAllImes( |
1202 profile_, extension->id()); | 1204 profile_, extension->id()); |
1203 } | 1205 } |
1204 #endif | 1206 #endif |
1205 | 1207 |
1206 UpdateActiveExtensionsInCrashReporter(); | 1208 UpdateActiveExtensionsInCrashReporter(); |
1207 | 1209 |
| 1210 #if defined(ENABLE_PLUGINS) |
1208 bool plugins_changed = false; | 1211 bool plugins_changed = false; |
1209 for (size_t i = 0; i < extension->plugins().size(); ++i) { | 1212 for (size_t i = 0; i < extension->plugins().size(); ++i) { |
1210 const Extension::PluginInfo& plugin = extension->plugins()[i]; | 1213 const Extension::PluginInfo& plugin = extension->plugins()[i]; |
1211 PluginService::GetInstance()->ForcePluginShutdown(plugin.path); | 1214 PluginService::GetInstance()->ForcePluginShutdown(plugin.path); |
1212 PluginService::GetInstance()->RefreshPlugins(); | 1215 PluginService::GetInstance()->RefreshPlugins(); |
1213 PluginService::GetInstance()->RemoveExtraPluginPath(plugin.path); | 1216 PluginService::GetInstance()->RemoveExtraPluginPath(plugin.path); |
1214 plugins_changed = true; | 1217 plugins_changed = true; |
1215 ChromePluginServiceFilter::GetInstance()->UnrestrictPlugin(plugin.path); | 1218 ChromePluginServiceFilter::GetInstance()->UnrestrictPlugin(plugin.path); |
1216 } | 1219 } |
1217 | 1220 |
1218 bool nacl_modules_changed = false; | 1221 bool nacl_modules_changed = false; |
1219 for (size_t i = 0; i < extension->nacl_modules().size(); ++i) { | 1222 for (size_t i = 0; i < extension->nacl_modules().size(); ++i) { |
1220 const Extension::NaClModuleInfo& module = extension->nacl_modules()[i]; | 1223 const Extension::NaClModuleInfo& module = extension->nacl_modules()[i]; |
1221 UnregisterNaClModule(module.url); | 1224 UnregisterNaClModule(module.url); |
1222 nacl_modules_changed = true; | 1225 nacl_modules_changed = true; |
1223 } | 1226 } |
1224 | 1227 |
1225 if (nacl_modules_changed) | 1228 if (nacl_modules_changed) |
1226 UpdatePluginListWithNaClModules(); | 1229 UpdatePluginListWithNaClModules(); |
1227 | 1230 |
1228 if (plugins_changed || nacl_modules_changed) | 1231 if (plugins_changed || nacl_modules_changed) |
1229 PluginService::GetInstance()->PurgePluginListCache(profile_, false); | 1232 PluginService::GetInstance()->PurgePluginListCache(profile_, false); |
| 1233 #endif // defined(ENABLE_PLUGINS) |
1230 } | 1234 } |
1231 | 1235 |
1232 Profile* ExtensionService::profile() { | 1236 Profile* ExtensionService::profile() { |
1233 return profile_; | 1237 return profile_; |
1234 } | 1238 } |
1235 | 1239 |
1236 extensions::ExtensionPrefs* ExtensionService::extension_prefs() { | 1240 extensions::ExtensionPrefs* ExtensionService::extension_prefs() { |
1237 return extension_prefs_; | 1241 return extension_prefs_; |
1238 } | 1242 } |
1239 | 1243 |
(...skipping 1908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3148 scoped_refptr<const Extension> extension = GetInstalledExtension(*it); | 3152 scoped_refptr<const Extension> extension = GetInstalledExtension(*it); |
3149 DCHECK(extension); | 3153 DCHECK(extension); |
3150 if (!extension) | 3154 if (!extension) |
3151 continue; | 3155 continue; |
3152 blacklisted_extensions_.Insert(extension); | 3156 blacklisted_extensions_.Insert(extension); |
3153 UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST); | 3157 UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST); |
3154 } | 3158 } |
3155 | 3159 |
3156 IdentifyAlertableExtensions(); | 3160 IdentifyAlertableExtensions(); |
3157 } | 3161 } |
OLD | NEW |