| 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 828fd2e7f037ec67a34c58828414e57bb66d666d..2a2aea501d380dfd1ec735d65dbbbb0c4621a2e3 100644
|
| --- a/chrome/browser/ui/views/payments/payment_method_view_controller.cc
|
| +++ b/chrome/browser/ui/views/payments/payment_method_view_controller.cc
|
| @@ -25,6 +25,7 @@
|
| #include "third_party/skia/include/core/SkColor.h"
|
| #include "ui/base/l10n/l10n_util.h"
|
| #include "ui/gfx/paint_vector_icon.h"
|
| +#include "ui/native_theme/native_theme.h"
|
| #include "ui/views/controls/button/label_button.h"
|
| #include "ui/views/controls/button/md_text_button.h"
|
| #include "ui/views/layout/box_layout.h"
|
| @@ -82,11 +83,23 @@ class PaymentMethodListItem : public payments::PaymentRequestItemList::Item {
|
| views::BoxLayout::CROSS_AXIS_ALIGNMENT_START);
|
| card_info_container->SetLayoutManager(box_layout.release());
|
|
|
| - card_info_container->AddChildView(new views::Label(instrument_->label()));
|
| - card_info_container->AddChildView(
|
| - new views::Label(instrument_->sublabel()));
|
| - // TODO(anthonyvd): Add the "card is incomplete" label once the
|
| - // completedness logic is implemented.
|
| + if (!instrument_->label().empty())
|
| + card_info_container->AddChildView(new views::Label(instrument_->label()));
|
| + if (!instrument_->sublabel().empty()) {
|
| + card_info_container->AddChildView(
|
| + new views::Label(instrument_->sublabel()));
|
| + }
|
| + if (!instrument_->IsCompleteForPayment()) {
|
| + std::unique_ptr<views::Label> missing_info_label =
|
| + base::MakeUnique<views::Label>(instrument_->GetMissingInfoLabel());
|
| + missing_info_label->SetFontList(
|
| + missing_info_label->GetDefaultFontList().DeriveWithSizeDelta(-1));
|
| + missing_info_label->SetEnabledColor(
|
| + missing_info_label->GetNativeTheme()->GetSystemColor(
|
| + ui::NativeTheme::kColorId_LinkEnabled));
|
| + card_info_container->AddChildView(missing_info_label.release());
|
| + }
|
| +
|
| return card_info_container;
|
| }
|
|
|
|
|