| 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 |
| 10 #include <memory> |
| 9 #include <string> | 11 #include <string> |
| 10 #include <vector> | 12 #include <vector> |
| 11 | 13 |
| 12 #include "base/id_map.h" | 14 #include "base/id_map.h" |
| 13 #include "base/macros.h" | 15 #include "base/macros.h" |
| 14 #include "content/public/common/push_messaging_status.h" | 16 #include "content/public/common/push_messaging_status.h" |
| 15 #include "content/public/renderer/render_frame_observer.h" | 17 #include "content/public/renderer/render_frame_observer.h" |
| 16 #include "third_party/WebKit/public/platform/modules/push_messaging/WebPushClien
t.h" | 18 #include "third_party/WebKit/public/platform/modules/push_messaging/WebPushClien
t.h" |
| 17 #include "third_party/WebKit/public/platform/modules/push_messaging/WebPushPermi
ssionStatus.h" | 19 #include "third_party/WebKit/public/platform/modules/push_messaging/WebPushPermi
ssionStatus.h" |
| 18 | 20 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 40 | 42 |
| 41 private: | 43 private: |
| 42 // RenderFrameObserver implementation. | 44 // RenderFrameObserver implementation. |
| 43 bool OnMessageReceived(const IPC::Message& message) override; | 45 bool OnMessageReceived(const IPC::Message& message) override; |
| 44 void OnDestruct() override; | 46 void OnDestruct() override; |
| 45 | 47 |
| 46 // WebPushClient implementation. | 48 // WebPushClient implementation. |
| 47 void subscribe( | 49 void subscribe( |
| 48 blink::WebServiceWorkerRegistration* service_worker_registration, | 50 blink::WebServiceWorkerRegistration* service_worker_registration, |
| 49 const blink::WebPushSubscriptionOptions& options, | 51 const blink::WebPushSubscriptionOptions& options, |
| 50 blink::WebPushSubscriptionCallbacks* callbacks) override; | 52 std::unique_ptr<blink::WebPushSubscriptionCallbacks> callbacks) override; |
| 51 | 53 |
| 52 void DidGetManifest( | 54 void DidGetManifest( |
| 53 blink::WebServiceWorkerRegistration* service_worker_registration, | 55 blink::WebServiceWorkerRegistration* service_worker_registration, |
| 54 const blink::WebPushSubscriptionOptions& options, | 56 const blink::WebPushSubscriptionOptions& options, |
| 55 blink::WebPushSubscriptionCallbacks* callbacks, | 57 std::unique_ptr<blink::WebPushSubscriptionCallbacks> callbacks, |
| 56 const GURL& manifest_url, | 58 const GURL& manifest_url, |
| 57 const Manifest& manifest, | 59 const Manifest& manifest, |
| 58 const ManifestDebugInfo&); | 60 const ManifestDebugInfo&); |
| 59 | 61 |
| 60 void DoSubscribe( | 62 void DoSubscribe( |
| 61 blink::WebServiceWorkerRegistration* service_worker_registration, | 63 blink::WebServiceWorkerRegistration* service_worker_registration, |
| 62 const PushSubscriptionOptions& options, | 64 const PushSubscriptionOptions& options, |
| 63 blink::WebPushSubscriptionCallbacks* callbacks); | 65 std::unique_ptr<blink::WebPushSubscriptionCallbacks> callbacks); |
| 64 | 66 |
| 65 void OnSubscribeFromDocumentSuccess(int32_t request_id, | 67 void OnSubscribeFromDocumentSuccess(int32_t request_id, |
| 66 const GURL& endpoint, | 68 const GURL& endpoint, |
| 67 const PushSubscriptionOptions& options, | 69 const PushSubscriptionOptions& options, |
| 68 const std::vector<uint8_t>& p256dh, | 70 const std::vector<uint8_t>& p256dh, |
| 69 const std::vector<uint8_t>& auth); | 71 const std::vector<uint8_t>& auth); |
| 70 | 72 |
| 71 void OnSubscribeFromDocumentError(int32_t request_id, | 73 void OnSubscribeFromDocumentError(int32_t request_id, |
| 72 PushRegistrationStatus status); | 74 PushRegistrationStatus status); |
| 73 | 75 |
| 74 IDMap<blink::WebPushSubscriptionCallbacks, IDMapOwnPointer> | 76 IDMap<blink::WebPushSubscriptionCallbacks, IDMapOwnPointer> |
| 75 subscription_callbacks_; | 77 subscription_callbacks_; |
| 76 | 78 |
| 77 DISALLOW_COPY_AND_ASSIGN(PushMessagingDispatcher); | 79 DISALLOW_COPY_AND_ASSIGN(PushMessagingDispatcher); |
| 78 }; | 80 }; |
| 79 | 81 |
| 80 } // namespace content | 82 } // namespace content |
| 81 | 83 |
| 82 #endif // CONTENT_RENDERER_PUSH_MESSAGING_PUSH_MESSAGING_DISPATCHER_H_ | 84 #endif // CONTENT_RENDERER_PUSH_MESSAGING_PUSH_MESSAGING_DISPATCHER_H_ |
| OLD | NEW |