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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 const HeapVector<PaymentMethodData>&, | 54 const HeapVector<PaymentMethodData>&, |
55 const PaymentDetailsInit&, | 55 const PaymentDetailsInit&, |
56 const PaymentOptions&, | 56 const PaymentOptions&, |
57 ExceptionState&); | 57 ExceptionState&); |
58 | 58 |
59 virtual ~PaymentRequest(); | 59 virtual ~PaymentRequest(); |
60 | 60 |
61 ScriptPromise show(ScriptState*); | 61 ScriptPromise show(ScriptState*); |
62 ScriptPromise abort(ScriptState*); | 62 ScriptPromise abort(ScriptState*); |
63 | 63 |
| 64 const String& id() const { return id_; } |
64 PaymentAddress* getShippingAddress() const { return shipping_address_.Get(); } | 65 PaymentAddress* getShippingAddress() const { return shipping_address_.Get(); } |
65 const String& shippingOption() const { return shipping_option_; } | 66 const String& shippingOption() const { return shipping_option_; } |
66 const String& shippingType() const { return shipping_type_; } | 67 const String& shippingType() const { return shipping_type_; } |
67 | 68 |
68 DEFINE_ATTRIBUTE_EVENT_LISTENER(shippingaddresschange); | 69 DEFINE_ATTRIBUTE_EVENT_LISTENER(shippingaddresschange); |
69 DEFINE_ATTRIBUTE_EVENT_LISTENER(shippingoptionchange); | 70 DEFINE_ATTRIBUTE_EVENT_LISTENER(shippingoptionchange); |
70 | 71 |
71 ScriptPromise canMakePayment(ScriptState*); | 72 ScriptPromise canMakePayment(ScriptState*); |
72 | 73 |
73 // ScriptWrappable: | 74 // ScriptWrappable: |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 void OnCanMakePayment( | 110 void OnCanMakePayment( |
110 payments::mojom::blink::CanMakePaymentQueryResult) override; | 111 payments::mojom::blink::CanMakePaymentQueryResult) override; |
111 | 112 |
112 void OnCompleteTimeout(TimerBase*); | 113 void OnCompleteTimeout(TimerBase*); |
113 | 114 |
114 // Clears the promise resolvers and closes the Mojo connection. | 115 // Clears the promise resolvers and closes the Mojo connection. |
115 void ClearResolversAndCloseMojoConnection(); | 116 void ClearResolversAndCloseMojoConnection(); |
116 | 117 |
117 PaymentOptions options_; | 118 PaymentOptions options_; |
118 Member<PaymentAddress> shipping_address_; | 119 Member<PaymentAddress> shipping_address_; |
| 120 String id_; |
119 String shipping_option_; | 121 String shipping_option_; |
120 String shipping_type_; | 122 String shipping_type_; |
121 Member<ScriptPromiseResolver> show_resolver_; | 123 Member<ScriptPromiseResolver> show_resolver_; |
122 Member<ScriptPromiseResolver> complete_resolver_; | 124 Member<ScriptPromiseResolver> complete_resolver_; |
123 Member<ScriptPromiseResolver> abort_resolver_; | 125 Member<ScriptPromiseResolver> abort_resolver_; |
124 Member<ScriptPromiseResolver> can_make_payment_resolver_; | 126 Member<ScriptPromiseResolver> can_make_payment_resolver_; |
125 payments::mojom::blink::PaymentRequestPtr payment_provider_; | 127 payments::mojom::blink::PaymentRequestPtr payment_provider_; |
126 mojo::Binding<payments::mojom::blink::PaymentRequestClient> client_binding_; | 128 mojo::Binding<payments::mojom::blink::PaymentRequestClient> client_binding_; |
127 TaskRunnerTimer<PaymentRequest> complete_timer_; | 129 TaskRunnerTimer<PaymentRequest> complete_timer_; |
128 }; | 130 }; |
129 | 131 |
130 } // namespace blink | 132 } // namespace blink |
131 | 133 |
132 #endif // PaymentRequest_h | 134 #endif // PaymentRequest_h |
OLD | NEW |