Chromium Code Reviews| 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/WebCommon.h" | 9 #include "public/platform/WebCommon.h" |
| 10 #include "public/platform/WebPushPermissionStatus.h" | 10 #include "public/platform/WebPushPermissionStatus.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 class WebServiceWorkerRegistration; | 14 class WebServiceWorkerRegistration; |
| 15 struct WebPushError; | 15 struct WebPushError; |
| 16 struct WebPushRegistration; | 16 struct WebPushSubscription; |
| 17 | 17 |
| 18 typedef WebCallbacks<WebPushRegistration, WebPushError> WebPushRegistrationCallb acks; | 18 using WebPushSubscriptionCallbacks = WebCallbacks<WebPushSubscription, WebPushEr ror>; |
|
Peter Beverloo
2015/01/09 16:33:09
+FIXMEs
Michael van Ouwerkerk
2015/01/09 17:11:39
Done.
| |
| 19 typedef WebCallbacks<WebPushPermissionStatus, void> WebPushPermissionStatusCallb acks; | 19 using WebPushRegistrationCallbacks = WebPushSubscriptionCallbacks; |
| 20 typedef WebCallbacks<bool, WebPushError> WebPushUnregisterCallbacks; | 20 using WebPushPermissionStatusCallbacks = WebCallbacks<WebPushPermissionStatus, v oid>; |
| 21 using WebPushUnsubscribeCallbacks = WebCallbacks<bool, WebPushError>; | |
| 22 using WebPushUnregisterCallbacks = WebPushUnsubscribeCallbacks; | |
| 21 | 23 |
| 22 class WebPushProvider { | 24 class WebPushProvider { |
| 23 public: | 25 public: |
| 24 virtual ~WebPushProvider() { } | 26 virtual ~WebPushProvider() { } |
| 25 | 27 |
| 26 // Takes ownership of the WebPushRegistrationCallbacks. | 28 // Takes ownership of the WebPushRegistrationCallbacks. |
| 27 // Does not take ownership of the WebServiceWorkerRegistration. | 29 // Does not take ownership of the WebServiceWorkerRegistration. |
| 28 virtual void registerPushMessaging(WebServiceWorkerRegistration*, WebPushReg istrationCallbacks*) { BLINK_ASSERT_NOT_REACHED(); } | 30 virtual void registerPushMessaging(WebServiceWorkerRegistration*, WebPushReg istrationCallbacks*) { BLINK_ASSERT_NOT_REACHED(); } |
| 29 | 31 |
| 30 // Takes ownership of the WebPushRegistrationCallbacks. | 32 // Takes ownership of the WebPushRegistrationCallbacks. |
| 31 // Does not take ownership of the WebServiceWorkerRegistration. | 33 // Does not take ownership of the WebServiceWorkerRegistration. |
| 32 virtual void getRegistration(WebServiceWorkerRegistration*, WebPushRegistrat ionCallbacks*) { BLINK_ASSERT_NOT_REACHED(); } | 34 virtual void getRegistration(WebServiceWorkerRegistration*, WebPushRegistrat ionCallbacks*) { BLINK_ASSERT_NOT_REACHED(); } |
| 33 | 35 |
| 34 // Takes ownership of the WebPushPermissionStatusCallbacks. | 36 // Takes ownership of the WebPushPermissionStatusCallbacks. |
| 35 // Does not take ownership of the WebServiceWorkerRegistration. | 37 // Does not take ownership of the WebServiceWorkerRegistration. |
| 36 virtual void getPermissionStatus(WebServiceWorkerRegistration*, WebPushPermi ssionStatusCallbacks*) { BLINK_ASSERT_NOT_REACHED(); } | 38 virtual void getPermissionStatus(WebServiceWorkerRegistration*, WebPushPermi ssionStatusCallbacks*) { BLINK_ASSERT_NOT_REACHED(); } |
| 37 | 39 |
| 38 // Takes ownership if the WebPushUnregisterCallbacks. | 40 // Takes ownership if the WebPushUnregisterCallbacks. |
| 39 // Does not take ownership of the WebServiceWorkerRegistration. | 41 // Does not take ownership of the WebServiceWorkerRegistration. |
| 40 virtual void unregister(WebServiceWorkerRegistration*, WebPushUnregisterCall backs* callback) { BLINK_ASSERT_NOT_REACHED(); } | 42 virtual void unregister(WebServiceWorkerRegistration*, WebPushUnregisterCall backs* callback) { BLINK_ASSERT_NOT_REACHED(); } |
| 41 }; | 43 }; |
| 42 | 44 |
| 43 } // namespace blink | 45 } // namespace blink |
| 44 | 46 |
| 45 #endif // WebPushProvider_h | 47 #endif // WebPushProvider_h |
| OLD | NEW |