Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(452)

Side by Side Diff: third_party/WebKit/Source/modules/payments/PaymentRequest.h

Issue 2516923002: [Merge M-56] Add canMakeActivePayment() method to web payments. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 ScriptPromise show(ScriptState*); 61 ScriptPromise show(ScriptState*);
62 ScriptPromise abort(ScriptState*); 62 ScriptPromise abort(ScriptState*);
63 63
64 PaymentAddress* getShippingAddress() const { return m_shippingAddress.get(); } 64 PaymentAddress* getShippingAddress() const { return m_shippingAddress.get(); }
65 const String& shippingOption() const { return m_shippingOption; } 65 const String& shippingOption() const { return m_shippingOption; }
66 const String& shippingType() const { return m_shippingType; } 66 const String& shippingType() const { return m_shippingType; }
67 67
68 DEFINE_ATTRIBUTE_EVENT_LISTENER(shippingaddresschange); 68 DEFINE_ATTRIBUTE_EVENT_LISTENER(shippingaddresschange);
69 DEFINE_ATTRIBUTE_EVENT_LISTENER(shippingoptionchange); 69 DEFINE_ATTRIBUTE_EVENT_LISTENER(shippingoptionchange);
70 70
71 ScriptPromise canMakeActivePayment(ScriptState*);
72
71 // ScriptWrappable: 73 // ScriptWrappable:
72 bool hasPendingActivity() const override; 74 bool hasPendingActivity() const override;
73 75
74 // EventTargetWithInlineData: 76 // EventTargetWithInlineData:
75 const AtomicString& interfaceName() const override; 77 const AtomicString& interfaceName() const override;
76 ExecutionContext* getExecutionContext() const override; 78 ExecutionContext* getExecutionContext() const override;
77 79
78 // PaymentCompleter: 80 // PaymentCompleter:
79 ScriptPromise complete(ScriptState*, PaymentComplete result) override; 81 ScriptPromise complete(ScriptState*, PaymentComplete result) override;
80 82
(...skipping 16 matching lines...) Expand all
97 void contextDestroyed() override; 99 void contextDestroyed() override;
98 100
99 // payments::mojom::blink::PaymentRequestClient: 101 // payments::mojom::blink::PaymentRequestClient:
100 void OnShippingAddressChange( 102 void OnShippingAddressChange(
101 payments::mojom::blink::PaymentAddressPtr) override; 103 payments::mojom::blink::PaymentAddressPtr) override;
102 void OnShippingOptionChange(const String& shippingOptionId) override; 104 void OnShippingOptionChange(const String& shippingOptionId) override;
103 void OnPaymentResponse(payments::mojom::blink::PaymentResponsePtr) override; 105 void OnPaymentResponse(payments::mojom::blink::PaymentResponsePtr) override;
104 void OnError(payments::mojom::blink::PaymentErrorReason) override; 106 void OnError(payments::mojom::blink::PaymentErrorReason) override;
105 void OnComplete() override; 107 void OnComplete() override;
106 void OnAbort(bool abortedSuccessfully) override; 108 void OnAbort(bool abortedSuccessfully) override;
109 void OnCanMakeActivePayment(
110 payments::mojom::blink::ActivePaymentQueryResult) override;
107 111
108 void onCompleteTimeout(TimerBase*); 112 void onCompleteTimeout(TimerBase*);
109 113
110 // Clears the promise resolvers and closes the Mojo connection. 114 // Clears the promise resolvers and closes the Mojo connection.
111 void clearResolversAndCloseMojoConnection(); 115 void clearResolversAndCloseMojoConnection();
112 116
113 PaymentOptions m_options; 117 PaymentOptions m_options;
114 Member<PaymentAddress> m_shippingAddress; 118 Member<PaymentAddress> m_shippingAddress;
115 String m_shippingOption; 119 String m_shippingOption;
116 String m_shippingType; 120 String m_shippingType;
117 Member<ScriptPromiseResolver> m_showResolver; 121 Member<ScriptPromiseResolver> m_showResolver;
118 Member<ScriptPromiseResolver> m_completeResolver; 122 Member<ScriptPromiseResolver> m_completeResolver;
119 Member<ScriptPromiseResolver> m_abortResolver; 123 Member<ScriptPromiseResolver> m_abortResolver;
124 Member<ScriptPromiseResolver> m_canMakeActivePaymentResolver;
120 payments::mojom::blink::PaymentRequestPtr m_paymentProvider; 125 payments::mojom::blink::PaymentRequestPtr m_paymentProvider;
121 mojo::Binding<payments::mojom::blink::PaymentRequestClient> m_clientBinding; 126 mojo::Binding<payments::mojom::blink::PaymentRequestClient> m_clientBinding;
122 Timer<PaymentRequest> m_completeTimer; 127 Timer<PaymentRequest> m_completeTimer;
123 }; 128 };
124 129
125 } // namespace blink 130 } // namespace blink
126 131
127 #endif // PaymentRequest_h 132 #endif // PaymentRequest_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698