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 PaymentRequest_h | 5 #ifndef PaymentRequest_h |
6 #define PaymentRequest_h | 6 #define PaymentRequest_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
9 #include "bindings/core/v8/ScriptValue.h" | 9 #include "bindings/core/v8/ScriptValue.h" |
10 #include "bindings/core/v8/ScriptWrappable.h" | 10 #include "bindings/core/v8/ScriptWrappable.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 WTF_MAKE_NONCOPYABLE(PaymentRequest); | 37 WTF_MAKE_NONCOPYABLE(PaymentRequest); |
38 | 38 |
39 public: | 39 public: |
40 static PaymentRequest* create(ScriptState*, const Vector<String>& supportedM
ethods, const PaymentDetails&, ExceptionState&); | 40 static PaymentRequest* create(ScriptState*, const Vector<String>& supportedM
ethods, const PaymentDetails&, ExceptionState&); |
41 static PaymentRequest* create(ScriptState*, const Vector<String>& supportedM
ethods, const PaymentDetails&, const PaymentOptions&, ExceptionState&); | 41 static PaymentRequest* create(ScriptState*, const Vector<String>& supportedM
ethods, const PaymentDetails&, const PaymentOptions&, ExceptionState&); |
42 static PaymentRequest* create(ScriptState*, const Vector<String>& supportedM
ethods, const PaymentDetails&, const PaymentOptions&, const ScriptValue& data, E
xceptionState&); | 42 static PaymentRequest* create(ScriptState*, const Vector<String>& supportedM
ethods, const PaymentDetails&, const PaymentOptions&, const ScriptValue& data, E
xceptionState&); |
43 | 43 |
44 virtual ~PaymentRequest(); | 44 virtual ~PaymentRequest(); |
45 | 45 |
46 ScriptPromise show(ScriptState*); | 46 ScriptPromise show(ScriptState*); |
47 void abort(ExceptionState&); | 47 ScriptPromise abort(ScriptState*); |
48 | 48 |
49 PaymentAddress* getShippingAddress() const { return m_shippingAddress.get();
} | 49 PaymentAddress* getShippingAddress() const { return m_shippingAddress.get();
} |
50 const String& shippingOption() const { return m_shippingOption; } | 50 const String& shippingOption() const { return m_shippingOption; } |
51 | 51 |
52 DEFINE_ATTRIBUTE_EVENT_LISTENER(shippingaddresschange); | 52 DEFINE_ATTRIBUTE_EVENT_LISTENER(shippingaddresschange); |
53 DEFINE_ATTRIBUTE_EVENT_LISTENER(shippingoptionchange); | 53 DEFINE_ATTRIBUTE_EVENT_LISTENER(shippingoptionchange); |
54 | 54 |
55 // EventTargetWithInlineData: | 55 // EventTargetWithInlineData: |
56 const AtomicString& interfaceName() const override; | 56 const AtomicString& interfaceName() const override; |
57 ExecutionContext* getExecutionContext() const override; | 57 ExecutionContext* getExecutionContext() const override; |
(...skipping 15 matching lines...) Expand all Loading... |
73 | 73 |
74 // ActiveScriptWrappable: | 74 // ActiveScriptWrappable: |
75 bool hasPendingActivity() const override; | 75 bool hasPendingActivity() const override; |
76 | 76 |
77 // mojom::blink::PaymentRequestClient: | 77 // mojom::blink::PaymentRequestClient: |
78 void OnShippingAddressChange(mojom::blink::PaymentAddressPtr) override; | 78 void OnShippingAddressChange(mojom::blink::PaymentAddressPtr) override; |
79 void OnShippingOptionChange(const String& shippingOptionId) override; | 79 void OnShippingOptionChange(const String& shippingOptionId) override; |
80 void OnPaymentResponse(mojom::blink::PaymentResponsePtr) override; | 80 void OnPaymentResponse(mojom::blink::PaymentResponsePtr) override; |
81 void OnError() override; | 81 void OnError() override; |
82 void OnComplete() override; | 82 void OnComplete() override; |
| 83 void OnAbort(bool abortedSuccessfully) override; |
83 | 84 |
84 // Clears the promise resolvers and closes the Mojo connection. | 85 // Clears the promise resolvers and closes the Mojo connection. |
85 void clearResolversAndCloseMojoConnection(); | 86 void clearResolversAndCloseMojoConnection(); |
86 | 87 |
87 Vector<String> m_supportedMethods; | 88 Vector<String> m_supportedMethods; |
88 PaymentDetails m_details; | 89 PaymentDetails m_details; |
89 PaymentOptions m_options; | 90 PaymentOptions m_options; |
90 String m_stringifiedData; | 91 String m_stringifiedData; |
91 Member<PaymentAddress> m_shippingAddress; | 92 Member<PaymentAddress> m_shippingAddress; |
92 String m_shippingOption; | 93 String m_shippingOption; |
93 Member<ScriptPromiseResolver> m_showResolver; | 94 Member<ScriptPromiseResolver> m_showResolver; |
94 Member<ScriptPromiseResolver> m_completeResolver; | 95 Member<ScriptPromiseResolver> m_completeResolver; |
| 96 Member<ScriptPromiseResolver> m_abortResolver; |
95 mojom::blink::PaymentRequestPtr m_paymentProvider; | 97 mojom::blink::PaymentRequestPtr m_paymentProvider; |
96 mojo::Binding<mojom::blink::PaymentRequestClient> m_clientBinding; | 98 mojo::Binding<mojom::blink::PaymentRequestClient> m_clientBinding; |
97 }; | 99 }; |
98 | 100 |
99 } // namespace blink | 101 } // namespace blink |
100 | 102 |
101 #endif // PaymentRequest_h | 103 #endif // PaymentRequest_h |
OLD | NEW |