Commit 351a69fb authored by Mihai Sardarescu's avatar Mihai Sardarescu Committed by Chromium LUCI CQ

Remove OnUnconsentedPrimaryAccount()

The method OnUnconsentedPrimaryAccount() is obsolete now (as all
observers were converted to use OnPrimaryAccountChanged()) so this
CL removes it.

Bug: 1158855
Change-Id: Ice0ffc2b2f19597602837371ee05a71d27ee697f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2624668
Commit-Queue: Mihai Sardarescu <msarda@chromium.org>
Reviewed-by: default avatarTanmoy Mollik <triploblastic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#842929}
parent f8d1dd28
......@@ -490,14 +490,6 @@ void IdentityManager::OnPrimaryAccountChanged(
case PrimaryAccountChangeEvent::Type::kNone:
break;
}
switch (event_details.GetEventTypeFor(ConsentLevel::kNotRequired)) {
case PrimaryAccountChangeEvent::Type::kSet:
case PrimaryAccountChangeEvent::Type::kCleared:
FireUnconsentedPrimaryAccountChanged(event_details);
break;
case PrimaryAccountChangeEvent::Type::kNone:
break;
}
for (auto& observer : observer_list_)
observer.OnPrimaryAccountChanged(event_details);
......@@ -528,15 +520,6 @@ void IdentityManager::FirePrimaryAccountSet(
}
}
void IdentityManager::FireUnconsentedPrimaryAccountChanged(
const PrimaryAccountChangeEvent& event_details) {
const CoreAccountInfo& account_info =
event_details.GetCurrentState().primary_account;
for (auto& observer : observer_list_) {
observer.OnUnconsentedPrimaryAccountChanged(account_info);
}
}
void IdentityManager::FirePrimaryAccountCleared(
const PrimaryAccountChangeEvent& event_details) {
const CoreAccountInfo& account_info =
......
......@@ -101,22 +101,6 @@ class IdentityManager : public KeyedService,
// General observers should use |OnPrimaryAccountChanged|.
virtual void AfterSyncPrimaryAccountCleared() {}
// When the unconsented primary account (see ./README.md) of the user
// changes, this callback gets called with the new account as
// |unconsented_primary_account_info|. If after the change, there is no
// unconsented primary account, |unconsented_primary_account_info| is empty.
// This does not get called when the unconsented account becomes consented
// (as the same account was unconsented before so there is no change). In
// all other changes (the unconsented primary account gets added, changed or
// removed), this notification is called only once. Note: we do not use the
// {Set, Cleared} notifications like for the primary account above because
// the identity manager does not have clear guarantees that that account
// cannot change in one atomic operation (without getting cleared in the
// mean-time).
// DEPRECATED: Use OnPrimaryAccountChanged() instead.
virtual void OnUnconsentedPrimaryAccountChanged(
const CoreAccountInfo& unconsented_primary_account_info) {}
// Called when a new refresh token is associated with |account_info|.
// NOTE: On a signin event, the ordering of this callback wrt the
// OnPrimaryAccountSet() callback is undefined. If you as a client are
......@@ -679,8 +663,6 @@ class IdentityManager : public KeyedService,
// Fire the deprecated observer methods for settings and clearing the primary
// account.
void FirePrimaryAccountSet(const PrimaryAccountChangeEvent& event_details);
void FireUnconsentedPrimaryAccountChanged(
const PrimaryAccountChangeEvent& event_details);
void FirePrimaryAccountCleared(
const PrimaryAccountChangeEvent& event_details);
......
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