Chromium Code Reviews| Index: chrome/browser/chromeos/login/user_manager_impl.cc |
| diff --git a/chrome/browser/chromeos/login/user_manager_impl.cc b/chrome/browser/chromeos/login/user_manager_impl.cc |
| index ca3c7b4bb909c8303d2d383183d8169034c1f4e9..e67f99636b6863da4a6d6235dba32f21bafef5d8 100644 |
| --- a/chrome/browser/chromeos/login/user_manager_impl.cc |
| +++ b/chrome/browser/chromeos/login/user_manager_impl.cc |
| @@ -835,8 +835,8 @@ void UserManagerImpl::EnsureUsersLoaded() { |
| for (std::vector<std::string>::const_iterator it = regular_users.begin(); |
| it != regular_users.end(); ++it) { |
| User* user = NULL; |
| - if (gaia::ExtractDomainName(*it) == |
| - UserManager::kLocallyManagedUserDomain) { |
| + const std::string domain = gaia::ExtractDomainName(*it); |
| + if (domain == UserManager::kLocallyManagedUserDomain) { |
| user = User::CreateLocallyManagedUser(*it); |
| } else { |
| user = User::CreateRegularUser(*it); |
| @@ -885,12 +885,12 @@ void UserManagerImpl::RetrieveTrustedDevicePolicies() { |
| cros_settings_->GetBoolean(kAccountsPrefEphemeralUsersEnabled, |
| &ephemeral_users_enabled_); |
| cros_settings_->GetString(kDeviceOwner, &owner_email_); |
| - const base::ListValue* public_accounts; |
| - cros_settings_->GetList(kAccountsPrefDeviceLocalAccounts, &public_accounts); |
| + base::ListValue public_accounts; |
| + ReadPublicAccounts(&public_accounts); |
| EnsureUsersLoaded(); |
| - bool changed = UpdateAndCleanUpPublicAccounts(*public_accounts); |
| + bool changed = UpdateAndCleanUpPublicAccounts(public_accounts); |
| // If ephemeral users are enabled and we are on the login screen, take this |
| // opportunity to clean up by removing all regular users except the owner. |
| @@ -1426,4 +1426,27 @@ void UserManagerImpl::UpdateLoginState() { |
| LoginState::Get()->SetLoggedInState(logged_in_state, login_user_type); |
| } |
| +void UserManagerImpl::ReadPublicAccounts(base::ListValue* public_accounts) { |
| + const base::DictionaryValue* device_local_accounts = NULL; |
| + if (cros_settings_->GetDictionary( |
| + kAccountsPrefDeviceLocalAccounts, &device_local_accounts)) { |
|
bartfab (slow)
2013/04/25 11:17:28
By switching from a ListValue to a DictionaryValue
Mattias Nissler (ping if slow)
2013/04/26 09:10:05
Switched to the list.
|
| + for (base::DictionaryValue::Iterator account(*device_local_accounts); |
| + !account.IsAtEnd(); account.Advance()) { |
| + const base::DictionaryValue* entry_dict = NULL; |
| + if (!account.value().GetAsDictionary(&entry_dict)) { |
| + NOTREACHED(); |
| + continue; |
| + } |
| + |
| + if (entry_dict->HasKey(kAccountsPrefDeviceLocalAccountsKeyKioskAppId)) { |
|
bartfab (slow)
2013/04/25 11:17:28
As in KioskAppManager, this code should look at ac
Mattias Nissler (ping if slow)
2013/04/26 09:10:05
Switched to checking the type key.
|
| + // TODO(mnissler, nkostylev, bartfab): Process Kiosk Apps within the |
| + // standard login framework: http://crbug.com/234694 |
| + } else { |
| + // Regular public account. |
| + public_accounts->AppendString(account.key()); |
| + } |
| + } |
| + } |
| +} |
| + |
| } // namespace chromeos |