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

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: Addressed Ilya's 2nd set comments Created 6 years, 10 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 e4a5c039b064b3079d09596af936d441586a63b8..1c555f95cc907fc6d046a8c00711b96fd6d2981a 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)
+ autofill_driver_->RendererShouldPreviewFieldWithValue(value);
}
void AutofillExternalDelegate::DidAcceptSuggestion(const base::string16& value,
@@ -186,7 +190,7 @@ void AutofillExternalDelegate::DidAcceptSuggestion(const base::string16& value,
autofill_driver_->RendererShouldAcceptDataListSuggestion(value);
} else if (identifier == POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY) {
// User selected an Autocomplete, so we fill directly.
- autofill_driver_->RendererShouldSetNodeText(value);
+ autofill_driver_->RendererShouldFillFieldWithValue(value);
} else {
FillAutofillFormData(identifier, false);
}

Powered by Google App Engine
This is Rietveld 408576698