Commit 352587cd authored by Mihai Sardarescu's avatar Mihai Sardarescu Committed by Chromium LUCI CQ

Convert c/b/password_manager/ to OnPrimaryAccountChanged()

Methods OnPrimaryAccountSet/Cleared() are deprecated, so this CL changes
the chrome/browser/password_manager/* to override the method
OnPrimaryAccountChanged().

Bug: 1163126
Change-Id: I1357bc6a398089f71ba72363a0b2f24e4a7c7c9c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2611084
Auto-Submit: Mihai Sardarescu <msarda@chromium.org>
Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Reviewed-by: default avatarTanmoy Mollik <triploblastic@chromium.org>
Commit-Queue: Marc Treib <treib@chromium.org>
Commit-Queue: Mihai Sardarescu <msarda@chromium.org>
Cr-Commit-Position: refs/heads/master@{#841473}
parent 8d89ce86
......@@ -141,14 +141,16 @@ void GeneratedPasswordLeakDetectionPref::IdentityManagerShutdown(
identity_manager_observer_.RemoveAll();
}
void GeneratedPasswordLeakDetectionPref::OnPrimaryAccountSet(
const CoreAccountInfo& primary_account_info) {
NotifyObservers(kGeneratedPasswordLeakDetectionPref);
}
void GeneratedPasswordLeakDetectionPref::OnPrimaryAccountCleared(
const CoreAccountInfo& previous_primary_account_info) {
NotifyObservers(kGeneratedPasswordLeakDetectionPref);
void GeneratedPasswordLeakDetectionPref::OnPrimaryAccountChanged(
const signin::PrimaryAccountChangeEvent& event_details) {
switch (event_details.GetEventTypeFor(signin::ConsentLevel::kSync)) {
case signin::PrimaryAccountChangeEvent::Type::kSet:
case signin::PrimaryAccountChangeEvent::Type::kCleared:
NotifyObservers(kGeneratedPasswordLeakDetectionPref);
break;
case signin::PrimaryAccountChangeEvent::Type::kNone:
break;
}
}
void GeneratedPasswordLeakDetectionPref::OnExtendedAccountInfoUpdated(
......
......@@ -39,10 +39,8 @@ class GeneratedPasswordLeakDetectionPref
void OnSourcePreferencesChanged();
// IdentityManager::Observer implementation.
void OnPrimaryAccountSet(
const CoreAccountInfo& primary_account_info) override;
void OnPrimaryAccountCleared(
const CoreAccountInfo& previous_primary_account_info) override;
void OnPrimaryAccountChanged(
const signin::PrimaryAccountChangeEvent& event_details) override;
void OnExtendedAccountInfoUpdated(const AccountInfo& info) override;
void OnExtendedAccountInfoRemoved(const AccountInfo& info) override;
......
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