| Index: chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc
|
| diff --git a/chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc b/chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc
|
| index 40e4a0eeb9cb5ec42faa6895249194246e10f292..a846b7aceb8c97cb7234cb148197be375bb9de1c 100644
|
| --- a/chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc
|
| +++ b/chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc
|
| @@ -206,13 +206,12 @@
|
| }
|
|
|
| UserImageManager* ChromeUserManagerImpl::GetUserImageManager(
|
| - const AccountId& account_id) {
|
| - UserImageManagerMap::iterator ui = user_image_managers_.find(account_id);
|
| + const std::string& user_id) {
|
| + UserImageManagerMap::iterator ui = user_image_managers_.find(user_id);
|
| if (ui != user_image_managers_.end())
|
| return ui->second.get();
|
| - linked_ptr<UserImageManagerImpl> mgr(
|
| - new UserImageManagerImpl(account_id.GetUserEmail(), this));
|
| - user_image_managers_[account_id] = mgr;
|
| + linked_ptr<UserImageManagerImpl> mgr(new UserImageManagerImpl(user_id, this));
|
| + user_image_managers_[user_id] = mgr;
|
| return mgr.get();
|
| }
|
|
|
| @@ -317,13 +316,15 @@
|
| }
|
|
|
| void ChromeUserManagerImpl::RemoveUserInternal(
|
| - const AccountId& account_id,
|
| + const std::string& user_email,
|
| user_manager::RemoveUserDelegate* delegate) {
|
| CrosSettings* cros_settings = CrosSettings::Get();
|
|
|
| const base::Closure& callback =
|
| base::Bind(&ChromeUserManagerImpl::RemoveUserInternal,
|
| - weak_factory_.GetWeakPtr(), account_id, delegate);
|
| + weak_factory_.GetWeakPtr(),
|
| + user_email,
|
| + delegate);
|
|
|
| // Ensure the value of owner email has been fetched.
|
| if (CrosSettingsProvider::TRUSTED !=
|
| @@ -334,34 +335,32 @@
|
| }
|
| std::string owner;
|
| cros_settings->GetString(kDeviceOwner, &owner);
|
| - if (account_id == AccountId::FromUserEmail(owner)) {
|
| + if (user_email == owner) {
|
| // Owner is not allowed to be removed from the device.
|
| return;
|
| }
|
| - RemoveNonOwnerUserInternal(account_id, delegate);
|
| + RemoveNonOwnerUserInternal(user_email, delegate);
|
| }
|
|
|
| void ChromeUserManagerImpl::SaveUserOAuthStatus(
|
| - const AccountId& account_id,
|
| + const std::string& user_id,
|
| user_manager::User::OAuthTokenStatus oauth_token_status) {
|
| DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
| - ChromeUserManager::SaveUserOAuthStatus(account_id, oauth_token_status);
|
| -
|
| - GetUserFlow(account_id)->HandleOAuthTokenStatusChange(oauth_token_status);
|
| + ChromeUserManager::SaveUserOAuthStatus(user_id, oauth_token_status);
|
| +
|
| + GetUserFlow(user_id)->HandleOAuthTokenStatusChange(oauth_token_status);
|
| }
|
|
|
| void ChromeUserManagerImpl::SaveUserDisplayName(
|
| - const AccountId& account_id,
|
| + const std::string& user_id,
|
| const base::string16& display_name) {
|
| DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
| - ChromeUserManager::SaveUserDisplayName(account_id, display_name);
|
| + ChromeUserManager::SaveUserDisplayName(user_id, display_name);
|
|
|
| // Do not update local state if data stored or cached outside the user's
|
| // cryptohome is to be treated as ephemeral.
|
| - if (!IsUserNonCryptohomeDataEphemeral(account_id)) {
|
| - supervised_user_manager_->UpdateManagerName(account_id.GetUserEmail(),
|
| - display_name);
|
| - }
|
| + if (!IsUserNonCryptohomeDataEphemeral(user_id))
|
| + supervised_user_manager_->UpdateManagerName(user_id, display_name);
|
| }
|
|
|
| void ChromeUserManagerImpl::StopPolicyObserverForTesting() {
|
| @@ -412,12 +411,14 @@
|
| if (user != NULL) {
|
| user->set_profile_is_created();
|
|
|
| - if (user->HasGaiaAccount())
|
| - GetUserImageManager(user->GetAccountId())->UserProfileCreated();
|
| + if (user->HasGaiaAccount()) {
|
| + UserImageManager* image_manager = GetUserImageManager(user->email());
|
| + image_manager->UserProfileCreated();
|
| + }
|
| }
|
|
|
| // If there is pending user switch, do it now.
|
| - if (GetPendingUserSwitchID().is_valid()) {
|
| + if (!GetPendingUserSwitchID().empty()) {
|
| // Call SwitchActiveUser async because otherwise it may cause
|
| // ProfileManager::GetProfile before the profile gets registered
|
| // in ProfileManager. It happens in case of sync profile load when
|
| @@ -427,7 +428,7 @@
|
| base::Bind(&ChromeUserManagerImpl::SwitchActiveUser,
|
| weak_factory_.GetWeakPtr(),
|
| GetPendingUserSwitchID()));
|
| - SetPendingUserSwitchId(EmptyAccountId());
|
| + SetPendingUserSwitchID(std::string());
|
| }
|
| break;
|
| }
|
| @@ -439,8 +440,7 @@
|
| void ChromeUserManagerImpl::OnExternalDataSet(const std::string& policy,
|
| const std::string& user_id) {
|
| if (policy == policy::key::kUserAvatarImage)
|
| - GetUserImageManager(AccountId::FromUserEmail(user_id))
|
| - ->OnExternalDataSet(policy);
|
| + GetUserImageManager(user_id)->OnExternalDataSet(policy);
|
| else if (policy == policy::key::kWallpaperImage)
|
| WallpaperManager::Get()->OnPolicySet(policy, user_id);
|
| else
|
| @@ -450,8 +450,7 @@
|
| void ChromeUserManagerImpl::OnExternalDataCleared(const std::string& policy,
|
| const std::string& user_id) {
|
| if (policy == policy::key::kUserAvatarImage)
|
| - GetUserImageManager(AccountId::FromUserEmail(user_id))
|
| - ->OnExternalDataCleared(policy);
|
| + GetUserImageManager(user_id)->OnExternalDataCleared(policy);
|
| else if (policy == policy::key::kWallpaperImage)
|
| WallpaperManager::Get()->OnPolicyCleared(policy, user_id);
|
| else
|
| @@ -463,8 +462,7 @@
|
| const std::string& user_id,
|
| scoped_ptr<std::string> data) {
|
| if (policy == policy::key::kUserAvatarImage)
|
| - GetUserImageManager(AccountId::FromUserEmail(user_id))
|
| - ->OnExternalDataFetched(policy, data.Pass());
|
| + GetUserImageManager(user_id)->OnExternalDataFetched(policy, data.Pass());
|
| else if (policy == policy::key::kWallpaperImage)
|
| WallpaperManager::Get()->OnPolicyFetched(policy, user_id, data.Pass());
|
| else
|
| @@ -472,7 +470,7 @@
|
| }
|
|
|
| void ChromeUserManagerImpl::OnPolicyUpdated(const std::string& user_id) {
|
| - const user_manager::User* user = FindUser(AccountId::FromUserEmail(user_id));
|
| + const user_manager::User* user = FindUser(user_id);
|
| if (!user || user->GetType() != user_manager::USER_TYPE_PUBLIC_ACCOUNT)
|
| return;
|
| UpdatePublicAccountDisplayName(user_id);
|
| @@ -489,24 +487,24 @@
|
| }
|
|
|
| bool ChromeUserManagerImpl::IsUserNonCryptohomeDataEphemeral(
|
| - const AccountId& account_id) const {
|
| + const std::string& user_id) const {
|
| // Data belonging to the obsolete public accounts whose data has not been
|
| // removed yet is not ephemeral.
|
| - bool is_obsolete_public_account = IsPublicAccountMarkedForRemoval(account_id);
|
| + bool is_obsolete_public_account = IsPublicAccountMarkedForRemoval(user_id);
|
|
|
| return !is_obsolete_public_account &&
|
| - ChromeUserManager::IsUserNonCryptohomeDataEphemeral(account_id);
|
| + ChromeUserManager::IsUserNonCryptohomeDataEphemeral(user_id);
|
| }
|
|
|
| bool ChromeUserManagerImpl::AreEphemeralUsersEnabled() const {
|
| policy::BrowserPolicyConnectorChromeOS* connector =
|
| g_browser_process->platform_part()->browser_policy_connector_chromeos();
|
| return GetEphemeralUsersEnabled() &&
|
| - (connector->IsEnterpriseManaged() || GetOwnerAccountId().is_valid());
|
| -}
|
| -
|
| -void ChromeUserManagerImpl::OnUserRemoved(const AccountId& account_id) {
|
| - RemoveReportingUser(FullyCanonicalize(account_id.GetUserEmail()));
|
| + (connector->IsEnterpriseManaged() || !GetOwnerEmail().empty());
|
| +}
|
| +
|
| +void ChromeUserManagerImpl::OnUserRemoved(const std::string& user_id) {
|
| + RemoveReportingUser(FullyCanonicalize(user_id));
|
| }
|
|
|
| const std::string& ChromeUserManagerImpl::GetApplicationLocale() const {
|
| @@ -518,9 +516,9 @@
|
| }
|
|
|
| void ChromeUserManagerImpl::HandleUserOAuthTokenStatusChange(
|
| - const AccountId& account_id,
|
| + const std::string& user_id,
|
| user_manager::User::OAuthTokenStatus status) const {
|
| - GetUserFlow(account_id)->HandleOAuthTokenStatusChange(status);
|
| + GetUserFlow(user_id)->HandleOAuthTokenStatusChange(status);
|
| }
|
|
|
| bool ChromeUserManagerImpl::IsEnterpriseManaged() const {
|
| @@ -530,15 +528,19 @@
|
| }
|
|
|
| void ChromeUserManagerImpl::LoadPublicAccounts(
|
| - std::set<AccountId>* public_sessions_set) {
|
| + std::set<std::string>* public_sessions_set) {
|
| const base::ListValue* prefs_public_sessions =
|
| GetLocalState()->GetList(kPublicAccounts);
|
| - std::vector<AccountId> public_sessions;
|
| - ParseUserList(*prefs_public_sessions, std::set<AccountId>(), &public_sessions,
|
| + std::vector<std::string> public_sessions;
|
| + ParseUserList(*prefs_public_sessions,
|
| + std::set<std::string>(),
|
| + &public_sessions,
|
| public_sessions_set);
|
| - for (const AccountId& account_id : public_sessions) {
|
| - users_.push_back(user_manager::User::CreatePublicAccountUser(account_id));
|
| - UpdatePublicAccountDisplayName(account_id.GetUserEmail());
|
| + for (std::vector<std::string>::const_iterator it = public_sessions.begin();
|
| + it != public_sessions.end();
|
| + ++it) {
|
| + users_.push_back(user_manager::User::CreatePublicAccountUser(*it));
|
| + UpdatePublicAccountDisplayName(*it);
|
| }
|
| }
|
|
|
| @@ -557,7 +559,7 @@
|
| for (user_manager::UserList::iterator ui = users_.begin(), ue = users_.end();
|
| ui != ue;
|
| ++ui) {
|
| - GetUserImageManager((*ui)->GetAccountId())->LoadUserImage();
|
| + GetUserImageManager((*ui)->email())->LoadUserImage();
|
| }
|
| }
|
|
|
| @@ -569,22 +571,22 @@
|
| new SessionLengthLimiter(NULL, browser_restart));
|
| }
|
|
|
| -bool ChromeUserManagerImpl::IsDemoApp(const AccountId& account_id) const {
|
| - return DemoAppLauncher::IsDemoAppSession(account_id.GetUserEmail());
|
| -}
|
| -
|
| -bool ChromeUserManagerImpl::IsKioskApp(const AccountId& account_id) const {
|
| +bool ChromeUserManagerImpl::IsDemoApp(const std::string& user_id) const {
|
| + return DemoAppLauncher::IsDemoAppSession(user_id);
|
| +}
|
| +
|
| +bool ChromeUserManagerImpl::IsKioskApp(const std::string& user_id) const {
|
| policy::DeviceLocalAccount::Type device_local_account_type;
|
| - return policy::IsDeviceLocalAccountUser(account_id.GetUserEmail(),
|
| + return policy::IsDeviceLocalAccountUser(user_id,
|
| &device_local_account_type) &&
|
| device_local_account_type ==
|
| policy::DeviceLocalAccount::TYPE_KIOSK_APP;
|
| }
|
|
|
| bool ChromeUserManagerImpl::IsPublicAccountMarkedForRemoval(
|
| - const AccountId& account_id) const {
|
| - return account_id == AccountId::FromUserEmail(GetLocalState()->GetString(
|
| - kPublicAccountPendingDataRemoval));
|
| + const std::string& user_id) const {
|
| + return user_id ==
|
| + GetLocalState()->GetString(kPublicAccountPendingDataRemoval);
|
| }
|
|
|
| void ChromeUserManagerImpl::RetrieveTrustedDevicePolicies() {
|
| @@ -593,7 +595,7 @@
|
| return;
|
|
|
| SetEphemeralUsersEnabled(false);
|
| - SetOwnerId(EmptyAccountId());
|
| + SetOwnerEmail(std::string());
|
|
|
| // Schedule a callback if device policy has not yet been verified.
|
| if (CrosSettingsProvider::TRUSTED !=
|
| @@ -610,7 +612,7 @@
|
|
|
| std::string owner_email;
|
| cros_settings_->GetString(kDeviceOwner, &owner_email);
|
| - SetOwnerId(AccountId::FromUserEmail(owner_email));
|
| + SetOwnerEmail(owner_email);
|
|
|
| EnsureUsersLoaded();
|
|
|
| @@ -624,16 +626,15 @@
|
| prefs_users_update->Clear();
|
| for (user_manager::UserList::iterator it = users_.begin();
|
| it != users_.end();) {
|
| - const AccountId account_id = (*it)->GetAccountId();
|
| - if ((*it)->HasGaiaAccount() && account_id != GetOwnerAccountId()) {
|
| - RemoveNonCryptohomeData(account_id);
|
| + const std::string user_email = (*it)->email();
|
| + if ((*it)->HasGaiaAccount() && user_email != GetOwnerEmail()) {
|
| + RemoveNonCryptohomeData(user_email);
|
| DeleteUser(*it);
|
| it = users_.erase(it);
|
| changed = true;
|
| } else {
|
| if ((*it)->GetType() != user_manager::USER_TYPE_PUBLIC_ACCOUNT)
|
| - prefs_users_update->Append(
|
| - new base::StringValue(account_id.GetUserEmail()));
|
| + prefs_users_update->Append(new base::StringValue(user_email));
|
| ++it;
|
| }
|
| }
|
| @@ -662,21 +663,20 @@
|
| login::GuestAccountId().GetUserEmail());
|
| }
|
|
|
| -void ChromeUserManagerImpl::RegularUserLoggedIn(const AccountId& account_id) {
|
| - ChromeUserManager::RegularUserLoggedIn(account_id);
|
| +void ChromeUserManagerImpl::RegularUserLoggedIn(const std::string& user_id) {
|
| + ChromeUserManager::RegularUserLoggedIn(user_id);
|
|
|
| if (FakeOwnership()) {
|
| - const AccountId owner_account_id = GetActiveUser()->GetAccountId();
|
| - VLOG(1) << "Set device owner to: " << owner_account_id.GetUserEmail();
|
| - CrosSettings::Get()->SetString(kDeviceOwner,
|
| - owner_account_id.GetUserEmail());
|
| - SetOwnerId(owner_account_id);
|
| + std::string owner_email = GetActiveUser()->email();
|
| + VLOG(1) << "Set device owner to: " << owner_email;
|
| + CrosSettings::Get()->SetString(kDeviceOwner, owner_email);
|
| + SetOwnerEmail(owner_email);
|
| }
|
|
|
| if (IsCurrentUserNew())
|
| - WallpaperManager::Get()->SetUserWallpaperNow(account_id.GetUserEmail());
|
| -
|
| - GetUserImageManager(account_id)->UserLoggedIn(IsCurrentUserNew(), false);
|
| + WallpaperManager::Get()->SetUserWallpaperNow(user_id);
|
| +
|
| + GetUserImageManager(user_id)->UserLoggedIn(IsCurrentUserNew(), false);
|
|
|
| WallpaperManager::Get()->EnsureLoggedInUserWallpaperLoaded();
|
|
|
| @@ -685,31 +685,30 @@
|
| }
|
|
|
| void ChromeUserManagerImpl::RegularUserLoggedInAsEphemeral(
|
| - const AccountId& account_id) {
|
| - DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
| - ChromeUserManager::RegularUserLoggedInAsEphemeral(account_id);
|
| -
|
| - GetUserImageManager(account_id)->UserLoggedIn(IsCurrentUserNew(), false);
|
| - WallpaperManager::Get()->SetUserWallpaperNow(account_id.GetUserEmail());
|
| -}
|
| -
|
| -void ChromeUserManagerImpl::SupervisedUserLoggedIn(
|
| - const AccountId& account_id) {
|
| + const std::string& user_id) {
|
| + DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
| + ChromeUserManager::RegularUserLoggedInAsEphemeral(user_id);
|
| +
|
| + GetUserImageManager(user_id)->UserLoggedIn(IsCurrentUserNew(), false);
|
| + WallpaperManager::Get()->SetUserWallpaperNow(user_id);
|
| +}
|
| +
|
| +void ChromeUserManagerImpl::SupervisedUserLoggedIn(const std::string& user_id) {
|
| // TODO(nkostylev): Refactor, share code with RegularUserLoggedIn().
|
|
|
| // Remove the user from the user list.
|
| - active_user_ = RemoveRegularOrSupervisedUserFromList(account_id);
|
| + active_user_ = RemoveRegularOrSupervisedUserFromList(user_id);
|
|
|
| // If the user was not found on the user list, create a new user.
|
| if (!GetActiveUser()) {
|
| SetIsCurrentUserNew(true);
|
| - active_user_ = user_manager::User::CreateSupervisedUser(account_id);
|
| + active_user_ = user_manager::User::CreateSupervisedUser(user_id);
|
| // Leaving OAuth token status at the default state = unknown.
|
| - WallpaperManager::Get()->SetUserWallpaperNow(account_id.GetUserEmail());
|
| + WallpaperManager::Get()->SetUserWallpaperNow(user_id);
|
| } else {
|
| - if (supervised_user_manager_->CheckForFirstRun(account_id.GetUserEmail())) {
|
| + if (supervised_user_manager_->CheckForFirstRun(user_id)) {
|
| SetIsCurrentUserNew(true);
|
| - WallpaperManager::Get()->SetUserWallpaperNow(account_id.GetUserEmail());
|
| + WallpaperManager::Get()->SetUserWallpaperNow(user_id);
|
| } else {
|
| SetIsCurrentUserNew(false);
|
| }
|
| @@ -717,17 +716,16 @@
|
|
|
| // Add the user to the front of the user list.
|
| ListPrefUpdate prefs_users_update(GetLocalState(), kRegularUsers);
|
| - prefs_users_update->Insert(0,
|
| - new base::StringValue(account_id.GetUserEmail()));
|
| + prefs_users_update->Insert(0, new base::StringValue(user_id));
|
| users_.insert(users_.begin(), active_user_);
|
|
|
| // Now that user is in the list, save display name.
|
| if (IsCurrentUserNew()) {
|
| - SaveUserDisplayName(GetActiveUser()->GetAccountId(),
|
| + SaveUserDisplayName(GetActiveUser()->email(),
|
| GetActiveUser()->GetDisplayName());
|
| }
|
|
|
| - GetUserImageManager(account_id)->UserLoggedIn(IsCurrentUserNew(), true);
|
| + GetUserImageManager(user_id)->UserLoggedIn(IsCurrentUserNew(), true);
|
| WallpaperManager::Get()->EnsureLoggedInUserWallpaperLoaded();
|
|
|
| // Make sure that new data is persisted to Local State.
|
| @@ -735,8 +733,8 @@
|
| }
|
|
|
| bool ChromeUserManagerImpl::HasPendingBootstrap(
|
| - const AccountId& account_id) const {
|
| - return bootstrap_manager_->HasPendingBootstrap(account_id.GetUserEmail());
|
| + const std::string& user_id) const {
|
| + return bootstrap_manager_->HasPendingBootstrap(user_id);
|
| }
|
|
|
| void ChromeUserManagerImpl::PublicAccountUserLoggedIn(
|
| @@ -747,20 +745,18 @@
|
| // The UserImageManager chooses a random avatar picture when a user logs in
|
| // for the first time. Tell the UserImageManager that this user is not new to
|
| // prevent the avatar from getting changed.
|
| - GetUserImageManager(user->GetAccountId())->UserLoggedIn(false, true);
|
| + GetUserImageManager(user->email())->UserLoggedIn(false, true);
|
| WallpaperManager::Get()->EnsureLoggedInUserWallpaperLoaded();
|
| }
|
|
|
| -void ChromeUserManagerImpl::KioskAppLoggedIn(
|
| - const AccountId& kiosk_app_account_id) {
|
| +void ChromeUserManagerImpl::KioskAppLoggedIn(const std::string& app_id) {
|
| DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
| policy::DeviceLocalAccount::Type device_local_account_type;
|
| - DCHECK(policy::IsDeviceLocalAccountUser(kiosk_app_account_id.GetUserEmail(),
|
| - &device_local_account_type));
|
| + DCHECK(policy::IsDeviceLocalAccountUser(app_id, &device_local_account_type));
|
| DCHECK_EQ(policy::DeviceLocalAccount::TYPE_KIOSK_APP,
|
| device_local_account_type);
|
|
|
| - active_user_ = user_manager::User::CreateKioskAppUser(kiosk_app_account_id);
|
| + active_user_ = user_manager::User::CreateKioskAppUser(app_id);
|
| active_user_->SetStubImage(
|
| user_manager::UserImage(
|
| *ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
|
| @@ -768,8 +764,7 @@
|
| user_manager::User::USER_IMAGE_INVALID,
|
| false);
|
|
|
| - WallpaperManager::Get()->SetUserWallpaperNow(
|
| - kiosk_app_account_id.GetUserEmail());
|
| + WallpaperManager::Get()->SetUserWallpaperNow(app_id);
|
|
|
| // TODO(bartfab): Add KioskAppUsers to the users_ list and keep metadata like
|
| // the kiosk_app_id in these objects, removing the need to re-parse the
|
| @@ -781,23 +776,22 @@
|
| device_local_accounts.begin();
|
| it != device_local_accounts.end();
|
| ++it) {
|
| - if (it->user_id == kiosk_app_account_id.GetUserEmail()) {
|
| + if (it->user_id == app_id) {
|
| account = &*it;
|
| break;
|
| }
|
| }
|
| - std::string kiosk_app_name;
|
| + std::string kiosk_app_id;
|
| if (account) {
|
| - kiosk_app_name = account->kiosk_app_id;
|
| + kiosk_app_id = account->kiosk_app_id;
|
| } else {
|
| - LOG(ERROR) << "Logged into nonexistent kiosk-app account: "
|
| - << kiosk_app_account_id.GetUserEmail();
|
| + LOG(ERROR) << "Logged into nonexistent kiosk-app account: " << app_id;
|
| NOTREACHED();
|
| }
|
|
|
| base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
| command_line->AppendSwitch(::switches::kForceAppMode);
|
| - command_line->AppendSwitchASCII(::switches::kAppId, kiosk_app_name);
|
| + command_line->AppendSwitchASCII(::switches::kAppId, kiosk_app_id);
|
|
|
| // Disable window animation since kiosk app runs in a single full screen
|
| // window and window animation causes start-up janks.
|
| @@ -806,7 +800,8 @@
|
|
|
| void ChromeUserManagerImpl::DemoAccountLoggedIn() {
|
| DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
| - active_user_ = user_manager::User::CreateKioskAppUser(login::DemoAccountId());
|
| + active_user_ = user_manager::User::CreateKioskAppUser(
|
| + login::DemoAccountId().GetUserEmail());
|
| active_user_->SetStubImage(
|
| user_manager::UserImage(
|
| *ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
|
| @@ -854,17 +849,17 @@
|
| }
|
|
|
| void ChromeUserManagerImpl::RemoveNonCryptohomeData(
|
| - const AccountId& account_id) {
|
| - ChromeUserManager::RemoveNonCryptohomeData(account_id);
|
| -
|
| - WallpaperManager::Get()->RemoveUserWallpaperInfo(account_id.GetUserEmail());
|
| - GetUserImageManager(account_id)->DeleteUserImage();
|
| -
|
| - supervised_user_manager_->RemoveNonCryptohomeData(account_id.GetUserEmail());
|
| -
|
| - multi_profile_user_controller_->RemoveCachedValues(account_id.GetUserEmail());
|
| -
|
| - EasyUnlockService::ResetLocalStateForUser(account_id.GetUserEmail());
|
| + const std::string& user_id) {
|
| + ChromeUserManager::RemoveNonCryptohomeData(user_id);
|
| +
|
| + WallpaperManager::Get()->RemoveUserWallpaperInfo(user_id);
|
| + GetUserImageManager(user_id)->DeleteUserImage();
|
| +
|
| + supervised_user_manager_->RemoveNonCryptohomeData(user_id);
|
| +
|
| + multi_profile_user_controller_->RemoveCachedValues(user_id);
|
| +
|
| + EasyUnlockService::ResetLocalStateForUser(user_id);
|
| }
|
|
|
| void
|
| @@ -878,8 +873,7 @@
|
| return;
|
| }
|
|
|
| - RemoveNonCryptohomeData(
|
| - AccountId::FromUserEmail(public_account_pending_data_removal));
|
| + RemoveNonCryptohomeData(public_account_pending_data_removal);
|
| local_state->ClearPref(kPublicAccountPendingDataRemoval);
|
| }
|
|
|
| @@ -909,7 +903,7 @@
|
| it != old_public_accounts.end();
|
| ++it) {
|
| if (users.find(*it) == users.end())
|
| - RemoveNonCryptohomeData(AccountId::FromUserEmail(*it));
|
| + RemoveNonCryptohomeData(*it);
|
| }
|
| }
|
|
|
| @@ -982,8 +976,8 @@
|
| if (IsLoggedInAsPublicAccount() && *it == GetActiveUser()->email())
|
| users_.insert(users_.begin(), GetLoggedInUser());
|
| else
|
| - users_.insert(users_.begin(), user_manager::User::CreatePublicAccountUser(
|
| - AccountId::FromUserEmail(*it)));
|
| + users_.insert(users_.begin(),
|
| + user_manager::User::CreatePublicAccountUser(*it));
|
| UpdatePublicAccountDisplayName(*it);
|
| }
|
|
|
| @@ -992,7 +986,7 @@
|
| ue = users_.begin() + new_public_accounts.size();
|
| ui != ue;
|
| ++ui) {
|
| - GetUserImageManager((*ui)->GetAccountId())->LoadUserImage();
|
| + GetUserImageManager((*ui)->email())->LoadUserImage();
|
| }
|
|
|
| // Remove data belonging to public accounts that are no longer found on the
|
| @@ -1014,36 +1008,34 @@
|
| }
|
|
|
| // Set or clear the display name.
|
| - SaveUserDisplayName(AccountId::FromUserEmail(user_id),
|
| - base::UTF8ToUTF16(display_name));
|
| + SaveUserDisplayName(user_id, base::UTF8ToUTF16(display_name));
|
| }
|
|
|
| UserFlow* ChromeUserManagerImpl::GetCurrentUserFlow() const {
|
| DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
| if (!IsUserLoggedIn())
|
| return GetDefaultUserFlow();
|
| - return GetUserFlow(GetLoggedInUser()->GetAccountId());
|
| -}
|
| -
|
| -UserFlow* ChromeUserManagerImpl::GetUserFlow(
|
| - const AccountId& account_id) const {
|
| - DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
| - FlowMap::const_iterator it = specific_flows_.find(account_id);
|
| + return GetUserFlow(GetLoggedInUser()->email());
|
| +}
|
| +
|
| +UserFlow* ChromeUserManagerImpl::GetUserFlow(const std::string& user_id) const {
|
| + DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
| + FlowMap::const_iterator it = specific_flows_.find(user_id);
|
| if (it != specific_flows_.end())
|
| return it->second;
|
| return GetDefaultUserFlow();
|
| }
|
|
|
| -void ChromeUserManagerImpl::SetUserFlow(const AccountId& account_id,
|
| +void ChromeUserManagerImpl::SetUserFlow(const std::string& user_id,
|
| UserFlow* flow) {
|
| DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
| - ResetUserFlow(account_id);
|
| - specific_flows_[account_id] = flow;
|
| -}
|
| -
|
| -void ChromeUserManagerImpl::ResetUserFlow(const AccountId& account_id) {
|
| - DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
| - FlowMap::iterator it = specific_flows_.find(account_id);
|
| + ResetUserFlow(user_id);
|
| + specific_flows_[user_id] = flow;
|
| +}
|
| +
|
| +void ChromeUserManagerImpl::ResetUserFlow(const std::string& user_id) {
|
| + DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
| + FlowMap::iterator it = specific_flows_.find(user_id);
|
| if (it != specific_flows_.end()) {
|
| delete it->second;
|
| specific_flows_.erase(it);
|
| @@ -1080,7 +1072,7 @@
|
| // before the crash.
|
| if (user_switch_pending &&
|
| !UserSessionManager::GetInstance()->UserSessionsRestoreInProgress()) {
|
| - SetPendingUserSwitchId(added_user->GetAccountId());
|
| + SetPendingUserSwitchID(added_user->email());
|
| }
|
|
|
| UpdateNumberOfUsers();
|
| @@ -1095,9 +1087,8 @@
|
|
|
| void ChromeUserManagerImpl::RemovePendingBootstrapUser(
|
| const std::string& user_id) {
|
| - const AccountId account_id(AccountId::FromUserEmail(user_id));
|
| - DCHECK(HasPendingBootstrap(account_id));
|
| - RemoveNonOwnerUserInternal(account_id, nullptr);
|
| + DCHECK(HasPendingBootstrap(user_id));
|
| + RemoveNonOwnerUserInternal(user_id, NULL);
|
| }
|
|
|
| void ChromeUserManagerImpl::UpdateNumberOfUsers() {
|
| @@ -1151,8 +1142,7 @@
|
| const std::string& user_email,
|
| const AffiliationIDSet& user_affiliation_ids) {
|
| std::string canonicalized_email = FullyCanonicalize(user_email);
|
| - user_manager::User* user =
|
| - FindUserAndModify(AccountId::FromUserEmail(canonicalized_email));
|
| + user_manager::User* user = FindUserAndModify(canonicalized_email);
|
|
|
| if (user) {
|
| policy::BrowserPolicyConnectorChromeOS const* const connector =
|
|
|