| 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);
|
|
|