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

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

Issue 148413002: Add "previewing on hover" support for single-field autocomplete input (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and update code as per Ilya's comments Created 6 years, 9 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 bd3795c41d2f16775a6cd9a71ff5780159b07c8d..f435ceb8e23563face4edc083b1d815f12adcca7 100644
--- a/components/autofill/core/browser/autofill_external_delegate.cc
+++ b/components/autofill/core/browser/autofill_external_delegate.cc
@@ -162,12 +162,16 @@ bool AutofillExternalDelegate::ShouldRepostEvent(const ui::MouseEvent& event) {
return true;
}
-void AutofillExternalDelegate::DidSelectSuggestion(int identifier) {
+void AutofillExternalDelegate::DidSelectSuggestion(
+ const base::string16& value,
+ int identifier) {
ClearPreviewedForm();
// Only preview the data if it is a profile.
if (identifier > 0)
FillAutofillFormData(identifier, true);
+ else if (identifier == POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY)
+ driver_->RendererShouldPreviewFieldWithValue(value);
}
void AutofillExternalDelegate::DidAcceptSuggestion(const base::string16& value,
@@ -186,7 +190,7 @@ void AutofillExternalDelegate::DidAcceptSuggestion(const base::string16& value,
driver_->RendererShouldAcceptDataListSuggestion(value);
} else if (identifier == POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY) {
// User selected an Autocomplete, so we fill directly.
- driver_->RendererShouldSetNodeText(value);
+ driver_->RendererShouldFillFieldWithValue(value);
} else {
FillAutofillFormData(identifier, false);
}

Powered by Google App Engine
This is Rietveld 408576698