Chromium Code Reviews| Index: chrome/browser/extensions/extension_history_api.h |
| diff --git a/chrome/browser/extensions/extension_history_api.h b/chrome/browser/extensions/extension_history_api.h |
| index d51c3f44211484a020b01193c834ca5f76774648..d8cb78d45a91067b19ec6849f73982599b8cfcd4 100644 |
| --- a/chrome/browser/extensions/extension_history_api.h |
| +++ b/chrome/browser/extensions/extension_history_api.h |
| @@ -9,28 +9,24 @@ |
| #include <map> |
| #include <string> |
| -#include "base/memory/singleton.h" |
| #include "chrome/browser/extensions/extension_function.h" |
| #include "chrome/browser/history/history.h" |
| #include "chrome/browser/history/history_notifications.h" |
| #include "content/common/notification_registrar.h" |
| +class Profile; |
| + |
| // Observes History service and routes the notifications as events to the |
| // extension system. |
| class ExtensionHistoryEventRouter : public NotificationObserver { |
| public: |
| - // Single instance of the event router. |
| - static ExtensionHistoryEventRouter* GetInstance(); |
| + explicit ExtensionHistoryEventRouter(Profile* profile) |
| + : profile_(profile) {} |
| + virtual ~ExtensionHistoryEventRouter() {} |
|
asargent_no_longer_on_chrome
2011/05/24 18:18:00
same inlining nit here
|
| - // Safe to call multiple times. |
| - void ObserveProfile(Profile* profile); |
| + void Init(); |
| private: |
| - friend struct DefaultSingletonTraits<ExtensionHistoryEventRouter>; |
| - |
| - ExtensionHistoryEventRouter(); |
| - virtual ~ExtensionHistoryEventRouter(); |
| - |
| // NotificationObserver::Observe. |
| virtual void Observe(NotificationType type, |
| const NotificationSource& source, |
| @@ -49,9 +45,8 @@ class ExtensionHistoryEventRouter : public NotificationObserver { |
| // Used for tracking registrations to history service notifications. |
| NotificationRegistrar registrar_; |
| - // Registered profiles. |
| - typedef std::map<uintptr_t, Profile*> ProfileMap; |
| - ProfileMap profiles_; |
| + // The associated Profile owns us transitively via ExtensionService. |
| + Profile* profile_; |
| DISALLOW_COPY_AND_ASSIGN(ExtensionHistoryEventRouter); |
| }; |