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

Unified Diff: chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc

Issue 2888733004: Change text and disable empty combobox for payment request shipping address (Closed)
Patch Set: Merge branch 'master' into billing Created 3 years, 7 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: 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);

Powered by Google App Engine
This is Rietveld 408576698