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