Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Unified Diff: chrome/browser/chromeos/login/user_manager_impl.cc

Issue 14306004: Put Kiosk App parameters into device settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 8609ed6f3336e3b47858a29249eb089819894e16..addc81045fe33c35e5b4889c121c601307fdaf65 100644
--- a/chrome/browser/chromeos/login/user_manager_impl.cc
+++ b/chrome/browser/chromeos/login/user_manager_impl.cc
@@ -857,8 +857,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);
@@ -907,12 +907,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.
@@ -1457,4 +1457,36 @@ void UserManagerImpl::UpdateLoginState() {
LoginState::Get()->SetLoggedInState(logged_in_state, login_user_type);
}
+void UserManagerImpl::ReadPublicAccounts(base::ListValue* public_accounts) {
+ const base::ListValue* accounts = NULL;
+ if (cros_settings_->GetList(kAccountsPrefDeviceLocalAccounts, &accounts)) {
+ for (base::ListValue::const_iterator entry(accounts->begin());
+ entry != accounts->end(); ++entry) {
+ const base::DictionaryValue* entry_dict = NULL;
+ if (!(*entry)->GetAsDictionary(&entry_dict)) {
+ NOTREACHED();
+ continue;
+ }
+
+ int type = DEVICE_LOCAL_ACCOUNT_TYPE_PUBLIC_SESSION;
+ entry_dict->GetIntegerWithoutPathExpansion(
+ kAccountsPrefDeviceLocalAccountsKeyType, &type);
+ switch (type) {
+ case DEVICE_LOCAL_ACCOUNT_TYPE_PUBLIC_SESSION: {
+ std::string id;
+ if (entry_dict->GetStringWithoutPathExpansion(
+ kAccountsPrefDeviceLocalAccountsKeyId, &id)) {
+ public_accounts->AppendString(id);
+ }
+ break;
+ }
+ case DEVICE_LOCAL_ACCOUNT_TYPE_KIOSK_APP:
+ // TODO(mnissler, nkostylev, bartfab): Process Kiosk Apps within the
+ // standard login framework: http://crbug.com/234694
+ break;
+ }
+ }
+ }
+}
+
} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/login/user_manager_impl.h ('k') | chrome/browser/chromeos/policy/app_pack_updater.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698