Commit 20d92735 authored by Colin Blundell's avatar Colin Blundell Committed by Commit Bot

Prep building PrimaryAccountMutator::SetPrimaryAccount() on ChromeOS

In preparation for building PrimaryAccountMutator::SetPrimaryAccount()
on ChromeOS, this CL just does some reordering of the
PrimaryAccountMutator methods so that the followup CL can be as clear
as possible.

Bug: 967605
Change-Id: Id1860df04c384cc4f895c5eaeeb4f8c270709f61
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1695267Reviewed-by: default avatarKush Sinha <sinhak@chromium.org>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#676381}
parent c9d984e4
...@@ -49,6 +49,17 @@ bool PrimaryAccountMutatorImpl::SetPrimaryAccount( ...@@ -49,6 +49,17 @@ bool PrimaryAccountMutatorImpl::SetPrimaryAccount(
return true; return true;
} }
#else
bool PrimaryAccountMutatorImpl::SetPrimaryAccountAndUpdateAccountInfo(
const std::string& gaia_id,
const std::string& email) {
account_tracker_->SeedAccountInfo(gaia_id, email);
primary_account_manager_->SignIn(email);
return true;
}
#endif
#if !defined(OS_CHROMEOS)
bool PrimaryAccountMutatorImpl::ClearPrimaryAccount( bool PrimaryAccountMutatorImpl::ClearPrimaryAccount(
ClearAccountsAction action, ClearAccountsAction action,
signin_metrics::ProfileSignout source_metric, signin_metrics::ProfileSignout source_metric,
...@@ -72,14 +83,6 @@ bool PrimaryAccountMutatorImpl::ClearPrimaryAccount( ...@@ -72,14 +83,6 @@ bool PrimaryAccountMutatorImpl::ClearPrimaryAccount(
return true; return true;
} }
#else
bool PrimaryAccountMutatorImpl::SetPrimaryAccountAndUpdateAccountInfo(
const std::string& gaia_id,
const std::string& email) {
account_tracker_->SeedAccountInfo(gaia_id, email);
primary_account_manager_->SignIn(email);
return true;
}
#endif #endif
} // namespace identity } // namespace identity
...@@ -27,13 +27,15 @@ class PrimaryAccountMutatorImpl : public PrimaryAccountMutator { ...@@ -27,13 +27,15 @@ class PrimaryAccountMutatorImpl : public PrimaryAccountMutator {
// PrimaryAccountMutator implementation. // PrimaryAccountMutator implementation.
#if !defined(OS_CHROMEOS) #if !defined(OS_CHROMEOS)
bool SetPrimaryAccount(const CoreAccountId& account_id) override; bool SetPrimaryAccount(const CoreAccountId& account_id) override;
#else
bool SetPrimaryAccountAndUpdateAccountInfo(const std::string& gaia_id,
const std::string& email) override;
#endif
#if !defined(OS_CHROMEOS)
bool ClearPrimaryAccount( bool ClearPrimaryAccount(
ClearAccountsAction action, ClearAccountsAction action,
signin_metrics::ProfileSignout source_metric, signin_metrics::ProfileSignout source_metric,
signin_metrics::SignoutDelete delete_metric) override; signin_metrics::SignoutDelete delete_metric) override;
#else
bool SetPrimaryAccountAndUpdateAccountInfo(const std::string& gaia_id,
const std::string& email) override;
#endif #endif
private: private:
......
...@@ -54,13 +54,6 @@ class PrimaryAccountMutator { ...@@ -54,13 +54,6 @@ class PrimaryAccountMutator {
// - the account is known by the IdentityManager. // - the account is known by the IdentityManager.
virtual bool SetPrimaryAccount(const CoreAccountId& account_id) = 0; virtual bool SetPrimaryAccount(const CoreAccountId& account_id) = 0;
// Clears the primary account, and returns whether the operation
// succeeded or not. Depending on |action|, the other accounts
// known to the IdentityManager may be deleted.
virtual bool ClearPrimaryAccount(
ClearAccountsAction action,
signin_metrics::ProfileSignout source_metric,
signin_metrics::SignoutDelete delete_metric) = 0;
#else #else
// Updates the info of the account corresponding to (|gaia_id|, |email|), // Updates the info of the account corresponding to (|gaia_id|, |email|),
// marks it as the primary account, and returns whether the operation // marks it as the primary account, and returns whether the operation
...@@ -74,6 +67,16 @@ class PrimaryAccountMutator { ...@@ -74,6 +67,16 @@ class PrimaryAccountMutator {
const std::string& gaia_id, const std::string& gaia_id,
const std::string& email) = 0; const std::string& email) = 0;
#endif #endif
#if !defined(OS_CHROMEOS)
// Clears the primary account, and returns whether the operation
// succeeded or not. Depending on |action|, the other accounts
// known to the IdentityManager may be deleted.
virtual bool ClearPrimaryAccount(
ClearAccountsAction action,
signin_metrics::ProfileSignout source_metric,
signin_metrics::SignoutDelete delete_metric) = 0;
#endif
}; };
} // namespace identity } // namespace identity
......
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