| 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 WebSecurityOrigin; | 18 class WebSecurityOrigin; |
| 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 WebSecurityOrigin&, const WebNotificationData&, WebN
otificationDelegate*) = 0; | 37 virtual void show(const WebSecurityOrigin&, const WebNotificationData&, WebN
otificationDelegate*) = 0; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 61 virtual WebNotificationPermission checkPermission(const WebSecurityOrigin&)
= 0; | 60 virtual WebNotificationPermission checkPermission(const WebSecurityOrigin&)
= 0; |
| 62 | 61 |
| 63 // Returns the maximum number of actions supported by the embedder. | 62 // Returns the maximum number of actions supported by the embedder. |
| 64 // TODO(johnme): Make pure virtual. | 63 // TODO(johnme): Make pure virtual. |
| 65 virtual size_t maxActions() { return 0; } | 64 virtual size_t maxActions() { return 0; } |
| 66 }; | 65 }; |
| 67 | 66 |
| 68 } // namespace blink | 67 } // namespace blink |
| 69 | 68 |
| 70 #endif // WebNotificationManager_h | 69 #endif // WebNotificationManager_h |
| OLD | NEW |