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

Unified Diff: components/payments/content/payment_request.cc

Issue 2766353004: [Payments] Support canMakePayment on Desktop (Closed)
Patch Set: only support valid instruments, added test Created 3 years, 9 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/BUILD.gn ('k') | components/payments/content/payment_request_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/payments/content/payment_request.cc
diff --git a/components/payments/content/payment_request.cc b/components/payments/content/payment_request.cc
index 77f03bf89c926850a998ed82f85d1ff1cd7b652f..fba230e1d8f5c5030a324e5746139a7881a6a894 100644
--- a/components/payments/content/payment_request.cc
+++ b/components/payments/content/payment_request.cc
@@ -84,8 +84,11 @@ void PaymentRequest::Complete(payments::mojom::PaymentComplete result) {
}
void PaymentRequest::CanMakePayment() {
- // TODO(mathp): Return whether we can make payment.
- client_->OnCanMakePayment(mojom::CanMakePaymentQueryResult::CAN_MAKE_PAYMENT);
+ // TODO(crbug.com/704676): Implement a quota policy for this method.
+ client_->OnCanMakePayment(
+ state()->CanMakePayment()
+ ? mojom::CanMakePaymentQueryResult::CAN_MAKE_PAYMENT
+ : mojom::CanMakePaymentQueryResult::CANNOT_MAKE_PAYMENT);
}
void PaymentRequest::OnInvalidSpecProvided() {
« no previous file with comments | « chrome/test/BUILD.gn ('k') | components/payments/content/payment_request_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698