| 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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 | 222 |
| 223 bool FakeChromeUserManager::GetPlatformKnownUserId( | 223 bool FakeChromeUserManager::GetPlatformKnownUserId( |
| 224 const std::string& user_email, | 224 const std::string& user_email, |
| 225 const std::string& gaia_id, | 225 const std::string& gaia_id, |
| 226 AccountId* out_account_id) const { | 226 AccountId* out_account_id) const { |
| 227 return chrome_user_manager_util::GetPlatformKnownUserId(user_email, gaia_id, | 227 return chrome_user_manager_util::GetPlatformKnownUserId(user_email, gaia_id, |
| 228 out_account_id); | 228 out_account_id); |
| 229 } | 229 } |
| 230 | 230 |
| 231 const AccountId& FakeChromeUserManager::GetGuestAccountId() const { | 231 const AccountId& FakeChromeUserManager::GetGuestAccountId() const { |
| 232 return login::GuestAccountId(); | 232 return user_manager::GuestAccountId(); |
| 233 } | 233 } |
| 234 | 234 |
| 235 bool FakeChromeUserManager::IsFirstExecAfterBoot() const { | 235 bool FakeChromeUserManager::IsFirstExecAfterBoot() const { |
| 236 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 236 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 237 chromeos::switches::kFirstExecAfterBoot); | 237 chromeos::switches::kFirstExecAfterBoot); |
| 238 } | 238 } |
| 239 | 239 |
| 240 void FakeChromeUserManager::AsyncRemoveCryptohome( | 240 void FakeChromeUserManager::AsyncRemoveCryptohome( |
| 241 const AccountId& account_id) const { | 241 const AccountId& account_id) const { |
| 242 NOTIMPLEMENTED(); | 242 NOTIMPLEMENTED(); |
| 243 } | 243 } |
| 244 | 244 |
| 245 bool FakeChromeUserManager::IsGuestAccountId( | 245 bool FakeChromeUserManager::IsGuestAccountId( |
| 246 const AccountId& account_id) const { | 246 const AccountId& account_id) const { |
| 247 return account_id == login::GuestAccountId(); | 247 return account_id == user_manager::GuestAccountId(); |
| 248 } | 248 } |
| 249 | 249 |
| 250 bool FakeChromeUserManager::IsStubAccountId(const AccountId& account_id) const { | 250 bool FakeChromeUserManager::IsStubAccountId(const AccountId& account_id) const { |
| 251 return account_id == login::StubAccountId(); | 251 return account_id == user_manager::StubAccountId(); |
| 252 } | 252 } |
| 253 | 253 |
| 254 bool FakeChromeUserManager::IsSupervisedAccountId( | 254 bool FakeChromeUserManager::IsSupervisedAccountId( |
| 255 const AccountId& account_id) const { | 255 const AccountId& account_id) const { |
| 256 return gaia::ExtractDomainName(account_id.GetUserEmail()) == | 256 return gaia::ExtractDomainName(account_id.GetUserEmail()) == |
| 257 chromeos::login::kSupervisedUserDomain; | 257 user_manager::kSupervisedUserDomain; |
| 258 } | 258 } |
| 259 | 259 |
| 260 bool FakeChromeUserManager::HasBrowserRestarted() const { | 260 bool FakeChromeUserManager::HasBrowserRestarted() const { |
| 261 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 261 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 262 return base::SysInfo::IsRunningOnChromeOS() && | 262 return base::SysInfo::IsRunningOnChromeOS() && |
| 263 command_line->HasSwitch(chromeos::switches::kLoginUser); | 263 command_line->HasSwitch(chromeos::switches::kLoginUser); |
| 264 } | 264 } |
| 265 | 265 |
| 266 const gfx::ImageSkia& FakeChromeUserManager::GetResourceImagekiaNamed( | 266 const gfx::ImageSkia& FakeChromeUserManager::GetResourceImagekiaNamed( |
| 267 int id) const { | 267 int id) const { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 280 NOTIMPLEMENTED(); | 280 NOTIMPLEMENTED(); |
| 281 return; | 281 return; |
| 282 } | 282 } |
| 283 | 283 |
| 284 bool FakeChromeUserManager::IsValidDefaultUserImageId(int image_index) const { | 284 bool FakeChromeUserManager::IsValidDefaultUserImageId(int image_index) const { |
| 285 NOTIMPLEMENTED(); | 285 NOTIMPLEMENTED(); |
| 286 return false; | 286 return false; |
| 287 } | 287 } |
| 288 | 288 |
| 289 } // namespace chromeos | 289 } // namespace chromeos |
| OLD | NEW |