| Index: chrome/browser/ui/views/payments/payment_method_view_controller.cc
|
| diff --git a/chrome/browser/ui/views/payments/payment_method_view_controller.cc b/chrome/browser/ui/views/payments/payment_method_view_controller.cc
|
| index 1bdb8dcdc563f8fc868726f4afedb82861ca0fcf..799fe3e277b5a3746d3fdffd7a8affbb4250cd9c 100644
|
| --- a/chrome/browser/ui/views/payments/payment_method_view_controller.cc
|
| +++ b/chrome/browser/ui/views/payments/payment_method_view_controller.cc
|
| @@ -16,6 +16,7 @@
|
| #include "chrome/browser/ui/views/payments/payment_request_views_util.h"
|
| #include "chrome/grit/generated_resources.h"
|
| #include "components/payments/content/payment_request_state.h"
|
| +#include "components/payments/core/autofill_payment_instrument.h"
|
| #include "components/payments/core/payment_instrument.h"
|
| #include "components/strings/grit/components_strings.h"
|
| #include "third_party/skia/include/core/SkColor.h"
|
| @@ -94,12 +95,20 @@ class PaymentMethodListItem : public payments::PaymentRequestItemList::Item {
|
| }
|
|
|
| bool CanBeSelected() const override {
|
| - // TODO(anthonyvd): Check for card completedness.
|
| - return true;
|
| + // If an instrument can't be selected, PerformSelectionFallback is called,
|
| + // where the instrument can be made complete.
|
| + return instrument_->IsCompleteForPayment();
|
| }
|
|
|
| void PerformSelectionFallback() override {
|
| - // TODO(anthonyvd): Open the editor pre-populated with this card's data.
|
| + switch (instrument_->type()) {
|
| + case PaymentInstrument::Type::AUTOFILL:
|
| + dialog_->ShowCreditCardEditor(
|
| + static_cast<AutofillPaymentInstrument*>(instrument_)
|
| + ->credit_card());
|
| + return;
|
| + }
|
| + NOTREACHED();
|
| }
|
|
|
| PaymentInstrument* instrument_;
|
|
|