Commit 7ce0bebc authored by Tanmoy Mollik's avatar Tanmoy Mollik Committed by Chromium LUCI CQ

Convert components/password_manager/core/* to OnPrimaryAccountChanged()

Method OnPrimaryAccountCleared is deprecated. So this cl changes
these calls to OnPrimaryAccountChanged()

Bug: 1158855
Change-Id: I56ea44e66fdd91f9cf81eae822233d792e6927c7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2622532Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Reviewed-by: default avatarColin Blundell <blundell@chromium.org>
Commit-Queue: Mihai Sardarescu <msarda@chromium.org>
Cr-Commit-Position: refs/heads/master@{#842962}
parent 19e75e67
...@@ -48,9 +48,13 @@ void PasswordStoreSigninNotifierImpl::NotifySignedOut( ...@@ -48,9 +48,13 @@ void PasswordStoreSigninNotifierImpl::NotifySignedOut(
} }
// IdentityManager::Observer implementation. // IdentityManager::Observer implementation.
void PasswordStoreSigninNotifierImpl::OnPrimaryAccountCleared( void PasswordStoreSigninNotifierImpl::OnPrimaryAccountChanged(
const CoreAccountInfo& account_info) { const signin::PrimaryAccountChangeEvent& event) {
NotifySignedOut(account_info.email, /* primary_account= */ true); if (event.GetEventTypeFor(signin::ConsentLevel::kSync) ==
signin::PrimaryAccountChangeEvent::Type::kCleared) {
NotifySignedOut(event.GetPreviousState().primary_account.email,
/* primary_account= */ true);
}
} }
// IdentityManager::Observer implementation. // IdentityManager::Observer implementation.
......
...@@ -32,7 +32,8 @@ class PasswordStoreSigninNotifierImpl ...@@ -32,7 +32,8 @@ class PasswordStoreSigninNotifierImpl
void UnsubscribeFromSigninEvents() override; void UnsubscribeFromSigninEvents() override;
// IdentityManager::Observer implementations. // IdentityManager::Observer implementations.
void OnPrimaryAccountCleared(const CoreAccountInfo& account_info) override; void OnPrimaryAccountChanged(
const signin::PrimaryAccountChangeEvent& event) override;
void OnExtendedAccountInfoRemoved(const AccountInfo& info) override; void OnExtendedAccountInfoRemoved(const AccountInfo& info) override;
private: private:
......
...@@ -183,15 +183,18 @@ void PasswordModelTypeController::OnAccountsCookieDeletedByUserAction() { ...@@ -183,15 +183,18 @@ void PasswordModelTypeController::OnAccountsCookieDeletedByUserAction() {
features_util::ClearAccountStorageSettingsForAllUsers(pref_service_); features_util::ClearAccountStorageSettingsForAllUsers(pref_service_);
} }
void PasswordModelTypeController::OnPrimaryAccountCleared( void PasswordModelTypeController::OnPrimaryAccountChanged(
const CoreAccountInfo& previous_primary_account_info) { const signin::PrimaryAccountChangeEvent& event) {
// Note: OnPrimaryAccountCleared() basically means that the consent for if (event.GetEventTypeFor(signin::ConsentLevel::kSync) ==
// Sync-the-feature was revoked. In this case, also clear any possible signin::PrimaryAccountChangeEvent::Type::kCleared) {
// matching opt-in for the account-scoped storage, since it'd probably be // Note: kCleared event for ConsentLevel::kSync basically means that the
// surprising to the user if their account passwords still remained after // consent for Sync-the-feature was revoked. In this case, also clear any
// disabling Sync. // possible matching opt-in for the account-scoped storage, since it'd
features_util::OptOutOfAccountStorageAndClearSettingsForAccount( // probably be surprising to the user if their account passwords still
pref_service_, previous_primary_account_info.gaia); // remained after disabling Sync.
features_util::OptOutOfAccountStorageAndClearSettingsForAccount(
pref_service_, event.GetPreviousState().primary_account.gaia);
}
} }
void PasswordModelTypeController::OnOptInStateMaybeChanged() { void PasswordModelTypeController::OnOptInStateMaybeChanged() {
......
...@@ -59,8 +59,8 @@ class PasswordModelTypeController : public syncer::ModelTypeController, ...@@ -59,8 +59,8 @@ class PasswordModelTypeController : public syncer::ModelTypeController,
const signin::AccountsInCookieJarInfo& accounts_in_cookie_jar_info, const signin::AccountsInCookieJarInfo& accounts_in_cookie_jar_info,
const GoogleServiceAuthError& error) override; const GoogleServiceAuthError& error) override;
void OnAccountsCookieDeletedByUserAction() override; void OnAccountsCookieDeletedByUserAction() override;
void OnPrimaryAccountCleared( void OnPrimaryAccountChanged(
const CoreAccountInfo& previous_primary_account_info) override; const signin::PrimaryAccountChangeEvent& event) override;
private: private:
void OnOptInStateMaybeChanged(); void OnOptInStateMaybeChanged();
......
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