| Index: extensions/browser/event_router.h
|
| diff --git a/extensions/browser/event_router.h b/extensions/browser/event_router.h
|
| index 79a0c944d4eb06ddb3e43aebab6cb913e2d7f10f..cfc63352a800a456b07a28153442aed788539e9e 100644
|
| --- a/extensions/browser/event_router.h
|
| +++ b/extensions/browser/event_router.h
|
| @@ -16,10 +16,12 @@
|
| #include "base/gtest_prod_util.h"
|
| #include "base/memory/linked_ptr.h"
|
| #include "base/memory/ref_counted.h"
|
| +#include "base/scoped_observer.h"
|
| #include "base/values.h"
|
| #include "content/public/browser/notification_observer.h"
|
| #include "content/public/browser/notification_registrar.h"
|
| #include "extensions/browser/event_listener_map.h"
|
| +#include "extensions/browser/extension_registry_observer.h"
|
| #include "extensions/common/event_filtering_info.h"
|
| #include "ipc/ipc_sender.h"
|
|
|
| @@ -36,12 +38,14 @@ class ActivityLog;
|
| class Extension;
|
| class ExtensionHost;
|
| class ExtensionPrefs;
|
| +class ExtensionRegistry;
|
|
|
| struct Event;
|
| struct EventDispatchInfo;
|
| struct EventListenerInfo;
|
|
|
| class EventRouter : public content::NotificationObserver,
|
| + public ExtensionRegistryObserver,
|
| public EventListenerMap::Delegate {
|
| public:
|
| // These constants convey the state of our knowledge of whether we're in
|
| @@ -196,10 +200,19 @@ class EventRouter : public content::NotificationObserver,
|
| UserGestureState user_gesture,
|
| const extensions::EventFilteringInfo& info);
|
|
|
| + // content::NotificationObserver implementation.
|
| virtual void Observe(int type,
|
| const content::NotificationSource& source,
|
| const content::NotificationDetails& details) OVERRIDE;
|
|
|
| + // ExtensionRegistryObserver implementation.
|
| + virtual void OnExtensionLoaded(content::BrowserContext* browser_context,
|
| + const Extension* extension) OVERRIDE;
|
| + virtual void OnExtensionUnloaded(
|
| + content::BrowserContext* browser_context,
|
| + const Extension* extension,
|
| + UnloadedExtensionInfo::Reason reason) OVERRIDE;
|
| +
|
| // Returns true if the given listener map contains a event listeners for
|
| // the given event. If |extension_id| is non-empty, we also check that that
|
| // extension is one of the listeners.
|
| @@ -282,6 +295,9 @@ class EventRouter : public content::NotificationObserver,
|
|
|
| content::NotificationRegistrar registrar_;
|
|
|
| + ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver>
|
| + extension_registry_observer_;
|
| +
|
| EventListenerMap listeners_;
|
|
|
| // Map from base event name to observer.
|
|
|