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

Unified Diff: chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc

Issue 14571003: Don't display drop down arrows in rAc dialog unless there is a suggestion (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 7 years, 8 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/autofill/autofill_dialog_controller_impl.cc
diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
index be956b080d1fcb171024d82b2a94c468121953ad..dc0c0fe2acbb6b1e0f1c5d06e380cbfb74967507 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
@@ -687,8 +687,27 @@ ui::ComboboxModel* AutofillDialogControllerImpl::ComboboxModelForAutofillType(
ui::MenuModel* AutofillDialogControllerImpl::MenuModelForSection(
DialogSection section) {
+ SuggestionsMenuModel* model = SuggestionsMenuModelForSection(section);
+ // The shipping section menu is special. It will always show because there is
+ // a choice between "Use billing" and "enter new".
+ if (section == SECTION_SHIPPING)
+ return model;
+
+ // For other sections, only show a menu if there's at least one suggestion.
+ for (int i = 0; i < model->GetItemCount(); ++i) {
+ if (IsASuggestionItemKey(model->GetItemKeyAt(i)))
+ return model;
+ }
+
+ return NULL;
+}
+
+#if defined(OS_ANDROID)
+ui::MenuModel* AutofillDialogControllerImpl::MenuModelForSectionHack(
+ DialogSection section) {
return SuggestionsMenuModelForSection(section);
}
+#endif
ui::MenuModel* AutofillDialogControllerImpl::MenuModelForAccountChooser() {
// If there were unrecoverable Wallet errors, or if there are choices other

Powered by Google App Engine
This is Rietveld 408576698