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

Unified Diff: content/renderer/push_messaging_dispatcher.h

Issue 219653002: Push API: send and receive IPC messages for registration. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean up includes. Created 6 years, 8 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 | « content/content_renderer.gypi ('k') | content/renderer/push_messaging_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/push_messaging_dispatcher.h
diff --git a/content/renderer/push_messaging_dispatcher.h b/content/renderer/push_messaging_dispatcher.h
new file mode 100644
index 0000000000000000000000000000000000000000..ad441b24f0363fc3b510416eaceee125ab32521a
--- /dev/null
+++ b/content/renderer/push_messaging_dispatcher.h
@@ -0,0 +1,56 @@
+// Copyright 2014 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 CONTENT_RENDERER_PUSH_MESSAGING_DISPATCHER_H_
+#define CONTENT_RENDERER_PUSH_MESSAGING_DISPATCHER_H_
+
+#include <string>
+
+#include "base/id_map.h"
+#include "content/public/renderer/render_view_observer.h"
+#include "third_party/WebKit/public/platform/WebPushClient.h"
+
+class GURL;
+
+namespace IPC {
+class Message;
+} // namespace IPC
+
+namespace blink {
+class WebString;
+} // namespace blink
+
+namespace content {
+class RenderViewImpl;
+
+class PushMessagingDispatcher : public RenderViewObserver,
+ public blink::WebPushClient {
+ public:
+ explicit PushMessagingDispatcher(RenderViewImpl* render_view);
+ virtual ~PushMessagingDispatcher();
+
+ private:
+ // RenderView::Observer implementation.
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+
+ // WebPushClient implementation.
+ virtual void registerPushMessaging(
+ const blink::WebString& sender_id,
+ blink::WebPushRegistrationCallbacks* callbacks) OVERRIDE;
+
+ void OnRegisterSuccess(int32 callbacks_id,
+ const GURL& endpoint,
+ const std::string& registration_id);
+
+ void OnRegisterError(int32 callbacks_id);
+
+ IDMap<blink::WebPushRegistrationCallbacks, IDMapOwnPointer>
+ registration_callbacks_;
+
+ DISALLOW_COPY_AND_ASSIGN(PushMessagingDispatcher);
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_PUSH_MESSAGING_DISPATCHER_H_
« no previous file with comments | « content/content_renderer.gypi ('k') | content/renderer/push_messaging_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698