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 f6ddcdc5de0fea4e499dc836ac859bdca6fd6e97..b5f720810733b800a6f125d01acea3c0d1c4bb4f 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); |
}; |