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