Index: chrome/browser/extensions/api/push_messaging/push_messaging_api.h |
diff --git a/chrome/browser/extensions/api/push_messaging/push_messaging_api.h b/chrome/browser/extensions/api/push_messaging/push_messaging_api.h |
index 5d8e95cc92354a4aad3fbf48def392ed1988d9ac..d5a976b935d2757a632931b97295618db4aeac61 100644 |
--- a/chrome/browser/extensions/api/push_messaging/push_messaging_api.h |
+++ b/chrome/browser/extensions/api/push_messaging/push_messaging_api.h |
@@ -6,22 +6,33 @@ |
#define CHROME_BROWSER_EXTENSIONS_API_PUSH_MESSAGING_PUSH_MESSAGING_API_H__ |
#include <string> |
+ |
#include "base/basictypes.h" |
#include "base/compiler_specific.h" |
#include "base/gtest_prod_util.h" |
-#include "chrome/browser/extensions/api/push_messaging/invalidation_handler_observer.h" |
+#include "base/memory/scoped_ptr.h" |
+#include "chrome/browser/extensions/api/push_messaging/push_messaging_invalidation_handler_observer.h" |
+#include "content/public/browser/notification_observer.h" |
+#include "content/public/browser/notification_registrar.h" |
class Profile; |
namespace extensions { |
+class PushMessagingInvalidationMapper; |
+ |
// Observes a single InvalidationHandler and generates onMessage events. |
-class PushMessagingEventRouter : public InvalidationHandlerObserver { |
+class PushMessagingEventRouter |
+ : public PushMessagingInvalidationHandlerObserver, |
+ public content::NotificationObserver { |
public: |
explicit PushMessagingEventRouter(Profile* profile); |
virtual ~PushMessagingEventRouter(); |
void Init(); |
+ void Shutdown(); |
+ |
+ void SetMapperForTest(scoped_ptr<PushMessagingInvalidationMapper> mapper); |
private: |
FRIEND_TEST_ALL_PREFIXES(PushMessagingApiTest, EventDispatch); |
@@ -31,7 +42,14 @@ class PushMessagingEventRouter : public InvalidationHandlerObserver { |
int subchannel, |
const std::string& payload) OVERRIDE; |
+ // content::NotificationObserver implementation. |
+ virtual void Observe(int type, |
+ const content::NotificationSource& source, |
+ const content::NotificationDetails& details) OVERRIDE; |
+ |
+ content::NotificationRegistrar registrar_; |
Profile* profile_; |
+ scoped_ptr<PushMessagingInvalidationMapper> handler_; |
DISALLOW_COPY_AND_ASSIGN(PushMessagingEventRouter); |
}; |