Commit 2e88712e authored by deepak.m1's avatar deepak.m1 Committed by Commit bot

Refactoring PasswordAutofillAgent::FillUserNameAndPassword for early return if...

Refactoring PasswordAutofillAgent::FillUserNameAndPassword for early return if password_element is not autocompleteable.

PasswordAutofillAgent::FillUserNameAndPassword function refactor done for early return as we chould check this at start only.

BUG=398436

Review URL: https://codereview.chromium.org/557703002

Cr-Commit-Position: refs/heads/master@{#295653}
parent ed1230ad
......@@ -965,6 +965,10 @@ bool PasswordAutofillAgent::FillUserNameAndPassword(
base::string16 username;
base::string16 password;
// Don't fill username if password can't be set.
if (!IsElementAutocompletable(*password_element))
return false;
// Look for any suitable matches to current field text.
if (DoUsernamesMatch(fill_data.basic_data.fields[0].value,
current_username,
......@@ -1011,11 +1015,6 @@ bool PasswordAutofillAgent::FillUserNameAndPassword(
// TODO(tkent): Check maxlength and pattern for both username and password
// fields.
// Don't fill username if password can't be set.
if (!IsElementAutocompletable(*password_element)) {
return false;
}
// Input matches the username, fill in required values.
if (IsElementAutocompletable(*username_element)) {
username_element->setValue(username, true);
......
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