| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" | 5 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/sys_info.h" | 9 #include "base/sys_info.h" |
| 10 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" | 10 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
| 11 #include "chrome/browser/chromeos/login/users/chrome_user_manager_util.h" | 11 #include "chrome/browser/chromeos/login/users/chrome_user_manager_util.h" |
| 12 #include "chrome/browser/chromeos/login/users/fake_supervised_user_manager.h" | 12 #include "chrome/browser/chromeos/login/users/fake_supervised_user_manager.h" |
| 13 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" | 13 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" |
| 14 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 14 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 15 #include "chrome/browser/chromeos/settings/cros_settings.h" | 15 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 16 #include "chrome/grit/theme_resources.h" | 16 #include "chrome/grit/theme_resources.h" |
| 17 #include "chromeos/chromeos_switches.h" | 17 #include "chromeos/chromeos_switches.h" |
| 18 #include "chromeos/login/login_state.h" | 18 #include "chromeos/login/login_state.h" |
| 19 #include "chromeos/login/user_names.h" | |
| 20 #include "components/user_manager/user_image/user_image.h" | 19 #include "components/user_manager/user_image/user_image.h" |
| 20 #include "components/user_manager/user_names.h" |
| 21 #include "components/user_manager/user_type.h" | 21 #include "components/user_manager/user_type.h" |
| 22 #include "ui/base/resource/resource_bundle.h" | 22 #include "ui/base/resource/resource_bundle.h" |
| 23 #include "ui/gfx/image/image_skia.h" | 23 #include "ui/gfx/image/image_skia.h" |
| 24 | 24 |
| 25 namespace chromeos { | 25 namespace chromeos { |
| 26 | 26 |
| 27 class FakeSupervisedUserManager; | 27 class FakeSupervisedUserManager; |
| 28 | 28 |
| 29 FakeChromeUserManager::FakeChromeUserManager() | 29 FakeChromeUserManager::FakeChromeUserManager() |
| 30 : supervised_user_manager_(new FakeSupervisedUserManager), | 30 : supervised_user_manager_(new FakeSupervisedUserManager), |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 | 223 |
| 224 bool FakeChromeUserManager::GetPlatformKnownUserId( | 224 bool FakeChromeUserManager::GetPlatformKnownUserId( |
| 225 const std::string& user_email, | 225 const std::string& user_email, |
| 226 const std::string& gaia_id, | 226 const std::string& gaia_id, |
| 227 AccountId* out_account_id) const { | 227 AccountId* out_account_id) const { |
| 228 return chrome_user_manager_util::GetPlatformKnownUserId(user_email, gaia_id, | 228 return chrome_user_manager_util::GetPlatformKnownUserId(user_email, gaia_id, |
| 229 out_account_id); | 229 out_account_id); |
| 230 } | 230 } |
| 231 | 231 |
| 232 const AccountId& FakeChromeUserManager::GetGuestAccountId() const { | 232 const AccountId& FakeChromeUserManager::GetGuestAccountId() const { |
| 233 return login::GuestAccountId(); | 233 return user_manager::chromeos::GuestAccountId(); |
| 234 } | 234 } |
| 235 | 235 |
| 236 bool FakeChromeUserManager::IsFirstExecAfterBoot() const { | 236 bool FakeChromeUserManager::IsFirstExecAfterBoot() const { |
| 237 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 237 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 238 chromeos::switches::kFirstExecAfterBoot); | 238 chromeos::switches::kFirstExecAfterBoot); |
| 239 } | 239 } |
| 240 | 240 |
| 241 void FakeChromeUserManager::AsyncRemoveCryptohome( | 241 void FakeChromeUserManager::AsyncRemoveCryptohome( |
| 242 const AccountId& account_id) const { | 242 const AccountId& account_id) const { |
| 243 NOTIMPLEMENTED(); | 243 NOTIMPLEMENTED(); |
| 244 } | 244 } |
| 245 | 245 |
| 246 bool FakeChromeUserManager::IsGuestAccountId( | 246 bool FakeChromeUserManager::IsGuestAccountId( |
| 247 const AccountId& account_id) const { | 247 const AccountId& account_id) const { |
| 248 return account_id == login::GuestAccountId(); | 248 return account_id == user_manager::chromeos::GuestAccountId(); |
| 249 } | 249 } |
| 250 | 250 |
| 251 bool FakeChromeUserManager::IsStubAccountId(const AccountId& account_id) const { | 251 bool FakeChromeUserManager::IsStubAccountId(const AccountId& account_id) const { |
| 252 return account_id == login::StubAccountId(); | 252 return account_id == user_manager::chromeos::StubAccountId(); |
| 253 } | 253 } |
| 254 | 254 |
| 255 bool FakeChromeUserManager::IsSupervisedAccountId( | 255 bool FakeChromeUserManager::IsSupervisedAccountId( |
| 256 const AccountId& account_id) const { | 256 const AccountId& account_id) const { |
| 257 return gaia::ExtractDomainName(account_id.GetUserEmail()) == | 257 return gaia::ExtractDomainName(account_id.GetUserEmail()) == |
| 258 chromeos::login::kSupervisedUserDomain; | 258 user_manager::chromeos::kSupervisedUserDomain; |
| 259 } | 259 } |
| 260 | 260 |
| 261 bool FakeChromeUserManager::HasBrowserRestarted() const { | 261 bool FakeChromeUserManager::HasBrowserRestarted() const { |
| 262 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 262 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 263 return base::SysInfo::IsRunningOnChromeOS() && | 263 return base::SysInfo::IsRunningOnChromeOS() && |
| 264 command_line->HasSwitch(chromeos::switches::kLoginUser); | 264 command_line->HasSwitch(chromeos::switches::kLoginUser); |
| 265 } | 265 } |
| 266 | 266 |
| 267 const gfx::ImageSkia& FakeChromeUserManager::GetResourceImagekiaNamed( | 267 const gfx::ImageSkia& FakeChromeUserManager::GetResourceImagekiaNamed( |
| 268 int id) const { | 268 int id) const { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 281 NOTIMPLEMENTED(); | 281 NOTIMPLEMENTED(); |
| 282 return; | 282 return; |
| 283 } | 283 } |
| 284 | 284 |
| 285 bool FakeChromeUserManager::IsValidDefaultUserImageId(int image_index) const { | 285 bool FakeChromeUserManager::IsValidDefaultUserImageId(int image_index) const { |
| 286 NOTIMPLEMENTED(); | 286 NOTIMPLEMENTED(); |
| 287 return false; | 287 return false; |
| 288 } | 288 } |
| 289 | 289 |
| 290 } // namespace chromeos | 290 } // namespace chromeos |
| OLD | NEW |