| 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 WebNotificationManager_h | 5 #ifndef WebNotificationManager_h |
| 6 #define WebNotificationManager_h | 6 #define WebNotificationManager_h |
| 7 | 7 |
| 8 #include "public/platform/WebCallbacks.h" | 8 #include "public/platform/WebCallbacks.h" |
| 9 #include "public/platform/WebPassOwnPtr.h" | |
| 10 #include "public/platform/WebString.h" | 9 #include "public/platform/WebString.h" |
| 11 #include "public/platform/WebVector.h" | 10 #include "public/platform/WebVector.h" |
| 12 #include "public/platform/modules/notifications/WebNotificationData.h" | 11 #include "public/platform/modules/notifications/WebNotificationData.h" |
| 13 #include "public/platform/modules/notifications/WebNotificationPermission.h" | 12 #include "public/platform/modules/notifications/WebNotificationPermission.h" |
| 14 #include <stdint.h> | 13 #include <stdint.h> |
| 15 | 14 |
| 16 namespace blink { | 15 namespace blink { |
| 17 | 16 |
| 18 class WebNotificationDelegate; | 17 class WebNotificationDelegate; |
| 19 class WebSerializedOrigin; | 18 class WebSerializedOrigin; |
| 20 class WebServiceWorkerRegistration; | 19 class WebServiceWorkerRegistration; |
| 21 | 20 |
| 22 // Structure representing the info associated with a persistent notification. | 21 // Structure representing the info associated with a persistent notification. |
| 23 struct WebPersistentNotificationInfo { | 22 struct WebPersistentNotificationInfo { |
| 24 int64_t persistentId = 0; | 23 int64_t persistentId = 0; |
| 25 WebNotificationData data; | 24 WebNotificationData data; |
| 26 }; | 25 }; |
| 27 | 26 |
| 28 using WebNotificationGetCallbacks = WebCallbacks<WebPassOwnPtr<WebVector<WebPers
istentNotificationInfo>>, void>; | 27 using WebNotificationGetCallbacks = WebCallbacks<const WebVector<WebPersistentNo
tificationInfo>&, void>; |
| 29 using WebNotificationShowCallbacks = WebCallbacks<void, void>; | 28 using WebNotificationShowCallbacks = WebCallbacks<void, void>; |
| 30 | 29 |
| 31 // Provides the services to show platform notifications to the user. | 30 // Provides the services to show platform notifications to the user. |
| 32 class WebNotificationManager { | 31 class WebNotificationManager { |
| 33 public: | 32 public: |
| 34 virtual ~WebNotificationManager() { } | 33 virtual ~WebNotificationManager() { } |
| 35 | 34 |
| 36 // Shows a page notification on the user's system. These notifications will
have their | 35 // Shows a page notification on the user's system. These notifications will
have their |
| 37 // events delivered to the delegate specified in this call. | 36 // events delivered to the delegate specified in this call. |
| 38 virtual void show(const WebSerializedOrigin&, const WebNotificationData&, We
bNotificationDelegate*) = 0; | 37 virtual void show(const WebSerializedOrigin&, const WebNotificationData&, We
bNotificationDelegate*) = 0; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 57 // be used by the embedder to dispatch events. | 56 // be used by the embedder to dispatch events. |
| 58 virtual void notifyDelegateDestroyed(WebNotificationDelegate*) = 0; | 57 virtual void notifyDelegateDestroyed(WebNotificationDelegate*) = 0; |
| 59 | 58 |
| 60 // Synchronously checks the permission level for the given origin. | 59 // Synchronously checks the permission level for the given origin. |
| 61 virtual WebNotificationPermission checkPermission(const WebSerializedOrigin&
) = 0; | 60 virtual WebNotificationPermission checkPermission(const WebSerializedOrigin&
) = 0; |
| 62 }; | 61 }; |
| 63 | 62 |
| 64 } // namespace blink | 63 } // namespace blink |
| 65 | 64 |
| 66 #endif // WebNotificationManager_h | 65 #endif // WebNotificationManager_h |
| OLD | NEW |