| 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 PaymentResponse_h | 5 #ifndef PaymentResponse_h |
| 6 #define PaymentResponse_h | 6 #define PaymentResponse_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" |
| 11 #include "modules/ModulesExport.h" | 11 #include "modules/ModulesExport.h" |
| 12 #include "modules/payments/CurrencyAmount.h" |
| 12 #include "platform/heap/Handle.h" | 13 #include "platform/heap/Handle.h" |
| 13 #include "public/platform/modules/payments/payment_request.mojom-blink.h" | 14 #include "public/platform/modules/payments/payment_request.mojom-blink.h" |
| 14 #include "wtf/Noncopyable.h" | 15 #include "wtf/Noncopyable.h" |
| 15 #include "wtf/text/WTFString.h" | 16 #include "wtf/text/WTFString.h" |
| 16 | 17 |
| 17 namespace blink { | 18 namespace blink { |
| 18 | 19 |
| 19 class ExceptionState; | 20 class ExceptionState; |
| 20 class PaymentAddress; | 21 class PaymentAddress; |
| 21 class PaymentCompleter; | 22 class PaymentCompleter; |
| 22 class ScriptState; | 23 class ScriptState; |
| 23 | 24 |
| 24 class MODULES_EXPORT PaymentResponse final : public GarbageCollectedFinalized<Pa
ymentResponse>, public ScriptWrappable { | 25 class MODULES_EXPORT PaymentResponse final : public GarbageCollectedFinalized<Pa
ymentResponse>, public ScriptWrappable { |
| 25 DEFINE_WRAPPERTYPEINFO(); | 26 DEFINE_WRAPPERTYPEINFO(); |
| 26 WTF_MAKE_NONCOPYABLE(PaymentResponse); | 27 WTF_MAKE_NONCOPYABLE(PaymentResponse); |
| 27 | 28 |
| 28 public: | 29 public: |
| 29 PaymentResponse(mojom::blink::PaymentResponsePtr, PaymentCompleter*); | 30 PaymentResponse(mojom::blink::PaymentResponsePtr, PaymentCompleter*); |
| 30 virtual ~PaymentResponse(); | 31 virtual ~PaymentResponse(); |
| 31 | 32 |
| 32 const String& methodName() const { return m_methodName; } | 33 const String& methodName() const { return m_methodName; } |
| 34 void totalAmount(CurrencyAmount& result) const { result = m_totalAmount; } |
| 33 ScriptValue details(ScriptState*, ExceptionState&) const; | 35 ScriptValue details(ScriptState*, ExceptionState&) const; |
| 34 PaymentAddress* shippingAddress() const { return m_shippingAddress.get(); } | 36 PaymentAddress* shippingAddress() const { return m_shippingAddress.get(); } |
| 35 | 37 |
| 36 ScriptPromise complete(ScriptState*, bool success); | 38 ScriptPromise complete(ScriptState*, bool success); |
| 37 | 39 |
| 38 DECLARE_TRACE(); | 40 DECLARE_TRACE(); |
| 39 | 41 |
| 40 private: | 42 private: |
| 41 String m_methodName; | 43 String m_methodName; |
| 44 CurrencyAmount m_totalAmount; |
| 42 String m_stringifiedDetails; | 45 String m_stringifiedDetails; |
| 43 Member<PaymentAddress> m_shippingAddress; | 46 Member<PaymentAddress> m_shippingAddress; |
| 44 Member<PaymentCompleter> m_paymentCompleter; | 47 Member<PaymentCompleter> m_paymentCompleter; |
| 45 }; | 48 }; |
| 46 | 49 |
| 47 } // namespace blink | 50 } // namespace blink |
| 48 | 51 |
| 49 #endif // PaymentResponse_h | 52 #endif // PaymentResponse_h |
| OLD | NEW |