| 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 WebPushProvider_h | 5 #ifndef WebPushProvider_h |
| 6 #define WebPushProvider_h | 6 #define WebPushProvider_h |
| 7 | 7 |
| 8 #include "public/platform/WebCallbacks.h" | 8 #include "public/platform/WebCallbacks.h" |
| 9 #include "public/platform/modules/push_messaging/WebPushPermissionStatus.h" | 9 #include "public/platform/modules/push_messaging/WebPushPermissionStatus.h" |
| 10 #include "public/platform/modules/push_messaging/WebPushSubscription.h" | 10 #include "public/platform/modules/push_messaging/WebPushSubscription.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 using WebPushUnsubscribeCallbacks = WebCallbacks<bool, const WebPushError&>; | 24 using WebPushUnsubscribeCallbacks = WebCallbacks<bool, const WebPushError&>; |
| 25 | 25 |
| 26 class WebPushProvider { | 26 class WebPushProvider { |
| 27 public: | 27 public: |
| 28 virtual ~WebPushProvider() {} | 28 virtual ~WebPushProvider() {} |
| 29 | 29 |
| 30 // Takes ownership of the WebPushSubscriptionCallbacks. | 30 // Takes ownership of the WebPushSubscriptionCallbacks. |
| 31 // Does not take ownership of the WebServiceWorkerRegistration. | 31 // Does not take ownership of the WebServiceWorkerRegistration. |
| 32 virtual void Subscribe(WebServiceWorkerRegistration*, | 32 virtual void Subscribe(WebServiceWorkerRegistration*, |
| 33 const WebPushSubscriptionOptions&, | 33 const WebPushSubscriptionOptions&, |
| 34 bool user_gesture, |
| 34 std::unique_ptr<WebPushSubscriptionCallbacks>) = 0; | 35 std::unique_ptr<WebPushSubscriptionCallbacks>) = 0; |
| 35 | 36 |
| 36 // Takes ownership of the WebPushSubscriptionCallbacks. | 37 // Takes ownership of the WebPushSubscriptionCallbacks. |
| 37 // Does not take ownership of the WebServiceWorkerRegistration. | 38 // Does not take ownership of the WebServiceWorkerRegistration. |
| 38 virtual void GetSubscription( | 39 virtual void GetSubscription( |
| 39 WebServiceWorkerRegistration*, | 40 WebServiceWorkerRegistration*, |
| 40 std::unique_ptr<WebPushSubscriptionCallbacks>) = 0; | 41 std::unique_ptr<WebPushSubscriptionCallbacks>) = 0; |
| 41 | 42 |
| 42 // Takes ownership of the WebPushPermissionStatusCallbacks. | 43 // Takes ownership of the WebPushPermissionStatusCallbacks. |
| 43 // Does not take ownership of the WebServiceWorkerRegistration. | 44 // Does not take ownership of the WebServiceWorkerRegistration. |
| 44 virtual void GetPermissionStatus( | 45 virtual void GetPermissionStatus( |
| 45 WebServiceWorkerRegistration*, | 46 WebServiceWorkerRegistration*, |
| 46 const WebPushSubscriptionOptions&, | 47 const WebPushSubscriptionOptions&, |
| 47 std::unique_ptr<WebPushPermissionStatusCallbacks>) = 0; | 48 std::unique_ptr<WebPushPermissionStatusCallbacks>) = 0; |
| 48 | 49 |
| 49 // Takes ownership if the WebPushUnsubscribeCallbacks. | 50 // Takes ownership if the WebPushUnsubscribeCallbacks. |
| 50 // Does not take ownership of the WebServiceWorkerRegistration. | 51 // Does not take ownership of the WebServiceWorkerRegistration. |
| 51 virtual void Unsubscribe(WebServiceWorkerRegistration*, | 52 virtual void Unsubscribe(WebServiceWorkerRegistration*, |
| 52 std::unique_ptr<WebPushUnsubscribeCallbacks>) = 0; | 53 std::unique_ptr<WebPushUnsubscribeCallbacks>) = 0; |
| 53 }; | 54 }; |
| 54 | 55 |
| 55 } // namespace blink | 56 } // namespace blink |
| 56 | 57 |
| 57 #endif // WebPushProvider_h | 58 #endif // WebPushProvider_h |
| OLD | NEW |