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