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

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

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

Powered by Google App Engine
This is Rietveld 408576698