Commit e3e7e596 authored by Vadym Doroshenko's avatar Vadym Doroshenko Committed by Commit Bot

Small clean-up in PasswordFormManager.

IsBlacklistMatch method can be simplified and removed by replacing it
with lambda function.

Bug: 831123
Change-Id: I80c838629c65270f022683d1d18b64fbba3c9f67
Reviewed-on: https://chromium-review.googlesource.com/1054874Reviewed-by: default avatarVasilii Sukhanov <vasilii@chromium.org>
Commit-Queue: Vadym Doroshenko <dvadym@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557870}
parent 6c332b23
......@@ -585,8 +585,9 @@ void PasswordFormManager::ProcessMatches(
blacklisted_matches_.clear();
std::copy_if(
non_federated.begin(), non_federated.end(),
std::back_inserter(blacklisted_matches_),
[this](const PasswordForm* form) { return IsBlacklistMatch(*form); });
std::back_inserter(blacklisted_matches_), [](const PasswordForm* form) {
return form->blacklisted_by_user && !form->is_public_suffix_match;
});
UMA_HISTOGRAM_COUNTS(
"PasswordManager.NumPasswordsNotShown",
......@@ -1106,15 +1107,6 @@ bool PasswordFormManager::IsMatch(const autofill::PasswordForm& form) const {
return !form.blacklisted_by_user && form.scheme == observed_form_.scheme;
}
bool PasswordFormManager::IsBlacklistMatch(
const autofill::PasswordForm& blacklisted_form) const {
return blacklisted_form.blacklisted_by_user &&
!blacklisted_form.is_public_suffix_match &&
blacklisted_form.scheme == observed_form_.scheme &&
blacklisted_form.origin.GetOrigin() ==
observed_form_.origin.GetOrigin();
}
const PasswordForm* PasswordFormManager::FindBestMatchForUpdatePassword(
const base::string16& password) const {
// This function is called for forms that do not contain a username field.
......
......@@ -338,9 +338,6 @@ class PasswordFormManager : public FormFetcher::Consumer {
// Returns true iff |form| is a non-blacklisted match for |observed_form_|.
bool IsMatch(const autofill::PasswordForm& form) const;
// Returns true iff |form| blacklists |observed_form_|.
bool IsBlacklistMatch(const autofill::PasswordForm& form) const;
// Helper for Save in the case there is at least one match for the pending
// credentials. This sends needed signals to the autofill server, and also
// triggers some UMA reporting.
......
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