Migrate password_manager/android classes to PasswordStoreInterface.
PasswordStoreInterface is an interface that should be used by other
classes instead of interacting directly with PasswordStore.
Bug: 1218413
Change-Id: I360885468d978739405dc9a9446514f29b6c302c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3198174
Reviewed-by: Ioana Pandele <ioanap@chromium.org>
Commit-Queue: Maria Kazinova <kazinova@google.com>
Cr-Commit-Position: refs/heads/main@{#927681}
diff --git a/chrome/browser/password_manager/android/all_passwords_bottom_sheet_controller.cc b/chrome/browser/password_manager/android/all_passwords_bottom_sheet_controller.cc
index a7a57580..0ef5381 100644
--- a/chrome/browser/password_manager/android/all_passwords_bottom_sheet_controller.cc
+++ b/chrome/browser/password_manager/android/all_passwords_bottom_sheet_controller.cc
@@ -15,7 +15,7 @@
#include "components/password_manager/core/browser/password_manager_client.h"
#include "components/password_manager/core/browser/password_manager_driver.h"
#include "components/password_manager/core/browser/password_manager_util.h"
-#include "components/password_manager/core/browser/password_store.h"
+#include "components/password_manager/core/browser/password_store_interface.h"
#include "components/password_manager/core/common/password_manager_features.h"
#include "content/public/browser/web_contents.h"
diff --git a/chrome/browser/password_manager/android/all_passwords_bottom_sheet_helper.cc b/chrome/browser/password_manager/android/all_passwords_bottom_sheet_helper.cc
index 7105e71..bd51afd 100644
--- a/chrome/browser/password_manager/android/all_passwords_bottom_sheet_helper.cc
+++ b/chrome/browser/password_manager/android/all_passwords_bottom_sheet_helper.cc
@@ -7,7 +7,7 @@
#include "base/functional/not_fn.h"
#include "base/ranges/algorithm.h"
#include "components/password_manager/core/browser/password_form.h"
-#include "components/password_manager/core/browser/password_store.h"
+#include "components/password_manager/core/browser/password_store_interface.h"
AllPasswordsBottomSheetHelper::AllPasswordsBottomSheetHelper(
password_manager::PasswordStoreInterface* store) {
diff --git a/chrome/browser/password_manager/android/password_store_bridge.h b/chrome/browser/password_manager/android/password_store_bridge.h
index 20e6042..aac36d9 100644
--- a/chrome/browser/password_manager/android/password_store_bridge.h
+++ b/chrome/browser/password_manager/android/password_store_bridge.h
@@ -13,7 +13,7 @@
#include "chrome/browser/password_manager/password_store_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
-#include "components/password_manager/core/browser/password_store.h"
+#include "components/password_manager/core/browser/password_store_interface.h"
#include "components/password_manager/core/browser/ui/saved_passwords_presenter.h"
class PasswordStoreBridge
@@ -66,9 +66,10 @@
base::android::ScopedJavaGlobalRef<jobject> java_bridge_;
// Handle to the password store, powering `saved_passwords_presenter_`.
- scoped_refptr<password_manager::PasswordStore> password_store_ =
- PasswordStoreFactory::GetForProfile(ProfileManager::GetLastUsedProfile(),
- ServiceAccessType::EXPLICIT_ACCESS);
+ scoped_refptr<password_manager::PasswordStoreInterface> password_store_ =
+ PasswordStoreFactory::GetInterfaceForProfile(
+ ProfileManager::GetLastUsedProfile(),
+ ServiceAccessType::EXPLICIT_ACCESS);
// Used to fetch and edit passwords.
password_manager::SavedPasswordsPresenter saved_passwords_presenter_{
diff --git a/chrome/browser/password_manager/android/password_ui_view_android.h b/chrome/browser/password_manager/android/password_ui_view_android.h
index 31ea4b9..0dc61ac 100644
--- a/chrome/browser/password_manager/android/password_ui_view_android.h
+++ b/chrome/browser/password_manager/android/password_ui_view_android.h
@@ -163,9 +163,10 @@
PasswordManagerPresenter password_manager_presenter_;
// Handle to the password store, powering `saved_passwords_presenter_`
- scoped_refptr<password_manager::PasswordStore> password_store_ =
- PasswordStoreFactory::GetForProfile(ProfileManager::GetLastUsedProfile(),
- ServiceAccessType::EXPLICIT_ACCESS);
+ scoped_refptr<password_manager::PasswordStoreInterface> password_store_ =
+ PasswordStoreFactory::GetInterfaceForProfile(
+ ProfileManager::GetLastUsedProfile(),
+ ServiceAccessType::EXPLICIT_ACCESS);
// Manages the list of saved passwords, including updates.
password_manager::SavedPasswordsPresenter saved_passwords_presenter_{