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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 const HeapVector<PaymentMethodData>&, | 55 const HeapVector<PaymentMethodData>&, |
56 const PaymentDetailsInit&, | 56 const PaymentDetailsInit&, |
57 const PaymentOptions&, | 57 const PaymentOptions&, |
58 ExceptionState&); | 58 ExceptionState&); |
59 | 59 |
60 virtual ~PaymentRequest(); | 60 virtual ~PaymentRequest(); |
61 | 61 |
62 ScriptPromise show(ScriptState*); | 62 ScriptPromise show(ScriptState*); |
63 ScriptPromise abort(ScriptState*); | 63 ScriptPromise abort(ScriptState*); |
64 | 64 |
| 65 const String& id() const { return m_id; } |
65 PaymentAddress* getShippingAddress() const { return m_shippingAddress.get(); } | 66 PaymentAddress* getShippingAddress() const { return m_shippingAddress.get(); } |
66 const String& shippingOption() const { return m_shippingOption; } | 67 const String& shippingOption() const { return m_shippingOption; } |
67 const String& shippingType() const { return m_shippingType; } | 68 const String& shippingType() const { return m_shippingType; } |
68 | 69 |
69 DEFINE_ATTRIBUTE_EVENT_LISTENER(shippingaddresschange); | 70 DEFINE_ATTRIBUTE_EVENT_LISTENER(shippingaddresschange); |
70 DEFINE_ATTRIBUTE_EVENT_LISTENER(shippingoptionchange); | 71 DEFINE_ATTRIBUTE_EVENT_LISTENER(shippingoptionchange); |
71 | 72 |
72 ScriptPromise canMakePayment(ScriptState*); | 73 ScriptPromise canMakePayment(ScriptState*); |
73 | 74 |
74 // ScriptWrappable: | 75 // ScriptWrappable: |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 void OnCanMakePayment( | 111 void OnCanMakePayment( |
111 payments::mojom::blink::CanMakePaymentQueryResult) override; | 112 payments::mojom::blink::CanMakePaymentQueryResult) override; |
112 | 113 |
113 void onCompleteTimeout(TimerBase*); | 114 void onCompleteTimeout(TimerBase*); |
114 | 115 |
115 // Clears the promise resolvers and closes the Mojo connection. | 116 // Clears the promise resolvers and closes the Mojo connection. |
116 void clearResolversAndCloseMojoConnection(); | 117 void clearResolversAndCloseMojoConnection(); |
117 | 118 |
118 PaymentOptions m_options; | 119 PaymentOptions m_options; |
119 Member<PaymentAddress> m_shippingAddress; | 120 Member<PaymentAddress> m_shippingAddress; |
| 121 String m_id; |
120 String m_shippingOption; | 122 String m_shippingOption; |
121 String m_shippingType; | 123 String m_shippingType; |
122 Member<ScriptPromiseResolver> m_showResolver; | 124 Member<ScriptPromiseResolver> m_showResolver; |
123 Member<ScriptPromiseResolver> m_completeResolver; | 125 Member<ScriptPromiseResolver> m_completeResolver; |
124 Member<ScriptPromiseResolver> m_abortResolver; | 126 Member<ScriptPromiseResolver> m_abortResolver; |
125 Member<ScriptPromiseResolver> m_canMakePaymentResolver; | 127 Member<ScriptPromiseResolver> m_canMakePaymentResolver; |
126 payments::mojom::blink::PaymentRequestPtr m_paymentProvider; | 128 payments::mojom::blink::PaymentRequestPtr m_paymentProvider; |
127 mojo::Binding<payments::mojom::blink::PaymentRequestClient> m_clientBinding; | 129 mojo::Binding<payments::mojom::blink::PaymentRequestClient> m_clientBinding; |
128 TaskRunnerTimer<PaymentRequest> m_completeTimer; | 130 TaskRunnerTimer<PaymentRequest> m_completeTimer; |
129 }; | 131 }; |
130 | 132 |
131 } // namespace blink | 133 } // namespace blink |
132 | 134 |
133 #endif // PaymentRequest_h | 135 #endif // PaymentRequest_h |
OLD | NEW |