| Index: third_party/WebKit/Source/modules/payments/PaymentRequest.h
|
| diff --git a/third_party/WebKit/Source/modules/payments/PaymentRequest.h b/third_party/WebKit/Source/modules/payments/PaymentRequest.h
|
| index 2e07114bd25b6b2d33220c40dd4372167f3918cd..3a69e8a05ae22a23ec8aef8d006dade442285a78 100644
|
| --- a/third_party/WebKit/Source/modules/payments/PaymentRequest.h
|
| +++ b/third_party/WebKit/Source/modules/payments/PaymentRequest.h
|
| @@ -11,7 +11,9 @@
|
| #include "core/events/EventTarget.h"
|
| #include "modules/payments/PaymentDetails.h"
|
| #include "modules/payments/PaymentOptions.h"
|
| +#include "mojo/public/cpp/bindings/binding.h"
|
| #include "platform/heap/Handle.h"
|
| +#include "public/platform/modules/payments/payment_request.mojom-blink.h"
|
| #include "wtf/Noncopyable.h"
|
| #include "wtf/RefPtr.h"
|
| #include "wtf/Vector.h"
|
| @@ -20,10 +22,11 @@
|
| namespace blink {
|
|
|
| class ExceptionState;
|
| +class ScriptPromiseResolver;
|
| class ScriptState;
|
| class ShippingAddress;
|
|
|
| -class PaymentRequest final : public RefCountedGarbageCollectedEventTargetWithInlineData<PaymentRequest> {
|
| +class PaymentRequest final : public RefCountedGarbageCollectedEventTargetWithInlineData<PaymentRequest>, mojom::blink::PaymentRequestClient {
|
| REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(PaymentRequest);
|
| DEFINE_WRAPPERTYPEINFO();
|
| WTF_MAKE_NONCOPYABLE(PaymentRequest);
|
| @@ -36,7 +39,7 @@ public:
|
| virtual ~PaymentRequest();
|
|
|
| ScriptPromise show(ScriptState*);
|
| - void abort();
|
| + void abort(ExceptionState&);
|
|
|
| ShippingAddress* getShippingAddress() const { return m_shippingAddress.get(); }
|
| const String& shippingOption() const { return m_shippingOption; }
|
| @@ -48,11 +51,20 @@ public:
|
| const AtomicString& interfaceName() const override;
|
| ExecutionContext* getExecutionContext() const override;
|
|
|
| + ScriptPromise complete(ScriptState*, bool success);
|
| +
|
| DECLARE_TRACE();
|
|
|
| private:
|
| PaymentRequest(ScriptState*, const Vector<String>& supportedMethods, const PaymentDetails&, const PaymentOptions&, const ScriptValue& data, ExceptionState&);
|
|
|
| + // mojom::blink::PaymentRequestClient
|
| + void OnShippingAddressChange(mojom::blink::ShippingAddressPtr) override;
|
| + void OnShippingOptionChange(const String& shippingOptionId) override;
|
| + void OnPaymentResponse(mojom::blink::PaymentResponsePtr) override;
|
| + void OnError() override;
|
| + void OnComplete() override;
|
| +
|
| RefPtr<ScriptState> m_scriptState;
|
| Vector<String> m_supportedMethods;
|
| PaymentDetails m_details;
|
| @@ -60,6 +72,10 @@ private:
|
| String m_stringifiedData;
|
| Member<ShippingAddress> m_shippingAddress;
|
| String m_shippingOption;
|
| + Member<ScriptPromiseResolver> m_showResolver;
|
| + Member<ScriptPromiseResolver> m_completeResolver;
|
| + mojom::blink::PaymentRequestPtr m_paymentProvider;
|
| + mojo::Binding<mojom::blink::PaymentRequestClient> m_clientBinding;
|
| };
|
|
|
| } // namespace blink
|
|
|