Skip to content

Commit

Permalink
Rename //chrome's PasswordStoreFactory to *ProfilePassword*
Browse files Browse the repository at this point in the history
Renaming the factory file will be addressed in a separate CL.
This CL does the replacement below.
([^t]|^)PasswordStoreFactory -> $1ProfilePasswordStoreFactory

Related CLs:
  Rename //chrome's PasswordStoreFactory to *ProfilePassword*
    crrev.com/c/4935375
  Rename //chrome's password_store_factory.cc to *_profile_password_*
    crrev.com/c/4935999
  Rename IOSChromePasswordStoreFactory to *ProfilePassword*
    crrev.com/c/4935363
  Rename ios_chrome_password_store_factory.h to *_profile_password_*
    crrev.com/c/4935426
  Rename WebViewProfilePasswordStoreFactory to *ProfilePassword*
    crrev.com/c/4935482
  Rename web_view_password_store_factory.h to *_profile_password_*
    crrev.com/c/4935428

Bug: 1492451
Change-Id: Ie51c9d4e65045589e75aadf9c6fdbd333d5f9e02
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4935375
Commit-Queue: Victor Vianna <victorvianna@google.com>
Reviewed-by: Vasilii Sukhanov <vasilii@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1209605}
  • Loading branch information
Victor Hugo Vianna Silva authored and Chromium LUCI CQ committed Oct 13, 2023
1 parent d9cd3b5 commit 034bac8
Show file tree
Hide file tree
Showing 54 changed files with 245 additions and 237 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
// Password manager
if (remove_mask & constants::DATA_TYPE_PASSWORDS) {
base::RecordAction(UserMetricsAction("ClearBrowsingData_Passwords"));
auto password_store = PasswordStoreFactory::GetForProfile(
auto password_store = ProfilePasswordStoreFactory::GetForProfile(
profile_, ServiceAccessType::EXPLICIT_ACCESS);

if (password_store) {
Expand Down Expand Up @@ -933,8 +933,8 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(

if (remove_mask & content::BrowsingDataRemover::DATA_TYPE_COOKIES) {
password_manager::PasswordStoreInterface* password_store =
PasswordStoreFactory::GetForProfile(profile_,
ServiceAccessType::EXPLICIT_ACCESS)
ProfilePasswordStoreFactory::GetForProfile(
profile_, ServiceAccessType::EXPLICIT_ACCESS)
.get();

if (password_store &&
Expand All @@ -947,8 +947,8 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(

if (remove_mask & constants::DATA_TYPE_HISTORY) {
password_manager::PasswordStoreInterface* password_store =
PasswordStoreFactory::GetForProfile(profile_,
ServiceAccessType::EXPLICIT_ACCESS)
ProfilePasswordStoreFactory::GetForProfile(
profile_, ServiceAccessType::EXPLICIT_ACCESS)
.get();

if (password_store) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ ChromeBrowsingDataRemoverDelegateFactory::
#endif // BUILDFLAG(IS_ANDROID)
DependsOn(HistoryServiceFactory::GetInstance());
DependsOn(HostContentSettingsMapFactory::GetInstance());
DependsOn(PasswordStoreFactory::GetInstance());
DependsOn(ProfilePasswordStoreFactory::GetInstance());
DependsOn(AccountPasswordStoreFactory::GetInstance());
DependsOn(prerender::NoStatePrefetchManagerFactory::GetInstance());
DependsOn(TabRestoreServiceFactory::GetInstance());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ class ClearDomainReliabilityTester {
class RemovePasswordsTester {
public:
explicit RemovePasswordsTester(TestingProfile* testing_profile) {
PasswordStoreFactory::GetInstance()->SetTestingFactory(
ProfilePasswordStoreFactory::GetInstance()->SetTestingFactory(
testing_profile,
base::BindRepeating(
&password_manager::BuildPasswordStoreInterface<
Expand All @@ -645,8 +645,8 @@ class RemovePasswordsTester {
password_manager::MockPasswordStoreInterface>>));

profile_store_ = static_cast<password_manager::MockPasswordStoreInterface*>(
PasswordStoreFactory::GetForProfile(testing_profile,
ServiceAccessType::EXPLICIT_ACCESS)
ProfilePasswordStoreFactory::GetForProfile(
testing_profile, ServiceAccessType::EXPLICIT_ACCESS)
.get());

if (base::FeatureList::IsEnabled(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ BrowsingDataCounterFactory::GetForProfileAndPref(Profile* profile,
nullptr;
#endif
return std::make_unique<browsing_data::SigninDataCounter>(
PasswordStoreFactory::GetForProfile(profile,
ServiceAccessType::EXPLICIT_ACCESS),
ProfilePasswordStoreFactory::GetForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS),
AccountPasswordStoreFactory::GetForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS),
SyncServiceFactory::GetForProfile(profile),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class PasswordsCounterTest : public InProcessBrowserTest {
finished_ = false;
time_ = base::Time::Now();
times_used_in_html_form_ = 0;
store_ = PasswordStoreFactory::GetForProfile(
store_ = ProfilePasswordStoreFactory::GetForProfile(
browser()->profile(), ServiceAccessType::IMPLICIT_ACCESS)
.get();
SetPasswordsDeletionPref(true);
Expand Down Expand Up @@ -167,8 +167,8 @@ IN_PROC_BROWSER_TEST_F(PasswordsCounterTest, SameDomain) {

Profile* profile = browser()->profile();
browsing_data::PasswordsCounter counter(
PasswordStoreFactory::GetForProfile(profile,
ServiceAccessType::EXPLICIT_ACCESS),
ProfilePasswordStoreFactory::GetForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS),
AccountPasswordStoreFactory::GetForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS),
SyncServiceFactory::GetForProfile(profile));
Expand All @@ -190,8 +190,8 @@ IN_PROC_BROWSER_TEST_F(PasswordsCounterTest, blocklisted) {

Profile* profile = browser()->profile();
browsing_data::PasswordsCounter counter(
PasswordStoreFactory::GetForProfile(profile,
ServiceAccessType::EXPLICIT_ACCESS),
ProfilePasswordStoreFactory::GetForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS),
AccountPasswordStoreFactory::GetForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS),
SyncServiceFactory::GetForProfile(profile));
Expand All @@ -215,8 +215,8 @@ IN_PROC_BROWSER_TEST_F(PasswordsCounterTest, PrefChanged) {

Profile* profile = browser()->profile();
browsing_data::PasswordsCounter counter(
PasswordStoreFactory::GetForProfile(profile,
ServiceAccessType::EXPLICIT_ACCESS),
ProfilePasswordStoreFactory::GetForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS),
AccountPasswordStoreFactory::GetForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS),
SyncServiceFactory::GetForProfile(profile));
Expand All @@ -237,8 +237,8 @@ IN_PROC_BROWSER_TEST_F(PasswordsCounterTest, StoreChanged) {

Profile* profile = browser()->profile();
browsing_data::PasswordsCounter counter(
PasswordStoreFactory::GetForProfile(profile,
ServiceAccessType::EXPLICIT_ACCESS),
ProfilePasswordStoreFactory::GetForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS),
AccountPasswordStoreFactory::GetForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS),
SyncServiceFactory::GetForProfile(profile));
Expand Down Expand Up @@ -273,8 +273,8 @@ IN_PROC_BROWSER_TEST_F(PasswordsCounterTest, PeriodChanged) {

Profile* profile = browser()->profile();
browsing_data::PasswordsCounter counter(
PasswordStoreFactory::GetForProfile(profile,
ServiceAccessType::EXPLICIT_ACCESS),
ProfilePasswordStoreFactory::GetForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS),
AccountPasswordStoreFactory::GetForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS),
SyncServiceFactory::GetForProfile(profile));
Expand Down Expand Up @@ -322,8 +322,8 @@ IN_PROC_BROWSER_TEST_F(PasswordsCounterTest, MostCommonDomains) {

Profile* profile = browser()->profile();
browsing_data::PasswordsCounter counter(
PasswordStoreFactory::GetForProfile(profile,
ServiceAccessType::EXPLICIT_ACCESS),
ProfilePasswordStoreFactory::GetForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS),
AccountPasswordStoreFactory::GetForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS),
SyncServiceFactory::GetForProfile(profile));
Expand All @@ -343,8 +343,8 @@ IN_PROC_BROWSER_TEST_F(PasswordsCounterTest, MostCommonDomains) {
IN_PROC_BROWSER_TEST_F(PasswordsCounterTest, MultipleRestarts) {
Profile* profile = browser()->profile();
browsing_data::PasswordsCounter counter(
PasswordStoreFactory::GetForProfile(profile,
ServiceAccessType::EXPLICIT_ACCESS),
ProfilePasswordStoreFactory::GetForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS),
AccountPasswordStoreFactory::GetForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS),
SyncServiceFactory::GetForProfile(profile));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ IN_PROC_BROWSER_TEST_F(SyncAwareCounterTest, PasswordCounter) {
Profile* profile = GetProfile(kFirstProfileIndex);
// Set up the counter.
browsing_data::PasswordsCounter counter(
PasswordStoreFactory::GetForProfile(profile,
ServiceAccessType::EXPLICIT_ACCESS),
ProfilePasswordStoreFactory::GetForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS),
AccountPasswordStoreFactory::GetForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS),
sync_service);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ PasswordCheckDelegate::PasswordCheckDelegate(
: profile_(profile),
saved_passwords_presenter_(presenter),
insecure_credentials_manager_(presenter,
PasswordStoreFactory::GetForProfile(
ProfilePasswordStoreFactory::GetForProfile(
profile,
ServiceAccessType::EXPLICIT_ACCESS),
AccountPasswordStoreFactory::GetForProfile(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ PasswordsPrivateDelegateFactory::PasswordsPrivateDelegateFactory()
.WithGuest(ProfileSelection::kOriginalOnly)
.Build()) {
DependsOn(BulkLeakCheckServiceFactory::GetInstance());
DependsOn(PasswordStoreFactory::GetInstance());
DependsOn(ProfilePasswordStoreFactory::GetInstance());
DependsOn(AccountPasswordStoreFactory::GetInstance());
DependsOn(SyncServiceFactory::GetInstance());
DependsOn(PasswordsPrivateEventRouterFactory::GetInstance());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ PasswordsPrivateDelegateImpl::PasswordsPrivateDelegateImpl(Profile* profile)
: profile_(profile),
saved_passwords_presenter_(
AffiliationServiceFactory::GetForProfile(profile),
PasswordStoreFactory::GetForProfile(
ProfilePasswordStoreFactory::GetForProfile(
profile,
ServiceAccessType::EXPLICIT_ACCESS),
AccountPasswordStoreFactory::GetForProfile(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void SafeBrowsingPrivateApiUnitTest::SetUp() {
params.window = browser_window_.get();
browser_ = std::unique_ptr<Browser>(Browser::Create(params));

PasswordStoreFactory::GetInstance()->SetTestingFactoryAndUse(
ProfilePasswordStoreFactory::GetInstance()->SetTestingFactoryAndUse(
profile(),
base::BindRepeating(
&password_manager::BuildPasswordStoreInterface<
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/importer/profile_writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ void ProfileWriter::AddPasswordForm(

if (profile_->GetPrefs()->GetBoolean(
password_manager::prefs::kCredentialsEnableService)) {
PasswordStoreFactory::GetForProfile(profile_,
ServiceAccessType::EXPLICIT_ACCESS)
ProfilePasswordStoreFactory::GetForProfile(
profile_, ServiceAccessType::EXPLICIT_ACCESS)
->AddLogin(form);
}
}
Expand Down
10 changes: 6 additions & 4 deletions chrome/browser/password_check/android/password_check_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,17 +206,19 @@ class PasswordCheckManager
// passwords.
password_manager::SavedPasswordsPresenter saved_passwords_presenter_{
AffiliationServiceFactory::GetForProfile(profile_),
PasswordStoreFactory::GetForProfile(profile_,
ServiceAccessType::EXPLICIT_ACCESS),
ProfilePasswordStoreFactory::GetForProfile(
profile_,
ServiceAccessType::EXPLICIT_ACCESS),
AccountPasswordStoreFactory::GetForProfile(
profile_,
ServiceAccessType::EXPLICIT_ACCESS)};

// Used to obtain the list of insecure credentials.
password_manager::InsecureCredentialsManager insecure_credentials_manager_{
&saved_passwords_presenter_,
PasswordStoreFactory::GetForProfile(profile_,
ServiceAccessType::EXPLICIT_ACCESS),
ProfilePasswordStoreFactory::GetForProfile(
profile_,
ServiceAccessType::EXPLICIT_ACCESS),
AccountPasswordStoreFactory::GetForProfile(
profile_,
ServiceAccessType::EXPLICIT_ACCESS)};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ class PasswordStoreBridge
base::android::ScopedJavaGlobalRef<jobject> java_bridge_;

scoped_refptr<password_manager::PasswordStoreInterface> profile_store_ =
PasswordStoreFactory::GetForProfile(ProfileManager::GetLastUsedProfile(),
ServiceAccessType::EXPLICIT_ACCESS);
ProfilePasswordStoreFactory::GetForProfile(
ProfileManager::GetLastUsedProfile(),
ServiceAccessType::EXPLICIT_ACCESS);

// Used to fetch and edit passwords.
// TODO(crbug.com/1442826): Use PasswordStore directly.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,9 @@ class PasswordUIViewAndroid

// Pointer to the password store, powering |saved_passwords_presenter_|.
scoped_refptr<password_manager::PasswordStoreInterface> profile_store_ =
PasswordStoreFactory::GetForProfile(ProfileManager::GetLastUsedProfile(),
ServiceAccessType::EXPLICIT_ACCESS);
ProfilePasswordStoreFactory::GetForProfile(
ProfileManager::GetLastUsedProfile(),
ServiceAccessType::EXPLICIT_ACCESS);

// Manages the list of saved passwords, including updates.
password_manager::SavedPasswordsPresenter saved_passwords_presenter_{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -687,8 +687,8 @@ password_manager::PasswordStoreInterface*
ChromePasswordManagerClient::GetProfilePasswordStore() const {
// Always use EXPLICIT_ACCESS as the password manager checks IsOffTheRecord
// itself when it shouldn't access the PasswordStore.
return PasswordStoreFactory::GetForProfile(profile_,
ServiceAccessType::EXPLICIT_ACCESS)
return ProfilePasswordStoreFactory::GetForProfile(
profile_, ServiceAccessType::EXPLICIT_ACCESS)
.get();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ class ChromePasswordManagerClientTest : public ChromeRenderViewHostTestHarness {
void ChromePasswordManagerClientTest::SetUp() {
ChromeRenderViewHostTestHarness::SetUp();

PasswordStoreFactory::GetInstance()->SetTestingFactory(
ProfilePasswordStoreFactory::GetInstance()->SetTestingFactory(
GetBrowserContext(),
base::BindRepeating(&password_manager::BuildPasswordStoreInterface<
content::BrowserContext,
Expand Down Expand Up @@ -805,7 +805,7 @@ class ChromePasswordManagerClientSchemeTest
public:
void SetUp() override {
ChromePasswordManagerClientTest::SetUp();
PasswordStoreFactory::GetInstance()->SetTestingFactory(
ProfilePasswordStoreFactory::GetInstance()->SetTestingFactory(
GetBrowserContext(),
base::BindRepeating(&password_manager::BuildPasswordStoreInterface<
content::BrowserContext,
Expand Down Expand Up @@ -1116,7 +1116,7 @@ class ChromePasswordManagerClientAndroidTest

void ChromePasswordManagerClientAndroidTest::SetUp() {
ChromePasswordManagerClientTest::SetUp();
PasswordStoreFactory::GetInstance()->SetTestingFactory(
ProfilePasswordStoreFactory::GetInstance()->SetTestingFactory(
GetBrowserContext(),
base::BindRepeating(
&password_manager::BuildPasswordStoreInterface<
Expand Down

0 comments on commit 034bac8

Please sign in to comment.