Chromium Code Reviews| Index: chrome/browser/extensions/extension_service.cc |
| diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc |
| index 76465a05df4e655c63c0a128e6f5fb5d03f2663f..fe0358d8ab1195c9b8028cee2ee9270cdd6738e7 100644 |
| --- a/chrome/browser/extensions/extension_service.cc |
| +++ b/chrome/browser/extensions/extension_service.cc |
| @@ -189,6 +189,9 @@ static bool IsSyncableApp(const Extension& extension) { |
| return extension.GetSyncType() == Extension::SYNC_TYPE_APP; |
| } |
| +static void DoNothing(extensions::ExtensionHost* host) { |
| +} |
| + |
| } // namespace |
| ExtensionService::ExtensionRuntimeData::ExtensionRuntimeData() |
| @@ -935,6 +938,14 @@ void ExtensionService::EnableExtension(const std::string& extension_id) { |
| extensions_.Insert(make_scoped_refptr(extension)); |
| disabled_extensions_.Remove(extension->id()); |
| + // If the extension has a lazy background page, make sure it gets loaded to |
|
Matt Perry
2012/11/29 20:24:46
ExtensionService is not the best place for this co
Marijn Kruisselbrink
2012/11/29 21:07:19
Ah yes, of course. Done.
|
| + // discover which events the extension wants to listen to. |
| + if (extension->has_lazy_background_page()) { |
| + extensions::LazyBackgroundTaskQueue* queue = |
| + system_->lazy_background_task_queue(); |
| + queue->AddPendingTask(profile_, extension->id(), base::Bind(&DoNothing)); |
| + } |
| + |
| NotifyExtensionLoaded(extension); |
| // Notify listeners that the extension was enabled. |