Commit cac286db authored by Jiewei Qian's avatar Jiewei Qian Committed by Commit Bot

Revert "[ios][PhishGuard] Port code to ios_chrome_password_store_factory"

This reverts commit 8d720de8.

Reason for revert: Compile failure on ios-device

'components/password_manager/core/browser/password_store_signin_notifier_impl.h' file not found

https://ci.chromium.org/p/chromium/builders/ci/ios-device/172358

Original change's description:
> [ios][PhishGuard] Port code to ios_chrome_password_store_factory
>
> Design doc: go/bling-phishguard
>
> The password_store_factory had already been forked between
> //chrome and //ios. This CL ports password reuse detection code
> from //chrome into the //ios implementation.
>
> Runtime changes are behind the kPasswordReuseDetectionEnabled
> feature flag.
>
> Bug: 1147962
> Change-Id: Iaa5c31759383870753ab94aac14f798ab6634cfe
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2544748
> Commit-Queue: edchin <edchin@chromium.org>
> Reviewed-by: Vasilii Sukhanov <vasilii@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#828562}

TBR=vasilii@chromium.org,edchin@chromium.org

Change-Id: I2286176790447a0dc192c01a6f4a888699f77c70
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1147962
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2546302Reviewed-by: default avatarJiewei Qian  <qjw@chromium.org>
Commit-Queue: Jiewei Qian  <qjw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#828566}
parent 69bb24ec
...@@ -63,7 +63,6 @@ source_set("passwords") { ...@@ -63,7 +63,6 @@ source_set("passwords") {
"//components/password_manager/ios", "//components/password_manager/ios",
"//components/prefs", "//components/prefs",
"//components/security_state/core", "//components/security_state/core",
"//components/signin/public/identity_manager",
"//components/strings", "//components/strings",
"//components/sync", "//components/sync",
"//components/translate/core/browser:browser", "//components/translate/core/browser:browser",
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include "base/callback_helpers.h" #include "base/callback_helpers.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/feature_list.h"
#include "base/no_destructor.h" #include "base/no_destructor.h"
#include "base/sequenced_task_runner.h" #include "base/sequenced_task_runner.h"
#include "base/task/post_task.h" #include "base/task/post_task.h"
...@@ -21,39 +20,15 @@ ...@@ -21,39 +20,15 @@
#include "components/password_manager/core/browser/password_manager_util.h" #include "components/password_manager/core/browser/password_manager_util.h"
#include "components/password_manager/core/browser/password_store_default.h" #include "components/password_manager/core/browser/password_store_default.h"
#include "components/password_manager/core/browser/password_store_factory_util.h" #include "components/password_manager/core/browser/password_store_factory_util.h"
#include "components/password_manager/core/browser/password_store_signin_notifier_impl.h"
#include "components/password_manager/core/common/password_manager_features.h"
#include "components/signin/public/identity_manager/identity_manager.h"
#include "components/sync/driver/sync_service.h" #include "components/sync/driver/sync_service.h"
#include "ios/chrome/browser/application_context.h" #include "ios/chrome/browser/application_context.h"
#include "ios/chrome/browser/browser_state/browser_state_otr_helper.h" #include "ios/chrome/browser/browser_state/browser_state_otr_helper.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
#include "ios/chrome/browser/passwords/credentials_cleaner_runner_factory.h" #include "ios/chrome/browser/passwords/credentials_cleaner_runner_factory.h"
#include "ios/chrome/browser/signin/identity_manager_factory.h"
#include "ios/chrome/browser/sync/profile_sync_service_factory.h" #include "ios/chrome/browser/sync/profile_sync_service_factory.h"
#include "ios/chrome/browser/webdata_services/web_data_service_factory.h" #include "ios/chrome/browser/webdata_services/web_data_service_factory.h"
#include "services/network/public/cpp/shared_url_loader_factory.h" #include "services/network/public/cpp/shared_url_loader_factory.h"
namespace {
bool IsPasswordReuseDetectionEnabled() {
return base::FeatureList::IsEnabled(
password_manager::features::kPasswordReuseDetectionEnabled);
}
std::string GetSyncUsername(signin::IdentityManager* identity_manager) {
return identity_manager ? identity_manager->GetPrimaryAccountInfo().email
: std::string();
}
bool IsSignedIn(signin::IdentityManager* identity_manager) {
return identity_manager
? !identity_manager->GetAccountsWithRefreshTokens().empty()
: false;
}
} // namespace
// static // static
scoped_refptr<password_manager::PasswordStore> scoped_refptr<password_manager::PasswordStore>
IOSChromePasswordStoreFactory::GetForBrowserState( IOSChromePasswordStoreFactory::GetForBrowserState(
...@@ -94,12 +69,6 @@ IOSChromePasswordStoreFactory::IOSChromePasswordStoreFactory() ...@@ -94,12 +69,6 @@ IOSChromePasswordStoreFactory::IOSChromePasswordStoreFactory()
"PasswordStore", "PasswordStore",
BrowserStateDependencyManager::GetInstance()) { BrowserStateDependencyManager::GetInstance()) {
DependsOn(ios::WebDataServiceFactory::GetInstance()); DependsOn(ios::WebDataServiceFactory::GetInstance());
if (IsPasswordReuseDetectionEnabled()) {
// TODO(crbug.com/715987). Remove when PasswordReuseDetector is decoupled
// from PasswordStore.
DependsOn(IdentityManagerFactory::GetInstance());
}
} }
IOSChromePasswordStoreFactory::~IOSChromePasswordStoreFactory() {} IOSChromePasswordStoreFactory::~IOSChromePasswordStoreFactory() {}
...@@ -130,19 +99,6 @@ IOSChromePasswordStoreFactory::BuildServiceInstanceFor( ...@@ -130,19 +99,6 @@ IOSChromePasswordStoreFactory::BuildServiceInstanceFor(
LOG(WARNING) << "Could not initialize password store."; LOG(WARNING) << "Could not initialize password store.";
return nullptr; return nullptr;
} }
if (IsPasswordReuseDetectionEnabled()) {
signin::IdentityManager* identity_manager =
IdentityManagerFactory::GetForBrowserState(
ChromeBrowserState::FromBrowserState(context));
store->PreparePasswordHashData(GetSyncUsername(identity_manager),
IsSignedIn(identity_manager));
store->SetPasswordStoreSigninNotifier(
std::make_unique<password_manager::PasswordStoreSigninNotifierImpl>(
identity_manager));
}
password_manager_util::RemoveUselessCredentials( password_manager_util::RemoveUselessCredentials(
CredentialsCleanerRunnerFactory::GetForBrowserState(context), store, CredentialsCleanerRunnerFactory::GetForBrowserState(context), store,
ChromeBrowserState::FromBrowserState(context)->GetPrefs(), ChromeBrowserState::FromBrowserState(context)->GetPrefs(),
......
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