Commit ca9a55da authored by Dominic Battre's avatar Dominic Battre Committed by Commit Bot

Cleanups for PasswordFormManager

Bug: 732846
Change-Id: Ic1266587516270979e7077a526b8a951cb9d1c76
Reviewed-on: https://chromium-review.googlesource.com/570425Reviewed-by: default avatarVadym Doroshenko <dvadym@chromium.org>
Commit-Queue: Dominic Battré <battre@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488231}
parent 508e75ae
......@@ -339,10 +339,10 @@ bool FieldHasNonscriptModifiedValue(
// Helper function that checks the presence of visible password and username
// fields in |form.control_elements|.
// Iff a visible password found, then |*found_visible_password| is set to true.
// Iff a visible password found AND there is a visible username before it, then
// |*found_visible_username_before_visible_password| is set to true.
void FoundVisiblePasswordAndVisibleUsernameBeforePassword(
// Iff a visible password is found, then |*found_visible_password| is set to
// true. Iff a visible password is found AND there is a visible username before
// it, then |*found_visible_username_before_visible_password| is set to true.
void FindVisiblePasswordAndVisibleUsernameBeforePassword(
const SyntheticForm& form,
bool* found_visible_password,
bool* found_visible_username_before_visible_password) {
......@@ -417,7 +417,7 @@ bool GetPasswordForm(
// the latest username field just before selected password field).
bool ignore_invisible_passwords = false;
bool ignore_invisible_usernames = false;
FoundVisiblePasswordAndVisibleUsernameBeforePassword(
FindVisiblePasswordAndVisibleUsernameBeforePassword(
form, &ignore_invisible_passwords, &ignore_invisible_usernames);
std::string layout_sequence;
layout_sequence.reserve(form.control_elements.size());
......
......@@ -401,10 +401,10 @@ class PasswordFormManager : public FormFetcher::Consumer {
// represents credentials that were not previosly saved.
void CreatePendingCredentialsForNewCredentials();
// If |best_matches| contains only one entry then return this entry. Otherwise
// for empty |password| return nullptr and for non-empty |password| returns
// the unique entry in |best_matches_| with the same password, if it exists,
// and nullptr otherwise.
// If |best_matches_| contains only one entry, then return this entry.
// Otherwise for empty |password| return nullptr and for non-empty |password|
// returns the any entry in |best_matches_| with the same password, if it
// exists, and nullptr otherwise.
const autofill::PasswordForm* FindBestMatchForUpdatePassword(
const base::string16& password) const;
......@@ -440,8 +440,9 @@ class PasswordFormManager : public FormFetcher::Consumer {
std::vector<autofill::PasswordForm>* credentials_to_update);
// Set of nonblacklisted PasswordForms from the DB that best match the form
// being managed by |this|, indexed by username. They are owned by
// |form_fetcher_|.
// being managed by |this|, indexed by username. This means the best
// PasswordForm for each username is stored in this map. The PasswordForms are
// owned by |form_fetcher_|.
std::map<base::string16, const autofill::PasswordForm*> best_matches_;
// Set of forms from PasswordStore that correspond to the current site and
......
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