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

Convert components/sync/driver/* to OnPrimaryAccountChanged()

Methods OnPrimaryAccountSet/Cleared are deprecated. So this cl changes
these calls to OnPrimaryAccountChanged().

Bug: 1158855
Change-Id: Ia5fbd1ca486465badad539093f18e5cf98bdccc7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2611739
Commit-Queue: Tanmoy Mollik <triploblastic@chromium.org>
Reviewed-by: default avatarColin Blundell <blundell@chromium.org>
Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Cr-Commit-Position: refs/heads/master@{#841080}
parent d9ef4db1
......@@ -279,15 +279,18 @@ void SyncAuthManager::ConnectionClosed() {
connection_open_ = false;
}
void SyncAuthManager::OnPrimaryAccountSet(
const CoreAccountInfo& primary_account_info) {
UpdateSyncAccountIfNecessary();
}
void SyncAuthManager::OnPrimaryAccountCleared(
const CoreAccountInfo& previous_primary_account_info) {
UMA_HISTOGRAM_ENUMERATION("Sync.StopSource", SIGN_OUT, STOP_SOURCE_LIMIT);
UpdateSyncAccountIfNecessary();
void SyncAuthManager::OnPrimaryAccountChanged(
const signin::PrimaryAccountChangeEvent& event) {
switch (event.GetEventTypeFor(signin::ConsentLevel::kSync)) {
case signin::PrimaryAccountChangeEvent::Type::kCleared:
UMA_HISTOGRAM_ENUMERATION("Sync.StopSource", SIGN_OUT, STOP_SOURCE_LIMIT);
FALLTHROUGH;
case signin::PrimaryAccountChangeEvent::Type::kSet:
UpdateSyncAccountIfNecessary();
break;
case signin::PrimaryAccountChangeEvent::Type::kNone:
break;
}
}
void SyncAuthManager::OnRefreshTokenUpdatedForAccount(
......
......@@ -105,10 +105,8 @@ class SyncAuthManager : public signin::IdentityManager::Observer {
void ConnectionClosed();
// signin::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) override;
void OnRefreshTokenUpdatedForAccount(
const CoreAccountInfo& account_info) override;
void OnRefreshTokenRemovedForAccount(
......
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