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

Unified Diff: chrome/browser/extensions/extension_webnavigation_api.h

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_webnavigation_api.h
diff --git a/chrome/browser/extensions/extension_webnavigation_api.h b/chrome/browser/extensions/extension_webnavigation_api.h
index 9f475dc1ea3dc3c1d8aa76ab0fa3e038d6060eee..431507d0d2a91eedc8bce1732ec53395d3951217 100644
--- a/chrome/browser/extensions/extension_webnavigation_api.h
+++ b/chrome/browser/extensions/extension_webnavigation_api.h
@@ -12,8 +12,8 @@
#include <map>
-#include "base/memory/singleton.h"
#include "chrome/browser/extensions/extension_function.h"
+#include "chrome/browser/profiles/profile.h"
#include "content/browser/tab_contents/tab_contents_observer.h"
#include "content/common/notification_observer.h"
#include "content/common/notification_registrar.h"
@@ -132,19 +132,14 @@ class ExtensionWebNavigationTabObserver : public TabContentsObserver {
// system.
class ExtensionWebNavigationEventRouter : public NotificationObserver {
public:
- // Returns the singleton instance of the event router.
- static ExtensionWebNavigationEventRouter* GetInstance();
+ explicit ExtensionWebNavigationEventRouter(Profile* profile);
+ virtual ~ExtensionWebNavigationEventRouter();
// Invoked by the extensions service once the extension system is fully set
// up and can start dispatching events to extensions.
void Init();
private:
- friend struct DefaultSingletonTraits<ExtensionWebNavigationEventRouter>;
-
- ExtensionWebNavigationEventRouter();
- virtual ~ExtensionWebNavigationEventRouter();
-
// NotificationObserver implementation.
virtual void Observe(NotificationType type,
const NotificationSource& source,
@@ -159,6 +154,9 @@ class ExtensionWebNavigationEventRouter : public NotificationObserver {
// Used for tracking registrations to navigation notifications.
NotificationRegistrar registrar_;
+ // The profile that owns us via ExtensionService.
+ Profile* profile_;
+
DISALLOW_COPY_AND_ASSIGN(ExtensionWebNavigationEventRouter);
};
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/extensions/extension_webnavigation_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698