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

Unified Diff: components/autofill/core/browser/autofill_external_delegate.cc

Issue 1082183002: Android - Introduce "keyboard accessory" for Autofill suggestions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test Created 5 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: components/autofill/core/browser/autofill_external_delegate.cc
diff --git a/components/autofill/core/browser/autofill_external_delegate.cc b/components/autofill/core/browser/autofill_external_delegate.cc
index 1f711c7bfdbe28b0416d850c180eb9ba970ae46e..5f8a3e0b2b11e0b4161e7784786ee97838271f65 100644
--- a/components/autofill/core/browser/autofill_external_delegate.cc
+++ b/components/autofill/core/browser/autofill_external_delegate.cc
@@ -88,9 +88,11 @@ void AutofillExternalDelegate::OnSuggestionsReturned(
// Add or hide warnings as appropriate.
ApplyAutofillWarnings(&suggestions);
+#if !defined(OS_ANDROID)
// Add a separator to go between the values and menu items.
suggestions.push_back(Suggestion());
suggestions.back().frontend_id = POPUP_ITEM_ID_SEPARATOR;
+#endif
if (should_show_scan_credit_card_) {
Suggestion scan_credit_card(
@@ -118,10 +120,12 @@ void AutofillExternalDelegate::OnSuggestionsReturned(
if (has_suggestion_)
ApplyAutofillOptions(&suggestions);
+#if !defined(OS_ANDROID)
// Remove the separator if it is the last element.
DCHECK_GT(suggestions.size(), 0U);
if (suggestions.back().frontend_id == POPUP_ITEM_ID_SEPARATOR)
suggestions.pop_back();
+#endif
// If anything else is added to modify the values after inserting the data
// list, AutofillPopupControllerImpl::UpdateDataListValues will need to be
@@ -359,12 +363,14 @@ void AutofillExternalDelegate::InsertDataListValues(
if (data_list_values_.empty())
return;
+#if !defined(OS_ANDROID)
// Insert the separator between the datalist and Autofill values (if there
// are any).
if (!suggestions->empty()) {
suggestions->insert(suggestions->begin(), Suggestion());
(*suggestions)[0].frontend_id = POPUP_ITEM_ID_SEPARATOR;
}
+#endif
// Insert the datalist elements at the beginning.
suggestions->insert(suggestions->begin(), data_list_values_.size(),

Powered by Google App Engine
This is Rietveld 408576698