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

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

Issue 2467393002: Add canMakeActivePayment() method to web payments. (Closed)
Patch Set: Hide behind a flag Created 4 years, 1 month 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 ScriptPromise show(ScriptState*); 68 ScriptPromise show(ScriptState*);
69 ScriptPromise abort(ScriptState*); 69 ScriptPromise abort(ScriptState*);
70 70
71 PaymentAddress* getShippingAddress() const { return m_shippingAddress.get(); } 71 PaymentAddress* getShippingAddress() const { return m_shippingAddress.get(); }
72 const String& shippingOption() const { return m_shippingOption; } 72 const String& shippingOption() const { return m_shippingOption; }
73 const String& shippingType() const { return m_shippingType; } 73 const String& shippingType() const { return m_shippingType; }
74 74
75 DEFINE_ATTRIBUTE_EVENT_LISTENER(shippingaddresschange); 75 DEFINE_ATTRIBUTE_EVENT_LISTENER(shippingaddresschange);
76 DEFINE_ATTRIBUTE_EVENT_LISTENER(shippingoptionchange); 76 DEFINE_ATTRIBUTE_EVENT_LISTENER(shippingoptionchange);
77 77
78 ScriptPromise canMakeActivePayment(ScriptState*);
79
78 // ScriptWrappable: 80 // ScriptWrappable:
79 bool hasPendingActivity() const override; 81 bool hasPendingActivity() const override;
80 82
81 // EventTargetWithInlineData: 83 // EventTargetWithInlineData:
82 const AtomicString& interfaceName() const override; 84 const AtomicString& interfaceName() const override;
83 ExecutionContext* getExecutionContext() const override; 85 ExecutionContext* getExecutionContext() const override;
84 86
85 // PaymentCompleter: 87 // PaymentCompleter:
86 ScriptPromise complete(ScriptState*, PaymentComplete result) override; 88 ScriptPromise complete(ScriptState*, PaymentComplete result) override;
87 89
(...skipping 16 matching lines...) Expand all
104 void contextDestroyed() override; 106 void contextDestroyed() override;
105 107
106 // payments::mojom::blink::PaymentRequestClient: 108 // payments::mojom::blink::PaymentRequestClient:
107 void OnShippingAddressChange( 109 void OnShippingAddressChange(
108 payments::mojom::blink::PaymentAddressPtr) override; 110 payments::mojom::blink::PaymentAddressPtr) override;
109 void OnShippingOptionChange(const String& shippingOptionId) override; 111 void OnShippingOptionChange(const String& shippingOptionId) override;
110 void OnPaymentResponse(payments::mojom::blink::PaymentResponsePtr) override; 112 void OnPaymentResponse(payments::mojom::blink::PaymentResponsePtr) override;
111 void OnError(payments::mojom::blink::PaymentErrorReason) override; 113 void OnError(payments::mojom::blink::PaymentErrorReason) override;
112 void OnComplete() override; 114 void OnComplete() override;
113 void OnAbort(bool abortedSuccessfully) override; 115 void OnAbort(bool abortedSuccessfully) override;
116 void OnCanMakeActivePayment(
117 payments::mojom::blink::ActivePaymentQueryResult) override;
114 118
115 void onCompleteTimeout(TimerBase*); 119 void onCompleteTimeout(TimerBase*);
116 120
117 // Clears the promise resolvers and closes the Mojo connection. 121 // Clears the promise resolvers and closes the Mojo connection.
118 void clearResolversAndCloseMojoConnection(); 122 void clearResolversAndCloseMojoConnection();
119 123
120 PaymentOptions m_options; 124 PaymentOptions m_options;
121 Member<PaymentAddress> m_shippingAddress; 125 Member<PaymentAddress> m_shippingAddress;
122 String m_shippingOption; 126 String m_shippingOption;
123 String m_shippingType; 127 String m_shippingType;
124 Member<ScriptPromiseResolver> m_showResolver; 128 Member<ScriptPromiseResolver> m_showResolver;
125 Member<ScriptPromiseResolver> m_completeResolver; 129 Member<ScriptPromiseResolver> m_completeResolver;
126 Member<ScriptPromiseResolver> m_abortResolver; 130 Member<ScriptPromiseResolver> m_abortResolver;
131 Member<ScriptPromiseResolver> m_canMakeActivePaymentResolver;
127 payments::mojom::blink::PaymentRequestPtr m_paymentProvider; 132 payments::mojom::blink::PaymentRequestPtr m_paymentProvider;
128 mojo::Binding<payments::mojom::blink::PaymentRequestClient> m_clientBinding; 133 mojo::Binding<payments::mojom::blink::PaymentRequestClient> m_clientBinding;
129 Timer<PaymentRequest> m_completeTimer; 134 Timer<PaymentRequest> m_completeTimer;
130 }; 135 };
131 136
132 } // namespace blink 137 } // namespace blink
133 138
134 #endif // PaymentRequest_h 139 #endif // PaymentRequest_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698