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

Unified Diff: chrome/browser/extensions/extension_service.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: bookmark remove observer 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_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 5ae59ef524a4dfd5db74c68ac209d945a46a60b6..ff572e570b8e1b0f3621a20b1f1033f67d9c40a4 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -643,35 +643,34 @@ ExtensionService::~ExtensionService() {
ExternalExtensionProviderInterface* provider = i->get();
provider->ServiceShutdown();
}
-
-#if defined(OS_CHROMEOS)
- if (event_routers_initialized_) {
- ExtensionFileBrowserEventRouter::GetInstance()->
- StopObservingFileSystemEvents();
- }
-#endif
}
void ExtensionService::InitEventRouters() {
if (event_routers_initialized_)
return;
- ExtensionHistoryEventRouter::GetInstance()->ObserveProfile(profile_);
+ history_event_router_.reset(new ExtensionHistoryEventRouter());
+ history_event_router_->ObserveProfile(profile_);
ExtensionAccessibilityEventRouter::GetInstance()->ObserveProfile(profile_);
browser_event_router_.reset(new ExtensionBrowserEventRouter(profile_));
browser_event_router_->Init();
preference_event_router_.reset(new ExtensionPreferenceEventRouter(profile_));
- ExtensionBookmarkEventRouter::GetInstance()->Observe(
- profile_->GetBookmarkModel());
- ExtensionCookiesEventRouter::GetInstance()->Init();
- ExtensionManagementEventRouter::GetInstance()->Init();
+ bookmark_event_router_.reset(new ExtensionBookmarkEventRouter(
+ profile_->GetBookmarkModel()));
+ bookmark_event_router_->Init();
+ cookies_event_router_.reset(new ExtensionCookiesEventRouter());
+ cookies_event_router_->ObserveProfile(profile_);
+ management_event_router_.reset(new ExtensionManagementEventRouter());
+ management_event_router_->ObserveProfile(profile_);
ExtensionProcessesEventRouter::GetInstance()->ObserveProfile(profile_);
- ExtensionWebNavigationEventRouter::GetInstance()->Init();
+ web_navigation_event_router_.reset(
+ new ExtensionWebNavigationEventRouter(profile_));
+ web_navigation_event_router_->Init();
#if defined(OS_CHROMEOS)
- ExtensionFileBrowserEventRouter::GetInstance()->ObserveFileSystemEvents(
- profile_);
- ExtensionMediaPlayerEventRouter::GetInstance()->Init(profile_);
+ file_browser_event_router_.reset(
+ new ExtensionFileBrowserEventRouter(profile_));
+ file_browser_event_router_->Init();
#endif
#if defined(OS_CHROMEOS) && defined(TOUCH_UI)
« no previous file with comments | « chrome/browser/extensions/extension_service.h ('k') | chrome/browser/extensions/extension_webnavigation_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698