Commit 95f627dc authored by Gemene Narcis's avatar Gemene Narcis Committed by Commit Bot

Rename BlacklistedDuplicatesCleaner class

This CL renames class with name BlacklistedDuplicatesCleaner to
RedundantCredentialsCleaner. This is to reflect expanding this
class to handle also non-blacklisted credentials, which will be
done in coming CLs

Bug: 862930
Change-Id: Ifba11a521775cbcd33c183aa685ae84a591d8457
Reviewed-on: https://chromium-review.googlesource.com/1202664
Commit-Queue: Narcis Gemene <gemene@google.com>
Reviewed-by: default avatarVaclav Brozek <vabr@chromium.org>
Reviewed-by: default avatarJan Wilken Dörrie <jdoerrie@chromium.org>
Cr-Commit-Position: refs/heads/master@{#588473}
parent 5ce3f48c
...@@ -37,8 +37,6 @@ jumbo_static_library("browser") { ...@@ -37,8 +37,6 @@ jumbo_static_library("browser") {
"android_affiliation/lookup_affiliation_response_parser.cc", "android_affiliation/lookup_affiliation_response_parser.cc",
"android_affiliation/lookup_affiliation_response_parser.h", "android_affiliation/lookup_affiliation_response_parser.h",
"android_affiliation/test_affiliation_fetcher_factory.h", "android_affiliation/test_affiliation_fetcher_factory.h",
"blacklisted_duplicates_cleaner.cc",
"blacklisted_duplicates_cleaner.h",
"browser_save_password_progress_logger.cc", "browser_save_password_progress_logger.cc",
"browser_save_password_progress_logger.h", "browser_save_password_progress_logger.h",
"credential_manager_impl.cc", "credential_manager_impl.cc",
...@@ -142,6 +140,8 @@ jumbo_static_library("browser") { ...@@ -142,6 +140,8 @@ jumbo_static_library("browser") {
"password_ui_utils.h", "password_ui_utils.h",
"psl_matching_helper.cc", "psl_matching_helper.cc",
"psl_matching_helper.h", "psl_matching_helper.h",
"redundant_credentials_cleaner.cc",
"redundant_credentials_cleaner.h",
"site_affiliation/asset_link_data.cc", "site_affiliation/asset_link_data.cc",
"site_affiliation/asset_link_data.h", "site_affiliation/asset_link_data.h",
"sql_table_builder.cc", "sql_table_builder.cc",
...@@ -368,7 +368,6 @@ source_set("unit_tests") { ...@@ -368,7 +368,6 @@ source_set("unit_tests") {
"android_affiliation/affiliation_service_unittest.cc", "android_affiliation/affiliation_service_unittest.cc",
"android_affiliation/affiliation_utils_unittest.cc", "android_affiliation/affiliation_utils_unittest.cc",
"android_affiliation/facet_manager_unittest.cc", "android_affiliation/facet_manager_unittest.cc",
"blacklisted_duplicates_cleaner_unittest.cc",
"browser_save_password_progress_logger_unittest.cc", "browser_save_password_progress_logger_unittest.cc",
"credential_manager_impl_unittest.cc", "credential_manager_impl_unittest.cc",
"credential_manager_logger_unittest.cc", "credential_manager_logger_unittest.cc",
...@@ -405,6 +404,7 @@ source_set("unit_tests") { ...@@ -405,6 +404,7 @@ source_set("unit_tests") {
"password_syncable_service_unittest.cc", "password_syncable_service_unittest.cc",
"password_ui_utils_unittest.cc", "password_ui_utils_unittest.cc",
"psl_matching_helper_unittest.cc", "psl_matching_helper_unittest.cc",
"redundant_credentials_cleaner_unittest.cc",
"site_affiliation/asset_link_data_unittest.cc", "site_affiliation/asset_link_data_unittest.cc",
"sql_table_builder_unittest.cc", "sql_table_builder_unittest.cc",
"statistics_table_unittest.cc", "statistics_table_unittest.cc",
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include "components/autofill/core/browser/popup_item_ids.h" #include "components/autofill/core/browser/popup_item_ids.h"
#include "components/autofill/core/common/password_form.h" #include "components/autofill/core/common/password_form.h"
#include "components/autofill/core/common/password_generation_util.h" #include "components/autofill/core/common/password_generation_util.h"
#include "components/password_manager/core/browser/blacklisted_duplicates_cleaner.h"
#include "components/password_manager/core/browser/hsts_query.h" #include "components/password_manager/core/browser/hsts_query.h"
#include "components/password_manager/core/browser/log_manager.h" #include "components/password_manager/core/browser/log_manager.h"
#include "components/password_manager/core/browser/password_generation_manager.h" #include "components/password_manager/core/browser/password_generation_manager.h"
...@@ -24,6 +23,7 @@ ...@@ -24,6 +23,7 @@
#include "components/password_manager/core/browser/password_manager_driver.h" #include "components/password_manager/core/browser/password_manager_driver.h"
#include "components/password_manager/core/browser/password_manager_metrics_util.h" #include "components/password_manager/core/browser/password_manager_metrics_util.h"
#include "components/password_manager/core/browser/password_store_consumer.h" #include "components/password_manager/core/browser/password_store_consumer.h"
#include "components/password_manager/core/browser/redundant_credentials_cleaner.h"
#include "components/password_manager/core/common/password_manager_features.h" #include "components/password_manager/core/common/password_manager_features.h"
#include "components/password_manager/core/common/password_manager_pref_names.h" #include "components/password_manager/core/common/password_manager_pref_names.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
...@@ -38,7 +38,7 @@ void StartDeletingBlacklistedDuplicates( ...@@ -38,7 +38,7 @@ void StartDeletingBlacklistedDuplicates(
scoped_refptr<password_manager::PasswordStore> store, scoped_refptr<password_manager::PasswordStore> store,
PrefService* prefs) { PrefService* prefs) {
// The object will delete itself once the credentials are retrieved. // The object will delete itself once the credentials are retrieved.
new password_manager::BlacklistedDuplicatesCleaner(std::move(store), prefs); new password_manager::RedundantCredentialsCleaner(std::move(store), prefs);
} }
// Return true if // Return true if
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "components/password_manager/core/browser/blacklisted_duplicates_cleaner.h" #include "components/password_manager/core/browser/redundant_credentials_cleaner.h"
#include <set> #include <set>
#include <string> #include <string>
...@@ -15,16 +15,16 @@ ...@@ -15,16 +15,16 @@
namespace password_manager { namespace password_manager {
BlacklistedDuplicatesCleaner::BlacklistedDuplicatesCleaner( RedundantCredentialsCleaner::RedundantCredentialsCleaner(
scoped_refptr<PasswordStore> store, scoped_refptr<PasswordStore> store,
PrefService* prefs) PrefService* prefs)
: store_(std::move(store)), prefs_(prefs) { : store_(std::move(store)), prefs_(prefs) {
store_->GetBlacklistLogins(this); store_->GetBlacklistLogins(this);
} }
BlacklistedDuplicatesCleaner::~BlacklistedDuplicatesCleaner() = default; RedundantCredentialsCleaner::~RedundantCredentialsCleaner() = default;
void BlacklistedDuplicatesCleaner::OnGetPasswordStoreResults( void RedundantCredentialsCleaner::OnGetPasswordStoreResults(
std::vector<std::unique_ptr<autofill::PasswordForm>> results) { std::vector<std::unique_ptr<autofill::PasswordForm>> results) {
std::set<std::string> signon_realms; std::set<std::string> signon_realms;
for (const auto& form : results) { for (const auto& form : results) {
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_BLACKLISTED_DUPLICATES_CLEANER_H_ #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_REDUNDANT_CREDENTIALS_CLEANER_H_
#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_BLACKLISTED_DUPLICATES_CLEANER_H_ #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_REDUNDANT_CREDENTIALS_CLEANER_H_
#include <memory> #include <memory>
#include <vector> #include <vector>
...@@ -27,11 +27,11 @@ class PasswordStore; ...@@ -27,11 +27,11 @@ class PasswordStore;
// cleared. // cleared.
// TODO(https://crbug.com/866794): Remove the code once majority of the users // TODO(https://crbug.com/866794): Remove the code once majority of the users
// executed it. // executed it.
class BlacklistedDuplicatesCleaner : public PasswordStoreConsumer { class RedundantCredentialsCleaner : public PasswordStoreConsumer {
public: public:
BlacklistedDuplicatesCleaner(scoped_refptr<PasswordStore> store, RedundantCredentialsCleaner(scoped_refptr<PasswordStore> store,
PrefService* prefs); PrefService* prefs);
~BlacklistedDuplicatesCleaner() override; ~RedundantCredentialsCleaner() override;
// PasswordStoreConsumer: // PasswordStoreConsumer:
void OnGetPasswordStoreResults( void OnGetPasswordStoreResults(
...@@ -41,9 +41,9 @@ class BlacklistedDuplicatesCleaner : public PasswordStoreConsumer { ...@@ -41,9 +41,9 @@ class BlacklistedDuplicatesCleaner : public PasswordStoreConsumer {
scoped_refptr<PasswordStore> store_; scoped_refptr<PasswordStore> store_;
PrefService* prefs_; PrefService* prefs_;
DISALLOW_COPY_AND_ASSIGN(BlacklistedDuplicatesCleaner); DISALLOW_COPY_AND_ASSIGN(RedundantCredentialsCleaner);
}; };
} // namespace password_manager } // namespace password_manager
#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_BLACKLISTED_DUPLICATES_CLEANER_H_ #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_REDUNDANT_CREDENTIALS_CLEANER_H_
\ No newline at end of file \ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "components/password_manager/core/browser/blacklisted_duplicates_cleaner.h" #include "components/password_manager/core/browser/redundant_credentials_cleaner.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/test/metrics/histogram_tester.h" #include "base/test/metrics/histogram_tester.h"
...@@ -16,11 +16,11 @@ ...@@ -16,11 +16,11 @@
namespace password_manager { namespace password_manager {
class BlacklistedDuplicatesCleanerCleanerTest : public ::testing::Test { class RedundantCredentialsCleanerTest : public ::testing::Test {
public: public:
BlacklistedDuplicatesCleanerCleanerTest() = default; RedundantCredentialsCleanerTest() = default;
~BlacklistedDuplicatesCleanerCleanerTest() override = default; ~RedundantCredentialsCleanerTest() override = default;
protected: protected:
TestPasswordStore* store() { return store_.get(); } TestPasswordStore* store() { return store_.get(); }
...@@ -38,10 +38,10 @@ class BlacklistedDuplicatesCleanerCleanerTest : public ::testing::Test { ...@@ -38,10 +38,10 @@ class BlacklistedDuplicatesCleanerCleanerTest : public ::testing::Test {
base::MakeRefCounted<TestPasswordStore>(); base::MakeRefCounted<TestPasswordStore>();
TestingPrefServiceSimple prefs_; TestingPrefServiceSimple prefs_;
DISALLOW_COPY_AND_ASSIGN(BlacklistedDuplicatesCleanerCleanerTest); DISALLOW_COPY_AND_ASSIGN(RedundantCredentialsCleanerTest);
}; };
TEST_F(BlacklistedDuplicatesCleanerCleanerTest, RemoveBlacklistedDuplicates) { TEST_F(RedundantCredentialsCleanerTest, RemoveBlacklistedDuplicates) {
base::test::ScopedTaskEnvironment scoped_task_environment; base::test::ScopedTaskEnvironment scoped_task_environment;
ASSERT_TRUE( ASSERT_TRUE(
store()->Init(syncer::SyncableService::StartSyncFlare(), nullptr)); store()->Init(syncer::SyncableService::StartSyncFlare(), nullptr));
......
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