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