OLD | NEW |
---|---|
(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 "ipc/ipc_message.h" | |
jochen (gone - plz use gerrit)
2014/04/08 07:42:18
can be forward declared?
Michael van Ouwerkerk
2014/04/08 13:27:00
Done.
| |
13 #include "third_party/WebKit/public/platform/WebPushClient.h" | |
14 #include "third_party/WebKit/public/platform/WebPushError.h" | |
jochen (gone - plz use gerrit)
2014/04/08 07:42:18
not needed in the header?
Michael van Ouwerkerk
2014/04/08 13:27:00
Done.
| |
15 #include "third_party/WebKit/public/platform/WebString.h" | |
jochen (gone - plz use gerrit)
2014/04/08 07:42:18
can be forward declared?
Michael van Ouwerkerk
2014/04/08 13:27:00
Done.
| |
16 #include "url/gurl.h" | |
jochen (gone - plz use gerrit)
2014/04/08 07:42:18
can be forward declared?
Michael van Ouwerkerk
2014/04/08 13:27:00
Done.
| |
17 | |
18 namespace content { | |
19 class RenderViewImpl; | |
20 | |
21 class PushMessagingDispatcher : public RenderViewObserver, | |
22 public blink::WebPushClient { | |
23 public: | |
24 explicit PushMessagingDispatcher(RenderViewImpl* render_view); | |
25 virtual ~PushMessagingDispatcher(); | |
26 | |
27 private: | |
28 // RenderView::Observer implementation. | |
29 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | |
30 | |
31 // WebPushClient implementation. | |
32 virtual void registerPushMessaging( | |
33 const blink::WebString& sender_id, | |
34 blink::WebPushRegistrationCallbacks* callbacks) OVERRIDE; | |
35 | |
36 void OnRegisterSuccess(int32 callbacks_id, | |
37 const GURL& endpoint, | |
38 const std::string& registration_id); | |
39 | |
40 void OnRegisterError(int32 callbacks_id); | |
41 | |
42 IDMap<blink::WebPushRegistrationCallbacks, IDMapOwnPointer> | |
43 registration_callbacks_; | |
44 | |
45 DISALLOW_COPY_AND_ASSIGN(PushMessagingDispatcher); | |
46 }; | |
47 | |
48 } // namespace content | |
49 | |
50 #endif // CONTENT_RENDERER_PUSH_MESSAGING_DISPATCHER_H_ | |
OLD | NEW |