Commit 35a8434e authored by elawrence's avatar elawrence Committed by Commit bot

Use correct element for Form Not Secure warning

Web forms may not contain a username element, therefore it is not safe
to assume that such an element exists when calling ShowNotSecureWarning.
Instead, use the actual element found by the autofill logic.

BUG=678769

Review-Url: https://codereview.chromium.org/2612893003
Cr-Commit-Position: refs/heads/master@{#441988}
parent 7a349f40
...@@ -1619,6 +1619,8 @@ bool UnownedPasswordFormElementsAndFieldSetsToFormData( ...@@ -1619,6 +1619,8 @@ bool UnownedPasswordFormElementsAndFieldSetsToFormData(
bool FindFormAndFieldForFormControlElement(const WebFormControlElement& element, bool FindFormAndFieldForFormControlElement(const WebFormControlElement& element,
FormData* form, FormData* form,
FormFieldData* field) { FormFieldData* field) {
DCHECK(!element.isNull());
if (!IsAutofillableElement(element)) if (!IsAutofillableElement(element))
return false; return false;
......
...@@ -1266,7 +1266,7 @@ void PasswordAutofillAgent::FillPasswordForm( ...@@ -1266,7 +1266,7 @@ void PasswordAutofillAgent::FillPasswordForm(
base::Unretained(&gatekeeper_)), base::Unretained(&gatekeeper_)),
logger.get())) { logger.get())) {
if (form_data.show_form_not_secure_warning_on_autofill) if (form_data.show_form_not_secure_warning_on_autofill)
autofill_agent_->ShowNotSecureWarning(username_element); autofill_agent_->ShowNotSecureWarning(element);
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment