| 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_CHILD_PUSH_MESSAGING_PUSH_PROVIDER_H_ | 5 #ifndef CONTENT_CHILD_PUSH_MESSAGING_PUSH_PROVIDER_H_ |
| 6 #define CONTENT_CHILD_PUSH_MESSAGING_PUSH_PROVIDER_H_ | 6 #define CONTENT_CHILD_PUSH_MESSAGING_PUSH_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 const blink::WebPushSubscriptionOptions& options, | 60 const blink::WebPushSubscriptionOptions& options, |
| 61 std::unique_ptr<blink::WebPushPermissionStatusCallbacks> callbacks) | 61 std::unique_ptr<blink::WebPushPermissionStatusCallbacks> callbacks) |
| 62 override; | 62 override; |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 explicit PushProvider(const scoped_refptr<base::SingleThreadTaskRunner>& | 65 explicit PushProvider(const scoped_refptr<base::SingleThreadTaskRunner>& |
| 66 main_thread_task_runner); | 66 main_thread_task_runner); |
| 67 | 67 |
| 68 static void GetInterface(mojom::PushMessagingRequest request); | 68 static void GetInterface(mojom::PushMessagingRequest request); |
| 69 | 69 |
| 70 void SubscribeCallback( | 70 void DidSubscribe( |
| 71 std::unique_ptr<blink::WebPushSubscriptionCallbacks> callbacks, | 71 std::unique_ptr<blink::WebPushSubscriptionCallbacks> callbacks, |
| 72 content::PushRegistrationStatus status, | 72 content::PushRegistrationStatus status, |
| 73 const base::Optional<GURL>& endpoint, | 73 const base::Optional<GURL>& endpoint, |
| 74 const base::Optional<content::PushSubscriptionOptions>& options, | 74 const base::Optional<content::PushSubscriptionOptions>& options, |
| 75 const base::Optional<std::vector<uint8_t>>& p256dh, | 75 const base::Optional<std::vector<uint8_t>>& p256dh, |
| 76 const base::Optional<std::vector<uint8_t>>& auth); | 76 const base::Optional<std::vector<uint8_t>>& auth); |
| 77 | 77 |
| 78 void UnsubscribeCallback( | 78 void DidUnsubscribe( |
| 79 std::unique_ptr<blink::WebPushUnsubscribeCallbacks> callbacks, | 79 std::unique_ptr<blink::WebPushUnsubscribeCallbacks> callbacks, |
| 80 bool is_success, | 80 bool is_success, |
| 81 bool did_unsubscribe, | 81 bool did_unsubscribe, |
| 82 blink::WebPushError::ErrorType error_type, | 82 blink::WebPushError::ErrorType error_type, |
| 83 const base::Optional<std::string>& error_message); | 83 const base::Optional<std::string>& error_message); |
| 84 | 84 |
| 85 void GetSubscriptionCallback( | 85 void DidGetSubscription( |
| 86 std::unique_ptr<blink::WebPushSubscriptionCallbacks> callbacks, | 86 std::unique_ptr<blink::WebPushSubscriptionCallbacks> callbacks, |
| 87 content::PushGetRegistrationStatus status, | 87 content::PushGetRegistrationStatus status, |
| 88 const base::Optional<GURL>& endpoint, | 88 const base::Optional<GURL>& endpoint, |
| 89 const base::Optional<content::PushSubscriptionOptions>& options, | 89 const base::Optional<content::PushSubscriptionOptions>& options, |
| 90 const base::Optional<std::vector<uint8_t>>& p256dh, | 90 const base::Optional<std::vector<uint8_t>>& p256dh, |
| 91 const base::Optional<std::vector<uint8_t>>& auth); | 91 const base::Optional<std::vector<uint8_t>>& auth); |
| 92 | 92 |
| 93 void GetPermissionStatusCallback( | 93 void DidGetPermissionStatus( |
| 94 std::unique_ptr<blink::WebPushPermissionStatusCallbacks> callbacks, | 94 std::unique_ptr<blink::WebPushPermissionStatusCallbacks> callbacks, |
| 95 bool is_success, | 95 bool is_success, |
| 96 blink::WebPushPermissionStatus status, | 96 blink::WebPushPermissionStatus status, |
| 97 blink::WebPushError::ErrorType error); | 97 blink::WebPushError::ErrorType error); |
| 98 | 98 |
| 99 mojom::PushMessagingPtr push_messaging_manager_; | 99 mojom::PushMessagingPtr push_messaging_manager_; |
| 100 | 100 |
| 101 DISALLOW_COPY_AND_ASSIGN(PushProvider); | 101 DISALLOW_COPY_AND_ASSIGN(PushProvider); |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 } // namespace content | 104 } // namespace content |
| 105 | 105 |
| 106 #endif // CONTENT_CHILD_PUSH_MESSAGING_PUSH_PROVIDER_H_ | 106 #endif // CONTENT_CHILD_PUSH_MESSAGING_PUSH_PROVIDER_H_ |
| OLD | NEW |