Commit 13abb06e authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

Method returning whether account_id migration is supported

To allow tests to be written without depending on the side-effect
of the initialization of an AccountTrackerService, add a public
method returning whether migration of account_id is supported on
the current platform.

Bug: none
Change-Id: Ibe632d42378ad952ff92645598fc396cda3a2879
Reviewed-on: https://chromium-review.googlesource.com/1188577
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#586304}
parent 4d353269
...@@ -207,6 +207,15 @@ gfx::Image AccountTrackerService::GetAccountImage( ...@@ -207,6 +207,15 @@ gfx::Image AccountTrackerService::GetAccountImage(
: gfx::Image(); : gfx::Image();
} }
// static
bool AccountTrackerService::IsMigrationSupported() {
#if defined(OS_CHROMEOS)
return false;
#else
return true;
#endif
}
AccountTrackerService::AccountIdMigrationState AccountTrackerService::AccountIdMigrationState
AccountTrackerService::GetMigrationState() const { AccountTrackerService::GetMigrationState() const {
return GetMigrationState(pref_service_); return GetMigrationState(pref_service_);
...@@ -347,7 +356,9 @@ void AccountTrackerService::SetIsAdvancedProtectionAccount( ...@@ -347,7 +356,9 @@ void AccountTrackerService::SetIsAdvancedProtectionAccount(
} }
bool AccountTrackerService::IsMigratable() const { bool AccountTrackerService::IsMigratable() const {
#if !defined(OS_CHROMEOS) if (!IsMigrationSupported())
return false;
for (std::map<std::string, AccountState>::const_iterator it = for (std::map<std::string, AccountState>::const_iterator it =
accounts_.begin(); accounts_.begin();
it != accounts_.end(); ++it) { it != accounts_.end(); ++it) {
...@@ -356,9 +367,6 @@ bool AccountTrackerService::IsMigratable() const { ...@@ -356,9 +367,6 @@ bool AccountTrackerService::IsMigratable() const {
return false; return false;
} }
return true; return true;
#else
return false;
#endif
} }
void AccountTrackerService::MigrateToGaiaId() { void AccountTrackerService::MigrateToGaiaId() {
......
...@@ -129,6 +129,10 @@ class AccountTrackerService : public KeyedService { ...@@ -129,6 +129,10 @@ class AccountTrackerService : public KeyedService {
void RemoveAccount(const std::string& account_id); void RemoveAccount(const std::string& account_id);
// Is migration of the account id from normalized email to gaia id supported
// on the current platform?
static bool IsMigrationSupported();
AccountIdMigrationState GetMigrationState() const; AccountIdMigrationState GetMigrationState() const;
void SetMigrationDone(); void SetMigrationDone();
static AccountIdMigrationState GetMigrationState( static AccountIdMigrationState GetMigrationState(
......
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