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

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

Issue 7243012: Change many extension event routers to not be singletons and to be more profile-aware. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 months 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_management_api.cc
diff --git a/chrome/browser/extensions/extension_management_api.cc b/chrome/browser/extensions/extension_management_api.cc
index 0053b1d3a48a60fea7835900faa2f0b9ed91cf00..f7b38563ff48d9ba2e5749baf9a6611e92861937 100644
--- a/chrome/browser/extensions/extension_management_api.cc
+++ b/chrome/browser/extensions/extension_management_api.cc
@@ -248,16 +248,11 @@ bool UninstallFunction::RunImpl() {
return true;
}
-// static
-ExtensionManagementEventRouter* ExtensionManagementEventRouter::GetInstance() {
- return Singleton<ExtensionManagementEventRouter>::get();
-}
-
ExtensionManagementEventRouter::ExtensionManagementEventRouter() {}
ExtensionManagementEventRouter::~ExtensionManagementEventRouter() {}
-void ExtensionManagementEventRouter::Init() {
+void ExtensionManagementEventRouter::ObserveProfile(Profile* profile) {
NotificationType::Type types[] = {
NotificationType::EXTENSION_INSTALLED,
NotificationType::EXTENSION_UNINSTALLED,
@@ -265,12 +260,14 @@ void ExtensionManagementEventRouter::Init() {
NotificationType::EXTENSION_UNLOADED
};
- // Don't re-init (eg in the case of multiple profiles).
if (registrar_.IsEmpty()) {
asargent_no_longer_on_chrome 2011/06/23 22:18:38 same question here - if we now expect to have one
Yoyo Zhou 2011/06/24 17:21:38 Done.
for (size_t i = 0; i < arraysize(types); i++) {
registrar_.Add(this,
types[i],
- NotificationService::AllSources());
+ Source<Profile>(profile));
+ registrar_.Add(this,
+ types[i],
+ Source<Profile>(profile->GetOffTheRecordProfile()));
}
}
}

Powered by Google App Engine
This is Rietveld 408576698