Commit 280be3de authored by Matthias Körber's avatar Matthias Körber Committed by Commit Bot

Removed unused methods from password_manager_util.

Change-Id: I1b9ac32e33d1e17f83e12887aa6782342e131a20
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1823863Reviewed-by: default avatarVadym Doroshenko <dvadym@chromium.org>
Commit-Queue: Matthias Körber <koerber@google.com>
Cr-Commit-Position: refs/heads/master@{#699753}
parent ca28bc09
......@@ -97,37 +97,6 @@ bool IsSyncingWithNormalEncryption(const syncer::SyncService* sync_service) {
password_manager::SYNCING_NORMAL_ENCRYPTION;
}
void FindDuplicates(std::vector<std::unique_ptr<PasswordForm>>* forms,
std::vector<std::unique_ptr<PasswordForm>>* duplicates,
std::vector<std::vector<PasswordForm*>>* tag_groups) {
if (forms->empty())
return;
// Linux backends used to treat the first form as a prime oneamong the
// duplicates. Therefore, the caller should try to preserve it.
std::stable_sort(forms->begin(), forms->end(), autofill::LessThanUniqueKey());
std::vector<std::unique_ptr<PasswordForm>> unique_forms;
unique_forms.push_back(std::move(forms->front()));
if (tag_groups) {
tag_groups->clear();
tag_groups->push_back(std::vector<PasswordForm*>());
tag_groups->front().push_back(unique_forms.front().get());
}
for (auto it = forms->begin() + 1; it != forms->end(); ++it) {
if (ArePasswordFormUniqueKeysEqual(**it, *unique_forms.back())) {
if (tag_groups)
tag_groups->back().push_back(it->get());
duplicates->push_back(std::move(*it));
} else {
if (tag_groups)
tag_groups->push_back(std::vector<PasswordForm*>(1, it->get()));
unique_forms.push_back(std::move(*it));
}
}
forms->swap(unique_forms);
}
void TrimUsernameOnlyCredentials(
std::vector<std::unique_ptr<PasswordForm>>* android_credentials) {
// Remove username-only credentials which are not federated.
......
......@@ -50,17 +50,6 @@ password_manager::SyncState GetPasswordSyncState(
// custom passphrase.
bool IsSyncingWithNormalEncryption(const syncer::SyncService* sync_service);
// Finds the forms with a duplicate sync tags in |forms|. The first one of
// the duplicated entries stays in |forms|, the others are moved to
// |duplicates|.
// |tag_groups| is optional. It will contain |forms| and |duplicates| grouped by
// the sync tag. The first element in each group is one from |forms|. It's
// followed by the duplicates.
void FindDuplicates(
std::vector<std::unique_ptr<autofill::PasswordForm>>* forms,
std::vector<std::unique_ptr<autofill::PasswordForm>>* duplicates,
std::vector<std::vector<autofill::PasswordForm*>>* tag_groups);
// Removes Android username-only credentials from |android_credentials|.
// Transforms federated credentials into non zero-click ones.
void TrimUsernameOnlyCredentials(
......
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