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 PushManager_h | 5 #ifndef PushManager_h |
6 #define PushManager_h | 6 #define PushManager_h |
7 | 7 |
8 #include "modules/ModulesExport.h" | 8 #include "modules/ModulesExport.h" |
9 #include "platform/bindings/ScriptWrappable.h" | 9 #include "platform/bindings/ScriptWrappable.h" |
10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class ExceptionState; | 14 class ExceptionState; |
15 class PushSubscriptionOptionsInit; | 15 class PushSubscriptionOptionsInit; |
16 class ScriptPromise; | 16 class ScriptPromise; |
17 class ScriptState; | 17 class ScriptState; |
18 class ServiceWorkerRegistration; | 18 class ServiceWorkerRegistration; |
19 | 19 |
20 class MODULES_EXPORT PushManager final : public GarbageCollected<PushManager>, | 20 class MODULES_EXPORT PushManager final : public GarbageCollected<PushManager>, |
21 public ScriptWrappable { | 21 public ScriptWrappable { |
22 DEFINE_WRAPPERTYPEINFO(); | 22 DEFINE_WRAPPERTYPEINFO(); |
23 | 23 |
24 public: | 24 public: |
25 static PushManager* Create(ServiceWorkerRegistration* registration) { | 25 static PushManager* Create(ServiceWorkerRegistration* registration) { |
26 return new PushManager(registration); | 26 return new PushManager(registration); |
27 } | 27 } |
28 | 28 |
| 29 // Web-exposed property: |
| 30 static Vector<String> supportedContentEncodings(); |
| 31 |
| 32 // Web-exposed methods: |
29 ScriptPromise subscribe(ScriptState*, | 33 ScriptPromise subscribe(ScriptState*, |
30 const PushSubscriptionOptionsInit&, | 34 const PushSubscriptionOptionsInit&, |
31 ExceptionState&); | 35 ExceptionState&); |
32 ScriptPromise getSubscription(ScriptState*); | 36 ScriptPromise getSubscription(ScriptState*); |
33 ScriptPromise permissionState(ScriptState*, | 37 ScriptPromise permissionState(ScriptState*, |
34 const PushSubscriptionOptionsInit&, | 38 const PushSubscriptionOptionsInit&, |
35 ExceptionState&); | 39 ExceptionState&); |
36 | 40 |
37 DECLARE_TRACE(); | 41 DECLARE_TRACE(); |
38 | 42 |
39 private: | 43 private: |
40 explicit PushManager(ServiceWorkerRegistration*); | 44 explicit PushManager(ServiceWorkerRegistration*); |
41 | 45 |
42 Member<ServiceWorkerRegistration> registration_; | 46 Member<ServiceWorkerRegistration> registration_; |
43 }; | 47 }; |
44 | 48 |
45 } // namespace blink | 49 } // namespace blink |
46 | 50 |
47 #endif // PushManager_h | 51 #endif // PushManager_h |
OLD | NEW |