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

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: 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
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/common/push_messaging_status.h"
12 #include "content/public/renderer/render_view_observer.h"
13 #include "third_party/WebKit/public/platform/WebPushClient.h"
14 #include "third_party/WebKit/public/platform/WebPushError.h"
15 #include "third_party/WebKit/public/platform/WebString.h"
16
Peter Beverloo 2014/04/01 14:53:18 +#include "ipc/ipc_message.h"
Michael van Ouwerkerk 2014/04/02 14:25:15 Done.
17 namespace content {
18 class RenderViewImpl;
19
20 class PushMessagingDispatcher : public RenderViewObserver,
21 public blink::WebPushClient {
22 public:
23 explicit PushMessagingDispatcher(RenderViewImpl* render_view);
24 virtual ~PushMessagingDispatcher();
25
26 private:
27 // RenderView::Observer implementation.
28 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
29
30 // WebPushClient implementation.
31 virtual void registerPushMessaging(
32 const blink::WebString& sender_id,
33 blink::WebPushRegistrationCallbacks* callbacks) OVERRIDE;
34
35 void OnRegisterSuccess(int32 callbacks_id,
36 const std::string& endpoint,
37 const std::string& registration_id);
38
39 void OnRegisterError(int32 callbacks_id, PushMessagingStatus status);
40
41 IDMap<blink::WebPushRegistrationCallbacks, IDMapOwnPointer>
42 registration_callbacks_;
43
44 DISALLOW_COPY_AND_ASSIGN(PushMessagingDispatcher);
45 };
46
47 } // namespace content
48
49 #endif // CONTENT_RENDERER_PUSH_MESSAGING_DISPATCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698