diff options
author | yoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-25 02:21:47 +0000 |
---|---|---|
committer | yoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-25 02:21:47 +0000 |
commit | 5ee4304713457b8293454c34be8b1f9f929b8453 (patch) | |
tree | 68d63b041ca6a12d612e2ce02bd4e5466ba3ac99 /chrome/browser/extensions/extension_webnavigation_api.h | |
parent | 62755f824d5d77d0d110d3cc4e3f7614632e29ee (diff) | |
download | chromium_src-5ee4304713457b8293454c34be8b1f9f929b8453.zip chromium_src-5ee4304713457b8293454c34be8b1f9f929b8453.tar.gz chromium_src-5ee4304713457b8293454c34be8b1f9f929b8453.tar.bz2 |
Change many extension event routers to not be singletons and to be more profile-aware.
Make these event routers owned by the profile via the ExtensionService, and only handle events for their profile:
- history (note: already doesn't work in incognito)
- bookmark
- cookies
- management
- web navigation
BUG=57186, 81745
TEST=covered by existing tests
Review URL: http://codereview.chromium.org/7243012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90477 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_webnavigation_api.h')
-rw-r--r-- | chrome/browser/extensions/extension_webnavigation_api.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/chrome/browser/extensions/extension_webnavigation_api.h b/chrome/browser/extensions/extension_webnavigation_api.h index 9f475dc..431507d 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); }; |