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

Side by Side Diff: content/renderer/push_messaging_dispatcher.h

Issue 661463002: Implement PushManager#hasPermission (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_RENDERER_PUSH_MESSAGING_DISPATCHER_H_ 5 #ifndef CONTENT_RENDERER_PUSH_MESSAGING_DISPATCHER_H_
6 #define CONTENT_RENDERER_PUSH_MESSAGING_DISPATCHER_H_ 6 #define CONTENT_RENDERER_PUSH_MESSAGING_DISPATCHER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/id_map.h" 10 #include "base/id_map.h"
11 #include "content/public/common/push_messaging_status.h" 11 #include "content/public/common/push_messaging_status.h"
12 #include "content/public/renderer/render_frame_observer.h" 12 #include "content/public/renderer/render_frame_observer.h"
13 #include "third_party/WebKit/public/platform/WebPushClient.h" 13 #include "third_party/WebKit/public/platform/WebPushClient.h"
14 #include "third_party/WebKit/public/platform/WebPushPermissionCallback.h"
14 15
15 class GURL; 16 class GURL;
16 17
17 namespace IPC { 18 namespace IPC {
18 class Message; 19 class Message;
19 } // namespace IPC 20 } // namespace IPC
20 21
21 namespace blink { 22 namespace blink {
23 class WebPushPermissionCallback;
Michael van Ouwerkerk 2014/10/20 16:30:08 No need as you already included it.
Miguel Garcia 2014/10/22 16:35:27 Done (as in I don't include it anymore)
22 class WebServiceWorkerProvider; 24 class WebServiceWorkerProvider;
23 class WebString; 25 class WebString;
24 } // namespace blink 26 } // namespace blink
25 27
26 namespace content { 28 namespace content {
27 29
28 struct Manifest; 30 struct Manifest;
29 31
30 class PushMessagingDispatcher : public RenderFrameObserver, 32 class PushMessagingDispatcher : public RenderFrameObserver,
31 public blink::WebPushClient { 33 public blink::WebPushClient {
32 public: 34 public:
33 explicit PushMessagingDispatcher(RenderFrame* render_frame); 35 explicit PushMessagingDispatcher(RenderFrame* render_frame);
34 virtual ~PushMessagingDispatcher(); 36 virtual ~PushMessagingDispatcher();
35 37
36 private: 38 private:
37 // RenderFrame::Observer implementation. 39 // RenderFrame::Observer implementation.
38 virtual bool OnMessageReceived(const IPC::Message& message) override; 40 virtual bool OnMessageReceived(const IPC::Message& message) override;
39 41
40 // WebPushClient implementation. 42 // WebPushClient implementation.
41 virtual void registerPushMessaging( 43 virtual void registerPushMessaging(
42 const blink::WebString& sender_id, 44 const blink::WebString& sender_id,
43 blink::WebPushRegistrationCallbacks* callbacks, 45 blink::WebPushRegistrationCallbacks* callbacks,
44 blink::WebServiceWorkerProvider* service_worker_provider); 46 blink::WebServiceWorkerProvider* service_worker_provider) /* override */;
Michael van Ouwerkerk 2014/10/20 16:30:08 Not sure what the common form is for indicating ov
Miguel Garcia 2014/10/22 16:35:27 So I would prefer to leave it uncommnented but tha
47
48 virtual void permissionStatus(
49 blink::WebPushPermissionCallback* callback,
50 blink::WebServiceWorkerProvider* service_worker_provider) /* override */;
45 51
46 void DoRegister(const std::string& sender_id, 52 void DoRegister(const std::string& sender_id,
47 blink::WebPushRegistrationCallbacks* callbacks, 53 blink::WebPushRegistrationCallbacks* callbacks,
48 blink::WebServiceWorkerProvider* service_worker_provider, 54 blink::WebServiceWorkerProvider* service_worker_provider,
49 const Manifest& manifest); 55 const Manifest& manifest);
50 56
51 void OnRegisterSuccess(int32 callbacks_id, 57 void OnRegisterSuccess(int32 callbacks_id,
52 const GURL& endpoint, 58 const GURL& endpoint,
53 const std::string& registration_id); 59 const std::string& registration_id);
54 60
55 void OnRegisterError(int32 callbacks_id, PushMessagingStatus status); 61 void OnRegisterError(int32 callbacks_id, PushMessagingStatus status);
56 62
63 void OnPermissionStatus(
64 int32 callback_id,
65 blink::WebPushPermissionCallback::PushPermissionStatus);
66
67
57 IDMap<blink::WebPushRegistrationCallbacks, IDMapOwnPointer> 68 IDMap<blink::WebPushRegistrationCallbacks, IDMapOwnPointer>
58 registration_callbacks_; 69 registration_callbacks_;
70 IDMap<blink::WebPushPermissionCallback, IDMapOwnPointer>
71 permission_check_callbacks_;
72
59 73
60 DISALLOW_COPY_AND_ASSIGN(PushMessagingDispatcher); 74 DISALLOW_COPY_AND_ASSIGN(PushMessagingDispatcher);
61 }; 75 };
62 76
63 } // namespace content 77 } // namespace content
64 78
65 #endif // CONTENT_RENDERER_PUSH_MESSAGING_DISPATCHER_H_ 79 #endif // CONTENT_RENDERER_PUSH_MESSAGING_DISPATCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698