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

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

Issue 2766353004: [Payments] Support canMakePayment on Desktop (Closed)
Patch Set: 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
Index: components/payments/content/payment_request_state.cc
diff --git a/components/payments/content/payment_request_state.cc b/components/payments/content/payment_request_state.cc
index 26e8bf3d5f951169ceec6af0171c6db8a08d4eee..15f22e03a452df3c0edb053db874bf288a401f94 100644
--- a/components/payments/content/payment_request_state.cc
+++ b/components/payments/content/payment_request_state.cc
@@ -34,6 +34,17 @@ PaymentRequestState::PaymentRequestState(
SetDefaultProfileSelections();
}
+bool PaymentRequestState::CanMakePayment() {
+ // TODO(crbug.com/704675): Handle incognito mode when replying to this method.
+ for (const std::unique_ptr<PaymentInstrument>& instrument :
+ available_instruments_) {
please use gerrit instead 2017/03/24 14:47:25 Need to filter by valid instruments (instrument->I
Mathieu 2017/03/24 15:38:40 Whoops, thanks.
+ if (spec_->supported_card_networks_set().count(
+ instrument.get()->method_name()))
+ return true;
+ }
+ return false;
+}
+
void PaymentRequestState::AddObserver(Observer* observer) {
CHECK(observer);
observers_.AddObserver(observer);

Powered by Google App Engine
This is Rietveld 408576698