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

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

Issue 2815763002: Prevent usage of web payments API over insecure HTTPS. (Closed)
Patch Set: Fix typo Created 3 years, 8 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 c3f152640f2dfc5f3f3a10435ba887bfd6224670..aaf180dbc7041b0bfe7d4e3ac31cfb35b166790f 100644
--- a/components/payments/content/payment_request_state.cc
+++ b/components/payments/content/payment_request_state.cc
@@ -50,15 +50,22 @@ void PaymentRequestState::OnPaymentResponseReady(
bool PaymentRequestState::CanMakePayment() const {
for (const std::unique_ptr<PaymentInstrument>& instrument :
available_instruments_) {
- if (instrument->IsValidForCanMakePayment() &&
- spec_->supported_card_networks_set().count(
- instrument.get()->method_name())) {
+ if (instrument->IsValidForCanMakePayment()) {
+ // AddAutofillPaymentInstrument() filters out available instruments based
+ // on supported card networks.
+ DCHECK(spec_->supported_card_networks_set().find(
+ instrument->method_name()) !=
+ spec_->supported_card_networks_set().end());
return true;
}
}
return false;
}
+bool PaymentRequestState::AreRequestedMethodsSupported() const {
+ return !spec_->supported_card_networks().empty();
+}
+
void PaymentRequestState::AddObserver(Observer* observer) {
CHECK(observer);
observers_.AddObserver(observer);
« no previous file with comments | « components/payments/content/payment_request_state.h ('k') | components/payments/content/payment_response_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698