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() {
clock_ = nullptr;
}
void DeviceSyncImpl::OnUnconsentedPrimaryAccountChanged(
const CoreAccountInfo& primary_account_info) {
PA_LOG(VERBOSE) << "DeviceSyncImpl: OnUnconsentedPrimaryAccountChanged";
// We're only interested when the account is set.
if (primary_account_info.account_id.empty())
return;
void DeviceSyncImpl::OnPrimaryAccountChanged(
const signin::PrimaryAccountChangeEvent& event) {
PA_LOG(VERBOSE) << "DeviceSyncImpl: OnPrimaryAccountChanged";
switch (event.GetEventTypeFor(signin::ConsentLevel::kNotRequired)) {
case signin::PrimaryAccountChangeEvent::Type::kSet:
identity_manager_->RemoveObserver(this);
ProcessPrimaryAccountInfo(primary_account_info);
ProcessPrimaryAccountInfo(event.GetCurrentState().primary_account);
break;
case signin::PrimaryAccountChangeEvent::Type::kCleared:
FALLTHROUGH;
case signin::PrimaryAccountChangeEvent::Type::kNone:
// Ignored
break;
}
}
void DeviceSyncImpl::RunNextInitializationStep() {
......
......@@ -219,8 +219,8 @@ class DeviceSyncImpl : public DeviceSyncBase,
void Shutdown() override;
// signin::IdentityManager::Observer:
void OnUnconsentedPrimaryAccountChanged(
const CoreAccountInfo& primary_account_info) override;
void OnPrimaryAccountChanged(
const signin::PrimaryAccountChangeEvent& event) override;
// Initialization functions.
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