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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 #include "sync/api/sync_change.h" | 108 #include "sync/api/sync_change.h" |
109 #include "sync/api/sync_error_factory.h" | 109 #include "sync/api/sync_error_factory.h" |
110 #include "webkit/database/database_tracker.h" | 110 #include "webkit/database/database_tracker.h" |
111 #include "webkit/database/database_util.h" | 111 #include "webkit/database/database_util.h" |
112 | 112 |
113 #if defined(OS_CHROMEOS) | 113 #if defined(OS_CHROMEOS) |
114 #include "chrome/browser/chromeos/cros/cros_library.h" | 114 #include "chrome/browser/chromeos/cros/cros_library.h" |
115 #include "chrome/browser/chromeos/extensions/file_browser_event_router.h" | 115 #include "chrome/browser/chromeos/extensions/file_browser_event_router.h" |
116 #include "chrome/browser/chromeos/extensions/media_player_event_router.h" | 116 #include "chrome/browser/chromeos/extensions/media_player_event_router.h" |
117 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 117 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
118 #include "chrome/browser/extensions/api/input_ime/input_ime_api.h" | |
119 #include "content/public/browser/storage_partition.h" | 118 #include "content/public/browser/storage_partition.h" |
120 #include "webkit/fileapi/file_system_context.h" | 119 #include "webkit/fileapi/file_system_context.h" |
121 #include "webkit/fileapi/file_system_mount_point_provider.h" | 120 #include "webkit/fileapi/file_system_mount_point_provider.h" |
122 #endif | 121 #endif |
123 | 122 |
124 using content::BrowserContext; | 123 using content::BrowserContext; |
125 using content::BrowserThread; | 124 using content::BrowserThread; |
126 using content::DevToolsAgentHost; | 125 using content::DevToolsAgentHost; |
127 using content::DevToolsAgentHostRegistry; | 126 using content::DevToolsAgentHostRegistry; |
128 using content::PluginService; | 127 using content::PluginService; |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 #if defined(ENABLE_EXTENSIONS) | 522 #if defined(ENABLE_EXTENSIONS) |
524 browser_event_router_.reset(new extensions::BrowserEventRouter(profile_)); | 523 browser_event_router_.reset(new extensions::BrowserEventRouter(profile_)); |
525 | 524 |
526 extensions::PushMessagingAPIFactory::GetForProfile(profile_); | 525 extensions::PushMessagingAPIFactory::GetForProfile(profile_); |
527 | 526 |
528 #if defined(OS_CHROMEOS) | 527 #if defined(OS_CHROMEOS) |
529 FileBrowserEventRouterFactory::GetForProfile( | 528 FileBrowserEventRouterFactory::GetForProfile( |
530 profile_)->ObserveFileSystemEvents(); | 529 profile_)->ObserveFileSystemEvents(); |
531 | 530 |
532 ExtensionMediaPlayerEventRouter::GetInstance()->Init(profile_); | 531 ExtensionMediaPlayerEventRouter::GetInstance()->Init(profile_); |
533 extensions::InputImeEventRouter::GetInstance()->Init(); | |
534 #endif // defined(OS_CHROMEOS) | 532 #endif // defined(OS_CHROMEOS) |
535 #endif // defined(ENABLE_EXTENSIONS) | 533 #endif // defined(ENABLE_EXTENSIONS) |
536 event_routers_initialized_ = true; | 534 event_routers_initialized_ = true; |
537 } | 535 } |
538 | 536 |
539 void ExtensionService::Shutdown() { | 537 void ExtensionService::Shutdown() { |
540 // Do nothing for now. | 538 // Do nothing for now. |
541 } | 539 } |
542 | 540 |
543 const Extension* ExtensionService::GetExtensionById( | 541 const Extension* ExtensionService::GetExtensionById( |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1130 const Extension::NaClModuleInfo& module = extension->nacl_modules()[i]; | 1128 const Extension::NaClModuleInfo& module = extension->nacl_modules()[i]; |
1131 RegisterNaClModule(module.url, module.mime_type); | 1129 RegisterNaClModule(module.url, module.mime_type); |
1132 nacl_modules_changed = true; | 1130 nacl_modules_changed = true; |
1133 } | 1131 } |
1134 | 1132 |
1135 if (nacl_modules_changed) | 1133 if (nacl_modules_changed) |
1136 UpdatePluginListWithNaClModules(); | 1134 UpdatePluginListWithNaClModules(); |
1137 | 1135 |
1138 if (plugins_changed || nacl_modules_changed) | 1136 if (plugins_changed || nacl_modules_changed) |
1139 PluginService::GetInstance()->PurgePluginListCache(profile_, false); | 1137 PluginService::GetInstance()->PurgePluginListCache(profile_, false); |
1140 | |
1141 #if defined(OS_CHROMEOS) | |
1142 for (std::vector<Extension::InputComponentInfo>::const_iterator component = | |
1143 extension->input_components().begin(); | |
1144 component != extension->input_components().end(); | |
1145 ++component) { | |
1146 if (component->type == Extension::INPUT_COMPONENT_TYPE_IME) { | |
1147 extensions::InputImeEventRouter::GetInstance()->RegisterIme( | |
1148 profile_, extension->id(), *component); | |
1149 } | |
1150 } | |
1151 #endif | |
1152 } | 1138 } |
1153 | 1139 |
1154 void ExtensionService::NotifyExtensionUnloaded( | 1140 void ExtensionService::NotifyExtensionUnloaded( |
1155 const Extension* extension, | 1141 const Extension* extension, |
1156 extension_misc::UnloadedExtensionReason reason) { | 1142 extension_misc::UnloadedExtensionReason reason) { |
1157 UnloadedExtensionInfo details(extension, reason); | 1143 UnloadedExtensionInfo details(extension, reason); |
1158 content::NotificationService::current()->Notify( | 1144 content::NotificationService::current()->Notify( |
1159 chrome::NOTIFICATION_EXTENSION_UNLOADED, | 1145 chrome::NOTIFICATION_EXTENSION_UNLOADED, |
1160 content::Source<Profile>(profile_), | 1146 content::Source<Profile>(profile_), |
1161 content::Details<UnloadedExtensionInfo>(&details)); | 1147 content::Details<UnloadedExtensionInfo>(&details)); |
(...skipping 27 matching lines...) Expand all Loading... |
1189 | 1175 |
1190 #if defined(OS_CHROMEOS) | 1176 #if defined(OS_CHROMEOS) |
1191 // Revoke external file access to third party extensions. | 1177 // Revoke external file access to third party extensions. |
1192 fileapi::FileSystemContext* filesystem_context = | 1178 fileapi::FileSystemContext* filesystem_context = |
1193 BrowserContext::GetDefaultStoragePartition(profile_)-> | 1179 BrowserContext::GetDefaultStoragePartition(profile_)-> |
1194 GetFileSystemContext(); | 1180 GetFileSystemContext(); |
1195 if (filesystem_context && filesystem_context->external_provider()) { | 1181 if (filesystem_context && filesystem_context->external_provider()) { |
1196 filesystem_context->external_provider()-> | 1182 filesystem_context->external_provider()-> |
1197 RevokeAccessForExtension(extension->id()); | 1183 RevokeAccessForExtension(extension->id()); |
1198 } | 1184 } |
1199 | |
1200 if (extension->input_components().size() > 0) { | |
1201 extensions::InputImeEventRouter::GetInstance()->UnregisterAllImes( | |
1202 profile_, extension->id()); | |
1203 } | |
1204 #endif | 1185 #endif |
1205 | 1186 |
1206 UpdateActiveExtensionsInCrashReporter(); | 1187 UpdateActiveExtensionsInCrashReporter(); |
1207 | 1188 |
1208 bool plugins_changed = false; | 1189 bool plugins_changed = false; |
1209 for (size_t i = 0; i < extension->plugins().size(); ++i) { | 1190 for (size_t i = 0; i < extension->plugins().size(); ++i) { |
1210 const Extension::PluginInfo& plugin = extension->plugins()[i]; | 1191 const Extension::PluginInfo& plugin = extension->plugins()[i]; |
1211 PluginService::GetInstance()->ForcePluginShutdown(plugin.path); | 1192 PluginService::GetInstance()->ForcePluginShutdown(plugin.path); |
1212 PluginService::GetInstance()->RefreshPlugins(); | 1193 PluginService::GetInstance()->RefreshPlugins(); |
1213 PluginService::GetInstance()->RemoveExtraPluginPath(plugin.path); | 1194 PluginService::GetInstance()->RemoveExtraPluginPath(plugin.path); |
(...skipping 1934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3148 scoped_refptr<const Extension> extension = GetInstalledExtension(*it); | 3129 scoped_refptr<const Extension> extension = GetInstalledExtension(*it); |
3149 DCHECK(extension); | 3130 DCHECK(extension); |
3150 if (!extension) | 3131 if (!extension) |
3151 continue; | 3132 continue; |
3152 blacklisted_extensions_.Insert(extension); | 3133 blacklisted_extensions_.Insert(extension); |
3153 UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST); | 3134 UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST); |
3154 } | 3135 } |
3155 | 3136 |
3156 IdentifyAlertableExtensions(); | 3137 IdentifyAlertableExtensions(); |
3157 } | 3138 } |
OLD | NEW |