Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Unified Diff: chrome/browser/extensions/api/gcm/gcm_api.h

Issue 189803002: [GCM] Observe the event listener adding such that GCM can be started (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix trybots Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/api/gcm/gcm_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/gcm/gcm_api.h
diff --git a/chrome/browser/extensions/api/gcm/gcm_api.h b/chrome/browser/extensions/api/gcm/gcm_api.h
index 964a6ea1a2b17bd6b2234f6e8a55ff2b28d7089c..71c73d155eb507efaacf9ef2b5e0b2444b78cf3c 100644
--- a/chrome/browser/extensions/api/gcm/gcm_api.h
+++ b/chrome/browser/extensions/api/gcm/gcm_api.h
@@ -7,6 +7,7 @@
#include "chrome/browser/services/gcm/gcm_event_router.h"
#include "chrome/common/extensions/api/gcm.h"
+#include "extensions/browser/event_router.h"
#include "extensions/browser/extension_function.h"
#include "google_apis/gcm/gcm_client.h"
@@ -75,7 +76,8 @@ class GcmSendFunction : public GcmApiFunction {
bool ValidateMessageData(const gcm::GCMClient::MessageData& data) const;
};
-class GcmJsEventRouter : public gcm::GCMEventRouter {
+class GcmJsEventRouter : public gcm::GCMEventRouter,
+ public EventRouter::Observer {
public:
explicit GcmJsEventRouter(Profile* profile);
@@ -90,6 +92,9 @@ class GcmJsEventRouter : public gcm::GCMEventRouter {
const std::string& message_id,
gcm::GCMClient::Result result) OVERRIDE;
+ // EventRouter::Observer:
+ virtual void OnListenerAdded(const EventListenerInfo& details) OVERRIDE;
+
private:
// The application we route the event to is running in context of the
// |profile_| and the latter outlives the event router.
« no previous file with comments | « no previous file | chrome/browser/extensions/api/gcm/gcm_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698