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

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: Fixed a weird goof 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 09fa367985cc440e241a150383822593e2496e2b..ed385a0882ccde3dc3f2e921c4d0fb5eaf0fecb2 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,20 @@ CreditCardEditorViewController::GetComboboxModelForType(
return std::unique_ptr<ui::ComboboxModel>();
}
+void CreditCardEditorViewController::FillContentView(
+ views::View* content_view) {
+ EditorViewController::FillContentView(content_view);
+ // We need to search from the content view here, since the dialog may not have
+ // the content view added to it yet.
+ views::Combobox* combobox = static_cast<views::Combobox*>(
+ content_view->GetViewByID(kBillingAddressType));
+ // 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).
+ DCHECK(combobox);
+ 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