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

Convert chromeos/services/device_sync/* to OnPrimaryAccountChanged()

Method OnUnconsentedPrimaryAccountSet is deprecated, so this CL changes
the chromeos/services/device_sync/* to override the method
OnPrimaryAccountChanged().

Bug: 1158855
Change-Id: Ie65d5c846c5c035c09a805a87f088a3ade653e43
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2624628Reviewed-by: default avatarTanmoy Mollik <triploblastic@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Commit-Queue: Mihai Sardarescu <msarda@chromium.org>
Cr-Commit-Position: refs/heads/master@{#842721}
parent afe462df
...@@ -783,14 +783,20 @@ void DeviceSyncImpl::Shutdown() { ...@@ -783,14 +783,20 @@ void DeviceSyncImpl::Shutdown() {
clock_ = nullptr; clock_ = nullptr;
} }
void DeviceSyncImpl::OnUnconsentedPrimaryAccountChanged( void DeviceSyncImpl::OnPrimaryAccountChanged(
const CoreAccountInfo& primary_account_info) { const signin::PrimaryAccountChangeEvent& event) {
PA_LOG(VERBOSE) << "DeviceSyncImpl: OnUnconsentedPrimaryAccountChanged"; PA_LOG(VERBOSE) << "DeviceSyncImpl: OnPrimaryAccountChanged";
// We're only interested when the account is set. switch (event.GetEventTypeFor(signin::ConsentLevel::kNotRequired)) {
if (primary_account_info.account_id.empty()) case signin::PrimaryAccountChangeEvent::Type::kSet:
return; identity_manager_->RemoveObserver(this);
identity_manager_->RemoveObserver(this); ProcessPrimaryAccountInfo(event.GetCurrentState().primary_account);
ProcessPrimaryAccountInfo(primary_account_info); break;
case signin::PrimaryAccountChangeEvent::Type::kCleared:
FALLTHROUGH;
case signin::PrimaryAccountChangeEvent::Type::kNone:
// Ignored
break;
}
} }
void DeviceSyncImpl::RunNextInitializationStep() { void DeviceSyncImpl::RunNextInitializationStep() {
......
...@@ -219,8 +219,8 @@ class DeviceSyncImpl : public DeviceSyncBase, ...@@ -219,8 +219,8 @@ class DeviceSyncImpl : public DeviceSyncBase,
void Shutdown() override; void Shutdown() override;
// signin::IdentityManager::Observer: // signin::IdentityManager::Observer:
void OnUnconsentedPrimaryAccountChanged( void OnPrimaryAccountChanged(
const CoreAccountInfo& primary_account_info) override; const signin::PrimaryAccountChangeEvent& event) override;
// Initialization functions. // Initialization functions.
void RunNextInitializationStep(); void RunNextInitializationStep();
......
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