Chromium Code Reviews| Index: chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc |
| diff --git a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc |
| index 4562c3355bb6b68a5de560009b3982c2e1ddb481..87b818a3765ae8a2499f93749d82487b815e4785 100644 |
| --- a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc |
| +++ b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc |
| @@ -335,6 +335,18 @@ CreditCardEditorViewController::GetComboboxModelForType( |
| return std::unique_ptr<ui::ComboboxModel>(); |
| } |
| +void CreditCardEditorViewController::FillContentView( |
| + views::View* content_view) { |
| + EditorViewController::FillContentView(content_view); |
| + views::Combobox* combobox = |
| + static_cast<views::Combobox*>(dialog()->GetViewByID(kBillingAddressType)); |
|
anthonyvd
2017/05/18 15:08:43
I don't think you need to cast, SetEnabled should
MAD
2017/05/18 16:09:14
But I also need to call GetRowCount(). :-)
|
| + DCHECK(combobox); |
| + // When the combobox has a single item, it's because it has no addresses |
| + // (otherwise, it would have the select header, and a separator before the |
| + // first address to choose from). |
| + combobox->SetEnabled(combobox->GetRowCount() > 1); |
| +} |
| + |
| base::string16 CreditCardEditorViewController::GetSheetTitle() { |
| if (!credit_card_to_edit_) |
| return l10n_util::GetStringUTF16(IDS_PAYMENTS_ADD_CARD); |