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() { ...@@ -279,15 +279,18 @@ void SyncAuthManager::ConnectionClosed() {
connection_open_ = false; connection_open_ = false;
} }
void SyncAuthManager::OnPrimaryAccountSet( void SyncAuthManager::OnPrimaryAccountChanged(
const CoreAccountInfo& primary_account_info) { const signin::PrimaryAccountChangeEvent& event) {
UpdateSyncAccountIfNecessary(); switch (event.GetEventTypeFor(signin::ConsentLevel::kSync)) {
} case signin::PrimaryAccountChangeEvent::Type::kCleared:
UMA_HISTOGRAM_ENUMERATION("Sync.StopSource", SIGN_OUT, STOP_SOURCE_LIMIT);
void SyncAuthManager::OnPrimaryAccountCleared( FALLTHROUGH;
const CoreAccountInfo& previous_primary_account_info) { case signin::PrimaryAccountChangeEvent::Type::kSet:
UMA_HISTOGRAM_ENUMERATION("Sync.StopSource", SIGN_OUT, STOP_SOURCE_LIMIT); UpdateSyncAccountIfNecessary();
UpdateSyncAccountIfNecessary(); break;
case signin::PrimaryAccountChangeEvent::Type::kNone:
break;
}
} }
void SyncAuthManager::OnRefreshTokenUpdatedForAccount( void SyncAuthManager::OnRefreshTokenUpdatedForAccount(
......
...@@ -105,10 +105,8 @@ class SyncAuthManager : public signin::IdentityManager::Observer { ...@@ -105,10 +105,8 @@ class SyncAuthManager : public signin::IdentityManager::Observer {
void ConnectionClosed(); void ConnectionClosed();
// signin::IdentityManager::Observer implementation. // signin::IdentityManager::Observer implementation.
void OnPrimaryAccountSet( void OnPrimaryAccountChanged(
const CoreAccountInfo& primary_account_info) override; const signin::PrimaryAccountChangeEvent& event) override;
void OnPrimaryAccountCleared(
const CoreAccountInfo& previous_primary_account_info) override;
void OnRefreshTokenUpdatedForAccount( void OnRefreshTokenUpdatedForAccount(
const CoreAccountInfo& account_info) override; const CoreAccountInfo& account_info) override;
void OnRefreshTokenRemovedForAccount( 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