Chromium Code Reviews| 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 2cf3af3f1319541e9a65db5a543a72ecf92be3b8..1c3fc0be9220fa46b83183fd26317b05e8a06b50 100644 |
| --- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc |
| +++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc |
| @@ -687,7 +687,19 @@ ui::ComboboxModel* AutofillDialogControllerImpl::ComboboxModelForAutofillType( |
| ui::MenuModel* AutofillDialogControllerImpl::MenuModelForSection( |
| DialogSection section) { |
| - return SuggestionsMenuModelForSection(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; |
|
aruslan
2013/04/30 16:37:28
On Android the editing form is shown only when the
|
| } |
| ui::MenuModel* AutofillDialogControllerImpl::MenuModelForAccountChooser() { |