| 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..982a439abaa8515b91f273e34347c8d9868c4e6f 100644
|
| --- a/chrome/browser/extensions/extension_history_api.h
|
| +++ b/chrome/browser/extensions/extension_history_api.h
|
| @@ -9,28 +9,23 @@
|
| #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);
|
| + virtual ~ExtensionHistoryEventRouter();
|
|
|
| - // 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 +44,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);
|
| };
|
|
|