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

Unified Diff: chrome/browser/extensions/api/push_messaging/push_messaging_api.h

Issue 10837013: Chrome Cloud Messaging (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: InvalidationHandler + event Created 8 years, 5 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
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
new file mode 100644
index 0000000000000000000000000000000000000000..ce93f4345dee1c7114712bd71ce6628c94136fbe
--- /dev/null
+++ b/chrome/browser/extensions/api/push_messaging/push_messaging_api.h
@@ -0,0 +1,42 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_EXTENSIONS_API_PUSH_MESSAGING_PUSH_MESSAGING_API_H__
+#define CHROME_BROWSER_EXTENSIONS_API_PUSH_MESSAGING_PUSH_MESSAGING_API_H__
+
+#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/extensions/api/push_messaging/invalidation_handler_observer.h"
+
+class Profile;
+
+namespace extensions {
+
+class InvalidationHandler;
+
+class ExtensionPushMessagingEventRouter : public InvalidationHandlerObserver {
+ public:
+ explicit ExtensionPushMessagingEventRouter(Profile* profile);
+ virtual ~ExtensionPushMessagingEventRouter();
+
+ void Init();
+
+ void TriggerMessageForTest(const std::string& extension_id,
+ int subchannel,
+ const std::string& payload);
+
+ private:
+ // InvalidationHandlerObserver implementation.
+ virtual void OnMessage(const std::string& extension_id,
+ int subchannel,
+ const std::string& payload) OVERRIDE;
+
+ Profile* profile_;
+ scoped_ptr<InvalidationHandler> handler_;
+
+ DISALLOW_COPY_AND_ASSIGN(ExtensionPushMessagingEventRouter);
+};
+
+} // namespace extension
+
+#endif // CHROME_BROWSER_EXTENSIONS_API_PUSH_MESSAGING_PUSH_MESSAGING_API_H__

Powered by Google App Engine
This is Rietveld 408576698