| Index: chrome/browser/autofill/autofill_external_delegate.cc
|
| diff --git a/chrome/browser/autofill/autofill_external_delegate.cc b/chrome/browser/autofill/autofill_external_delegate.cc
|
| index a675a299caf1dc619148ed68848eb39f63729063..1a7d2e56c42dcd5a72c4140fe6b34194719a982c 100644
|
| --- a/chrome/browser/autofill/autofill_external_delegate.cc
|
| +++ b/chrome/browser/autofill/autofill_external_delegate.cc
|
| @@ -36,6 +36,7 @@ AutofillExternalDelegate::AutofillExternalDelegate(
|
| void AutofillExternalDelegate::SelectAutofillSuggestionAtIndex(int unique_id) {
|
| if (unique_id == WebAutofillClient::MenuItemIDAutofillOptions ||
|
| unique_id == WebAutofillClient::MenuItemIDClearForm ||
|
| + unique_id == WebAutofillClient::MenuItemIDSeparator ||
|
| unique_id == WebAutofillClient::MenuItemIDWarningMessage)
|
| return;
|
|
|
| @@ -80,6 +81,12 @@ void AutofillExternalDelegate::OnSuggestionsReturned(
|
| std::vector<string16> i(icons);
|
| std::vector<int> ids(unique_ids);
|
|
|
| + // Add a separator to go between the values and menu items.
|
| + v.push_back(string16());
|
| + l.push_back(string16());
|
| + i.push_back(string16());
|
| + ids.push_back(WebAutofillClient::MenuItemIDSeparator);
|
| +
|
| DCHECK_GT(ids.size(), 0U);
|
| if (!autofill_query_field_.should_autocomplete) {
|
| // If autofill is disabled and we had suggestions, show a warning instead.
|
| @@ -127,6 +134,14 @@ void AutofillExternalDelegate::OnSuggestionsReturned(
|
| ids.push_back(WebAutofillClient::MenuItemIDAutofillOptions);
|
| }
|
|
|
| + // Remove the separator if it is the last element.
|
| + if (*(ids.rbegin()) == WebAutofillClient::MenuItemIDSeparator) {
|
| + v.pop_back();
|
| + l.pop_back();
|
| + i.pop_back();
|
| + ids.pop_back();
|
| + }
|
| +
|
| // Send to display.
|
| if (!v.empty() && autofill_query_field_.is_focusable)
|
| ApplyAutofillSuggestions(v, l, i, ids);
|
|
|