Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3126)

Unified Diff: chrome/browser/extensions/extension_service.cc

Issue 11348301: Force-load a lazy background page whenever an extension is enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.

Powered by Google App Engine
This is Rietveld 408576698