| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 const PaymentDetails&, | 51 const PaymentDetails&, |
| 52 ExceptionState&); | 52 ExceptionState&); |
| 53 static PaymentRequest* create(ScriptState*, | 53 static PaymentRequest* create(ScriptState*, |
| 54 const HeapVector<PaymentMethodData>&, | 54 const HeapVector<PaymentMethodData>&, |
| 55 const PaymentDetails&, | 55 const PaymentDetails&, |
| 56 const PaymentOptions&, | 56 const PaymentOptions&, |
| 57 ExceptionState&); | 57 ExceptionState&); |
| 58 | 58 |
| 59 virtual ~PaymentRequest(); | 59 virtual ~PaymentRequest(); |
| 60 | 60 |
| 61 struct MethodData { | |
| 62 MethodData(const Vector<String>& methods, const String& data) | |
| 63 : supportedMethods(methods), stringifiedData(data) {} | |
| 64 Vector<String> supportedMethods; | |
| 65 String stringifiedData; | |
| 66 }; | |
| 67 | |
| 68 ScriptPromise show(ScriptState*); | 61 ScriptPromise show(ScriptState*); |
| 69 ScriptPromise abort(ScriptState*); | 62 ScriptPromise abort(ScriptState*); |
| 70 | 63 |
| 71 PaymentAddress* getShippingAddress() const { return m_shippingAddress.get(); } | 64 PaymentAddress* getShippingAddress() const { return m_shippingAddress.get(); } |
| 72 const String& shippingOption() const { return m_shippingOption; } | 65 const String& shippingOption() const { return m_shippingOption; } |
| 73 const String& shippingType() const { return m_shippingType; } | 66 const String& shippingType() const { return m_shippingType; } |
| 74 | 67 |
| 75 DEFINE_ATTRIBUTE_EVENT_LISTENER(shippingaddresschange); | 68 DEFINE_ATTRIBUTE_EVENT_LISTENER(shippingaddresschange); |
| 76 DEFINE_ATTRIBUTE_EVENT_LISTENER(shippingoptionchange); | 69 DEFINE_ATTRIBUTE_EVENT_LISTENER(shippingoptionchange); |
| 77 | 70 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 Member<ScriptPromiseResolver> m_completeResolver; | 118 Member<ScriptPromiseResolver> m_completeResolver; |
| 126 Member<ScriptPromiseResolver> m_abortResolver; | 119 Member<ScriptPromiseResolver> m_abortResolver; |
| 127 payments::mojom::blink::PaymentRequestPtr m_paymentProvider; | 120 payments::mojom::blink::PaymentRequestPtr m_paymentProvider; |
| 128 mojo::Binding<payments::mojom::blink::PaymentRequestClient> m_clientBinding; | 121 mojo::Binding<payments::mojom::blink::PaymentRequestClient> m_clientBinding; |
| 129 Timer<PaymentRequest> m_completeTimer; | 122 Timer<PaymentRequest> m_completeTimer; |
| 130 }; | 123 }; |
| 131 | 124 |
| 132 } // namespace blink | 125 } // namespace blink |
| 133 | 126 |
| 134 #endif // PaymentRequest_h | 127 #endif // PaymentRequest_h |
| OLD | NEW |