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

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

Issue 2874933008: Adds animation as feature variation to keyboard accessory. (Closed)
Patch Set: Switch to base/metrics/field_trial_params.h API from variations:: 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: 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 3db7f0fd00bead2a98bb3d080139eddd21755973..27e046d10b6aeebc5ee1cfa138dcd5180538ca2a 100644
--- a/components/autofill/core/browser/autofill_external_delegate.cc
+++ b/components/autofill/core/browser/autofill_external_delegate.cc
@@ -83,9 +83,8 @@ void AutofillExternalDelegate::OnSuggestionsReturned(
if (query_id != query_id_)
return;
- // The suggestions and warnings are "above the fold" and are separated from
- // other menu items with a separator.
std::vector<Suggestion> suggestions(input_suggestions);
+
// Hide warnings as appropriate.
PossiblyRemoveAutofillWarnings(&suggestions);
@@ -339,19 +338,31 @@ void AutofillExternalDelegate::ApplyAutofillOptions(
if (query_field_.is_autofilled) {
base::string16 value =
l10n_util::GetStringUTF16(IDS_AUTOFILL_CLEAR_FORM_MENU_ITEM);
+#if defined(OS_ANDROID)
if (IsKeyboardAccessoryEnabled())
value = base::i18n::ToUpper(value);
+#endif
suggestions->push_back(Suggestion(value));
suggestions->back().frontend_id = POPUP_ITEM_ID_CLEAR_FORM;
}
// Append the 'Chrome Autofill options' menu item, or the menu item specified
- // in the popup layout experiment.
+ // in the popup layout experiment. If we do not include
+ // |POPUP_ITEM_ID_CLEAR_FORM|, include a hint for keyboard accessory.
suggestions->push_back(Suggestion(GetSettingsSuggestionValue()));
suggestions->back().frontend_id = POPUP_ITEM_ID_AUTOFILL_OPTIONS;
- if (IsKeyboardAccessoryEnabled())
+#if defined(OS_ANDROID)
+ if (IsKeyboardAccessoryEnabled()) {
suggestions->back().icon = base::ASCIIToUTF16("settings");
+ if (IsHintEnabledInKeyboardAccessory() && !query_field_.is_autofilled) {
+ Suggestion create_icon;
+ create_icon.icon = base::ASCIIToUTF16("create");
+ create_icon.frontend_id = POPUP_ITEM_ID_CREATE_HINT;
+ suggestions->push_back(create_icon);
+ }
+ }
+#endif
}
void AutofillExternalDelegate::InsertDataListValues(

Powered by Google App Engine
This is Rietveld 408576698