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

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

Issue 208453002: Add "previewing on hover" support for password field. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update code as per Ilya's comment. 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 f435ceb8e23563face4edc083b1d815f12adcca7..0079b4c033e85b7b9027b5126113d86902c6142c 100644
--- a/components/autofill/core/browser/autofill_external_delegate.cc
+++ b/components/autofill/core/browser/autofill_external_delegate.cc
@@ -168,10 +168,14 @@ void AutofillExternalDelegate::DidSelectSuggestion(
ClearPreviewedForm();
// Only preview the data if it is a profile.
- if (identifier > 0)
+ if (identifier > 0) {
FillAutofillFormData(identifier, true);
- else if (identifier == POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY)
+ } else if (identifier == POPUP_ITEM_ID_PASSWORD_ENTRY) {
+ bool success = password_manager_.DidSelectSuggestion(query_field_, value);
+ DCHECK(success);
+ } else if (identifier == POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY) {
driver_->RendererShouldPreviewFieldWithValue(value);
+ }
}
void AutofillExternalDelegate::DidAcceptSuggestion(const base::string16& value,
@@ -183,7 +187,7 @@ void AutofillExternalDelegate::DidAcceptSuggestion(const base::string16& value,
// User selected 'Clear form'.
driver_->RendererShouldClearFilledForm();
} else if (identifier == POPUP_ITEM_ID_PASSWORD_ENTRY) {
- bool success = password_manager_.DidAcceptAutofillSuggestion(
+ bool success = password_manager_.DidAcceptSuggestion(
query_field_, value);
Ilya Sherman 2014/03/25 19:45:27 nit: Looks like this now fits on the previous line
DCHECK(success);
} else if (identifier == POPUP_ITEM_ID_DATALIST_ENTRY) {

Powered by Google App Engine
This is Rietveld 408576698