OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 PaymentManager_h | 5 #ifndef PaymentManager_h |
6 #define PaymentManager_h | 6 #define PaymentManager_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
9 #include "modules/ModulesExport.h" | 9 #include "modules/ModulesExport.h" |
10 #include "platform/bindings/ScriptWrappable.h" | 10 #include "platform/bindings/ScriptWrappable.h" |
11 #include "platform/heap/Handle.h" | 11 #include "platform/heap/Handle.h" |
12 #include "public/platform/modules/payments/payment_app.mojom-blink.h" | 12 #include "public/platform/modules/payments/payment_app.mojom-blink.h" |
13 #include "public/platform/modules/permissions/permission.mojom-blink.h" | |
13 | 14 |
14 namespace blink { | 15 namespace blink { |
15 | 16 |
16 class PaymentInstruments; | 17 class PaymentInstruments; |
18 class ScriptPromiseResolver; | |
17 class ServiceWorkerRegistration; | 19 class ServiceWorkerRegistration; |
18 | 20 |
19 class MODULES_EXPORT PaymentManager final | 21 class MODULES_EXPORT PaymentManager final |
20 : public GarbageCollectedFinalized<PaymentManager>, | 22 : public GarbageCollectedFinalized<PaymentManager>, |
21 public ScriptWrappable { | 23 public ScriptWrappable { |
22 DEFINE_WRAPPERTYPEINFO(); | 24 DEFINE_WRAPPERTYPEINFO(); |
23 WTF_MAKE_NONCOPYABLE(PaymentManager); | 25 WTF_MAKE_NONCOPYABLE(PaymentManager); |
24 | 26 |
25 public: | 27 public: |
26 static PaymentManager* Create(ServiceWorkerRegistration*); | 28 static PaymentManager* Create(ServiceWorkerRegistration*); |
27 | 29 |
28 PaymentInstruments* instruments(); | 30 PaymentInstruments* instruments(); |
31 ScriptPromise requestPermission(ScriptState*); | |
29 | 32 |
30 DECLARE_TRACE(); | 33 DECLARE_TRACE(); |
31 | 34 |
32 private: | 35 private: |
33 explicit PaymentManager(ServiceWorkerRegistration*); | 36 explicit PaymentManager(ServiceWorkerRegistration*); |
34 | 37 |
38 // For PaymentManager service | |
please use gerrit instead
2017/06/20 13:28:09
Should this comment be for the next method?
zino
2017/06/22 17:26:47
Done.
| |
35 void OnServiceConnectionError(); | 39 void OnServiceConnectionError(); |
36 | 40 |
41 void OnPermissionRequestComplete(ScriptPromiseResolver*, | |
42 mojom::blink::PermissionStatus); | |
43 void OnPermissionServiceConnectionError(); | |
44 | |
37 Member<ServiceWorkerRegistration> registration_; | 45 Member<ServiceWorkerRegistration> registration_; |
38 payments::mojom::blink::PaymentManagerPtr manager_; | 46 payments::mojom::blink::PaymentManagerPtr manager_; |
47 mojom::blink::PermissionServicePtr permission_service_; | |
39 Member<PaymentInstruments> instruments_; | 48 Member<PaymentInstruments> instruments_; |
40 }; | 49 }; |
41 | 50 |
42 } // namespace blink | 51 } // namespace blink |
43 | 52 |
44 #endif // PaymentManager_h | 53 #endif // PaymentManager_h |
OLD | NEW |