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" |
11 #include "core/dom/ContextLifecycleObserver.h" | 11 #include "core/dom/ContextLifecycleObserver.h" |
12 #include "core/events/EventTarget.h" | 12 #include "core/events/EventTarget.h" |
13 #include "modules/ModulesExport.h" | 13 #include "modules/ModulesExport.h" |
14 #include "modules/payments/PaymentCompleter.h" | 14 #include "modules/payments/PaymentCompleter.h" |
15 #include "modules/payments/PaymentDetails.h" | 15 #include "modules/payments/PaymentDetails.h" |
16 #include "modules/payments/PaymentMethodData.h" | 16 #include "modules/payments/PaymentMethodData.h" |
17 #include "modules/payments/PaymentOptions.h" | 17 #include "modules/payments/PaymentOptions.h" |
18 #include "modules/payments/PaymentUpdater.h" | 18 #include "modules/payments/PaymentUpdater.h" |
19 #include "mojo/public/cpp/bindings/binding.h" | 19 #include "mojo/public/cpp/bindings/binding.h" |
20 #include "platform/Timer.h" | |
20 #include "platform/heap/Handle.h" | 21 #include "platform/heap/Handle.h" |
21 #include "public/platform/modules/payments/payment_request.mojom-blink.h" | 22 #include "public/platform/modules/payments/payment_request.mojom-blink.h" |
22 #include "wtf/Compiler.h" | 23 #include "wtf/Compiler.h" |
23 #include "wtf/Noncopyable.h" | 24 #include "wtf/Noncopyable.h" |
24 #include "wtf/RefPtr.h" | 25 #include "wtf/RefPtr.h" |
25 #include "wtf/Vector.h" | 26 #include "wtf/Vector.h" |
26 #include "wtf/text/WTFString.h" | 27 #include "wtf/text/WTFString.h" |
27 | 28 |
28 namespace blink { | 29 namespace blink { |
29 | 30 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
65 | 66 |
66 // PaymentCompleter: | 67 // PaymentCompleter: |
67 ScriptPromise complete(ScriptState*, PaymentComplete result) override; | 68 ScriptPromise complete(ScriptState*, PaymentComplete result) override; |
68 | 69 |
69 // PaymentUpdater: | 70 // PaymentUpdater: |
70 void onUpdatePaymentDetails(const ScriptValue& detailsScriptValue) override; | 71 void onUpdatePaymentDetails(const ScriptValue& detailsScriptValue) override; |
71 void onUpdatePaymentDetailsFailure(const String& error) override; | 72 void onUpdatePaymentDetailsFailure(const String& error) override; |
72 | 73 |
73 DECLARE_TRACE(); | 74 DECLARE_TRACE(); |
74 | 75 |
76 void onTimerFired(TimerBase*); | |
Marijn Kruisselbrink
2016/08/01 22:42:25
Especially if this is going to be a public method
please use gerrit instead
2016/08/01 23:55:35
Done.
| |
77 | |
75 private: | 78 private: |
76 PaymentRequest(ScriptState*, const HeapVector<PaymentMethodData>&, const Pay mentDetails&, const PaymentOptions&, ExceptionState&); | 79 PaymentRequest(ScriptState*, const HeapVector<PaymentMethodData>&, const Pay mentDetails&, const PaymentOptions&, ExceptionState&); |
77 | 80 |
78 // LifecycleObserver: | 81 // LifecycleObserver: |
79 void contextDestroyed() override; | 82 void contextDestroyed() override; |
80 | 83 |
81 // ActiveScriptWrappable: | 84 // ActiveScriptWrappable: |
82 bool hasPendingActivity() const override; | 85 bool hasPendingActivity() const override; |
83 | 86 |
84 // mojom::blink::PaymentRequestClient: | 87 // mojom::blink::PaymentRequestClient: |
(...skipping 10 matching lines...) Expand all Loading... | |
95 Vector<MethodData> m_methodData; | 98 Vector<MethodData> m_methodData; |
96 PaymentDetails m_details; | 99 PaymentDetails m_details; |
97 PaymentOptions m_options; | 100 PaymentOptions m_options; |
98 Member<PaymentAddress> m_shippingAddress; | 101 Member<PaymentAddress> m_shippingAddress; |
99 String m_shippingOption; | 102 String m_shippingOption; |
100 Member<ScriptPromiseResolver> m_showResolver; | 103 Member<ScriptPromiseResolver> m_showResolver; |
101 Member<ScriptPromiseResolver> m_completeResolver; | 104 Member<ScriptPromiseResolver> m_completeResolver; |
102 Member<ScriptPromiseResolver> m_abortResolver; | 105 Member<ScriptPromiseResolver> m_abortResolver; |
103 mojom::blink::PaymentRequestPtr m_paymentProvider; | 106 mojom::blink::PaymentRequestPtr m_paymentProvider; |
104 mojo::Binding<mojom::blink::PaymentRequestClient> m_clientBinding; | 107 mojo::Binding<mojom::blink::PaymentRequestClient> m_clientBinding; |
108 Timer<PaymentRequest> m_completeTimer; | |
Marijn Kruisselbrink
2016/08/01 22:42:25
(in the future I believe using Timer directly for
please use gerrit instead
2016/08/01 23:55:35
Acknowledged.
| |
105 }; | 109 }; |
106 | 110 |
107 } // namespace blink | 111 } // namespace blink |
108 | 112 |
109 #endif // PaymentRequest_h | 113 #endif // PaymentRequest_h |
OLD | NEW |