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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « content/content_renderer.gypi ('k') | content/renderer/push_messaging_dispatcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_RENDERER_PUSH_MESSAGING_DISPATCHER_H_
6 #define CONTENT_RENDERER_PUSH_MESSAGING_DISPATCHER_H_
7
8 #include <string>
9
10 #include "base/id_map.h"
11 #include "content/public/renderer/render_view_observer.h"
12 #include "third_party/WebKit/public/platform/WebPushClient.h"
13
14 class GURL;
15
16 namespace IPC {
17 class Message;
18 } // namespace IPC
19
20 namespace blink {
21 class WebString;
22 } // namespace blink
23
24 namespace content {
25 class RenderViewImpl;
26
27 class PushMessagingDispatcher : public RenderViewObserver,
28 public blink::WebPushClient {
29 public:
30 explicit PushMessagingDispatcher(RenderViewImpl* render_view);
31 virtual ~PushMessagingDispatcher();
32
33 private:
34 // RenderView::Observer implementation.
35 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
36
37 // WebPushClient implementation.
38 virtual void registerPushMessaging(
39 const blink::WebString& sender_id,
40 blink::WebPushRegistrationCallbacks* callbacks) OVERRIDE;
41
42 void OnRegisterSuccess(int32 callbacks_id,
43 const GURL& endpoint,
44 const std::string& registration_id);
45
46 void OnRegisterError(int32 callbacks_id);
47
48 IDMap<blink::WebPushRegistrationCallbacks, IDMapOwnPointer>
49 registration_callbacks_;
50
51 DISALLOW_COPY_AND_ASSIGN(PushMessagingDispatcher);
52 };
53
54 } // namespace content
55
56 #endif // CONTENT_RENDERER_PUSH_MESSAGING_DISPATCHER_H_
OLDNEW
« 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