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

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: Created 6 years, 11 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 c4367567ff274c7801e20dea6ef5f0dd89111e21..0fb86c6d14eefad318196c0a40de1c4802982f65 100644
--- a/components/autofill/core/browser/autofill_external_delegate.cc
+++ b/components/autofill/core/browser/autofill_external_delegate.cc
@@ -13,6 +13,7 @@
#include "ui/base/l10n/l10n_util.h"
using blink::WebAutofillClient;
+using base::ASCIIToUTF16;
namespace autofill {
@@ -172,6 +173,15 @@ void AutofillExternalDelegate::DidSelectSuggestion(int identifier) {
FillAutofillFormData(identifier, true);
}
+void AutofillExternalDelegate::DidSelectAutocompleteSuggestion(
+ const base::string16& value) {
+ ClearPreviewedForm();
+ ClearAutocompletePreviewedField();
+
+ // Preview the data if it is in an AutoComplete field.
+ autofill_driver_->RendererShouldSetNodeText(value);
+}
+
void AutofillExternalDelegate::DidAcceptSuggestion(const base::string16& value,
int identifier) {
if (identifier == WebAutofillClient::MenuItemIDAutofillOptions) {
@@ -216,6 +226,10 @@ void AutofillExternalDelegate::ClearPreviewedForm() {
autofill_driver_->RendererShouldClearPreviewedForm();
}
+void AutofillExternalDelegate::ClearAutocompletePreviewedField() {
+ autofill_driver_->RendererShouldSetNodeText(ASCIIToUTF16(""));
+}
+
void AutofillExternalDelegate::Reset() {
autofill_manager_->delegate()->HideAutofillPopup();

Powered by Google App Engine
This is Rietveld 408576698