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

Unified Diff: components/autofill/content/renderer/form_autofill_util.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/content/renderer/form_autofill_util.cc
diff --git a/components/autofill/content/renderer/form_autofill_util.cc b/components/autofill/content/renderer/form_autofill_util.cc
index c9c6f8789db4e31532694666c8f93db64f4a4ede..1ba0aee506805aa80b5b4845f5d40e56ca873125 100644
--- a/components/autofill/content/renderer/form_autofill_util.cc
+++ b/components/autofill/content/renderer/form_autofill_util.cc
@@ -1047,14 +1047,16 @@ void PreviewForm(const FormData& form, const WebInputElement& element) {
}
bool ClearPreviewedFormWithElement(const WebInputElement& element,
- bool was_autofilled) {
+ RequirementsMask requirements,
+ bool was_autofilled,
+ bool was_password_autofilled) {
WebFormElement form_element = element.form();
if (form_element.isNull())
return false;
std::vector<WebFormControlElement> control_elements;
- ExtractAutofillableElements(form_element, REQUIRE_AUTOCOMPLETE,
- &control_elements);
+ //ExtractAutofillableElements(form_element, requirements, &control_elements);
+ ExtractAutofillableElements(form_element, REQUIRE_NONE, &control_elements);
for (size_t i = 0; i < control_elements.size(); ++i) {
// There might be unrelated elements in this form which have already been
// auto-filled. For example, the user might have already filled the address
@@ -1089,6 +1091,8 @@ bool ClearPreviewedFormWithElement(const WebInputElement& element,
bool is_initiating_node = (element == *input_element);
if (is_initiating_node)
input_element->setAutofilled(was_autofilled);
+ else if (input_element->isPasswordField())
+ input_element->setAutofilled(was_password_autofilled);
else
input_element->setAutofilled(false);

Powered by Google App Engine
This is Rietveld 408576698