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