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 PaymentAppManager_h | 5 #ifndef PaymentManager_h |
6 #define PaymentAppManager_h | 6 #define PaymentManager_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
9 #include "bindings/core/v8/ScriptWrappable.h" | 9 #include "bindings/core/v8/ScriptWrappable.h" |
10 #include "components/payments/content/payment_app.mojom-blink.h" | 10 #include "components/payments/content/payment_app.mojom-blink.h" |
11 #include "modules/ModulesExport.h" | 11 #include "modules/ModulesExport.h" |
12 #include "platform/heap/Handle.h" | 12 #include "platform/heap/Handle.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 class PaymentAppManifest; | 16 class PaymentAppManifest; |
17 class ScriptPromiseResolver; | 17 class ScriptPromiseResolver; |
18 class ScriptState; | 18 class ScriptState; |
19 class ServiceWorkerRegistration; | 19 class ServiceWorkerRegistration; |
20 | 20 |
21 class MODULES_EXPORT PaymentAppManager final | 21 class MODULES_EXPORT PaymentManager final |
22 : public GarbageCollectedFinalized<PaymentAppManager>, | 22 : public GarbageCollectedFinalized<PaymentManager>, |
23 public ScriptWrappable { | 23 public ScriptWrappable { |
24 DEFINE_WRAPPERTYPEINFO(); | 24 DEFINE_WRAPPERTYPEINFO(); |
25 WTF_MAKE_NONCOPYABLE(PaymentAppManager); | 25 WTF_MAKE_NONCOPYABLE(PaymentManager); |
26 | 26 |
27 public: | 27 public: |
28 static PaymentAppManager* create(ServiceWorkerRegistration*); | 28 static PaymentManager* create(ServiceWorkerRegistration*); |
29 | 29 |
30 ScriptPromise setManifest(ScriptState*, const PaymentAppManifest&); | 30 ScriptPromise setManifest(ScriptState*, const PaymentAppManifest&); |
31 ScriptPromise getManifest(ScriptState*); | 31 ScriptPromise getManifest(ScriptState*); |
32 | 32 |
33 DECLARE_TRACE(); | 33 DECLARE_TRACE(); |
34 | 34 |
35 private: | 35 private: |
36 explicit PaymentAppManager(ServiceWorkerRegistration*); | 36 explicit PaymentManager(ServiceWorkerRegistration*); |
37 | 37 |
38 void onSetManifest(ScriptPromiseResolver*, | 38 void onSetManifest(ScriptPromiseResolver*, |
39 payments::mojom::blink::PaymentAppManifestError); | 39 payments::mojom::blink::PaymentAppManifestError); |
40 void onGetManifest(ScriptPromiseResolver*, | 40 void onGetManifest(ScriptPromiseResolver*, |
41 payments::mojom::blink::PaymentAppManifestPtr, | 41 payments::mojom::blink::PaymentAppManifestPtr, |
42 payments::mojom::blink::PaymentAppManifestError); | 42 payments::mojom::blink::PaymentAppManifestError); |
43 void onServiceConnectionError(); | 43 void onServiceConnectionError(); |
44 | 44 |
45 Member<ServiceWorkerRegistration> m_registration; | 45 Member<ServiceWorkerRegistration> m_registration; |
46 payments::mojom::blink::PaymentAppManagerPtr m_manager; | 46 payments::mojom::blink::PaymentManagerPtr m_manager; |
47 }; | 47 }; |
48 | 48 |
49 } // namespace blink | 49 } // namespace blink |
50 | 50 |
51 #endif // PaymentAppManager_h | 51 #endif // PaymentManager_h |
OLD | NEW |