Chromium Code Reviews| Index: components/user_manager/user_names.cc |
| diff --git a/components/user_manager/user_names.cc b/components/user_manager/user_names.cc |
| index a7cd67b16ffc565d2db87e5cb77006a6a8834576..075341db353836f37ccf0e6c8a51ece7ada5d145 100644 |
| --- a/components/user_manager/user_names.cc |
| +++ b/components/user_manager/user_names.cc |
| @@ -6,7 +6,10 @@ |
| #include "base/macros.h" |
| #include "base/memory/singleton.h" |
| #include "components/signin/core/account_id/account_id.h" |
| -#include "google_apis/gaia/gaia_auth_util.h" |
| + |
| +#if defined(OS_CHROMEOS) |
| +#include "google_apis/gaia/gaia_auth_util.h" // nogncheck |
|
xiyuan
2016/10/27 18:25:59
Should we fix the deps in BUILD.gn instead of this
Alexander Alekseev
2016/10/28 11:10:25
Done.
|
| +#endif // OS_CHROMEOS |
| class AccountId; |
| @@ -56,21 +59,25 @@ namespace user_manager { |
| constexpr const char kStubUser[] = "stub-user@example.com"; |
| +#if defined(OS_CHROMEOS) |
| // Should match cros constant in platform/libchromeos/chromeos/cryptohome.h |
| constexpr const char kGuestUserName[] = "$guest"; |
| constexpr const char kSupervisedUserDomain[] = "locally-managed.localhost"; |
| +#endif // OS_CHROMEOS |
| + |
| +// StubAccountId is used for all tests, not only ChromeOS |
| +const AccountId& StubAccountId() { |
| + return FixedAccountManager::GetInstance()->stub_account_id(); |
| +} |
| +#if defined(OS_CHROMEOS) |
| std::string CanonicalizeUserID(const std::string& user_id) { |
| if (user_id == kGuestUserName) |
| return user_id; |
| return gaia::CanonicalizeEmail(user_id); |
| } |
| -const AccountId& StubAccountId() { |
| - return FixedAccountManager::GetInstance()->stub_account_id(); |
| -} |
| - |
| const AccountId& SignInAccountId() { |
| return FixedAccountManager::GetInstance()->signin_account_id(); |
| } |
| @@ -82,5 +89,6 @@ const AccountId& GuestAccountId() { |
| const AccountId& DemoAccountId() { |
| return FixedAccountManager::GetInstance()->demo_account_id(); |
| } |
| +#endif // OS_CHROMEOS |
| } // namespace user_manager |