| OLD | NEW |
| 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_PUSH_MESSAGING_DISPATCHER_H_ | 5 #ifndef CONTENT_RENDERER_PUSH_MESSAGING_PUSH_MESSAGING_DISPATCHER_H_ |
| 6 #define CONTENT_RENDERER_PUSH_MESSAGING_PUSH_MESSAGING_DISPATCHER_H_ | 6 #define CONTENT_RENDERER_PUSH_MESSAGING_PUSH_MESSAGING_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 struct WebPushSubscriptionOptions; | 22 struct WebPushSubscriptionOptions; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace IPC { | 25 namespace IPC { |
| 26 class Message; | 26 class Message; |
| 27 } // namespace IPC | 27 } // namespace IPC |
| 28 | 28 |
| 29 namespace content { | 29 namespace content { |
| 30 | 30 |
| 31 struct Manifest; | 31 struct Manifest; |
| 32 struct ManifestDebugInfo; |
| 32 struct PushSubscriptionOptions; | 33 struct PushSubscriptionOptions; |
| 33 | 34 |
| 34 class PushMessagingDispatcher : public RenderFrameObserver, | 35 class PushMessagingDispatcher : public RenderFrameObserver, |
| 35 public blink::WebPushClient { | 36 public blink::WebPushClient { |
| 36 public: | 37 public: |
| 37 explicit PushMessagingDispatcher(RenderFrame* render_frame); | 38 explicit PushMessagingDispatcher(RenderFrame* render_frame); |
| 38 ~PushMessagingDispatcher() override; | 39 ~PushMessagingDispatcher() override; |
| 39 | 40 |
| 40 private: | 41 private: |
| 41 // RenderFrame::Observer implementation. | 42 // RenderFrame::Observer implementation. |
| 42 bool OnMessageReceived(const IPC::Message& message) override; | 43 bool OnMessageReceived(const IPC::Message& message) override; |
| 43 | 44 |
| 44 // WebPushClient implementation. | 45 // WebPushClient implementation. |
| 45 void subscribe( | 46 void subscribe( |
| 46 blink::WebServiceWorkerRegistration* service_worker_registration, | 47 blink::WebServiceWorkerRegistration* service_worker_registration, |
| 47 const blink::WebPushSubscriptionOptions& options, | 48 const blink::WebPushSubscriptionOptions& options, |
| 48 blink::WebPushSubscriptionCallbacks* callbacks) override; | 49 blink::WebPushSubscriptionCallbacks* callbacks) override; |
| 49 | 50 |
| 50 void DidGetManifest( | 51 void DidGetManifest( |
| 51 blink::WebServiceWorkerRegistration* service_worker_registration, | 52 blink::WebServiceWorkerRegistration* service_worker_registration, |
| 52 const blink::WebPushSubscriptionOptions& options, | 53 const blink::WebPushSubscriptionOptions& options, |
| 53 blink::WebPushSubscriptionCallbacks* callbacks, | 54 blink::WebPushSubscriptionCallbacks* callbacks, |
| 54 const Manifest& manifest); | 55 const Manifest& manifest, |
| 56 const ManifestDebugInfo&); |
| 55 | 57 |
| 56 void DoSubscribe( | 58 void DoSubscribe( |
| 57 blink::WebServiceWorkerRegistration* service_worker_registration, | 59 blink::WebServiceWorkerRegistration* service_worker_registration, |
| 58 const PushSubscriptionOptions& options, | 60 const PushSubscriptionOptions& options, |
| 59 blink::WebPushSubscriptionCallbacks* callbacks); | 61 blink::WebPushSubscriptionCallbacks* callbacks); |
| 60 | 62 |
| 61 void OnSubscribeFromDocumentSuccess(int32_t request_id, | 63 void OnSubscribeFromDocumentSuccess(int32_t request_id, |
| 62 const GURL& endpoint, | 64 const GURL& endpoint, |
| 63 const std::vector<uint8_t>& p256dh, | 65 const std::vector<uint8_t>& p256dh, |
| 64 const std::vector<uint8_t>& auth); | 66 const std::vector<uint8_t>& auth); |
| 65 | 67 |
| 66 void OnSubscribeFromDocumentError(int32_t request_id, | 68 void OnSubscribeFromDocumentError(int32_t request_id, |
| 67 PushRegistrationStatus status); | 69 PushRegistrationStatus status); |
| 68 | 70 |
| 69 IDMap<blink::WebPushSubscriptionCallbacks, IDMapOwnPointer> | 71 IDMap<blink::WebPushSubscriptionCallbacks, IDMapOwnPointer> |
| 70 subscription_callbacks_; | 72 subscription_callbacks_; |
| 71 | 73 |
| 72 DISALLOW_COPY_AND_ASSIGN(PushMessagingDispatcher); | 74 DISALLOW_COPY_AND_ASSIGN(PushMessagingDispatcher); |
| 73 }; | 75 }; |
| 74 | 76 |
| 75 } // namespace content | 77 } // namespace content |
| 76 | 78 |
| 77 #endif // CONTENT_RENDERER_PUSH_MESSAGING_PUSH_MESSAGING_DISPATCHER_H_ | 79 #endif // CONTENT_RENDERER_PUSH_MESSAGING_PUSH_MESSAGING_DISPATCHER_H_ |
| OLD | NEW |