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

Unified Diff: chrome/browser/chromeos/settings/device_settings_provider.cc

Issue 12218078: Implement a policy to autologin a public account. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: last upload failed Created 7 years, 10 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/settings/device_settings_provider.cc
diff --git a/chrome/browser/chromeos/settings/device_settings_provider.cc b/chrome/browser/chromeos/settings/device_settings_provider.cc
index f60f5445fc60662b41b5d35e859f25362091d5d2..9b106fb1491b43b8dacebccddeba1923be1e11f6 100644
--- a/chrome/browser/chromeos/settings/device_settings_provider.cc
+++ b/chrome/browser/chromeos/settings/device_settings_provider.cc
@@ -44,6 +44,8 @@ const char* kKnownSettings[] = {
kAccountsPrefShowUserNamesOnSignIn,
kAccountsPrefUsers,
kAccountsPrefDeviceLocalAccounts,
+ kAccountsPrefDeviceLocalAccountAutoLoginId,
+ kAccountsPrefDeviceLocalAccountAutoLoginDelay,
kAppPack,
kDeviceOwner,
kIdleLogoutTimeout,
@@ -232,6 +234,22 @@ void DeviceSettingsProvider::SetInPolicy() {
} else {
NOTREACHED();
}
+ } else if (prop == kAccountsPrefDeviceLocalAccountAutoLoginId) {
+ em::DeviceLocalAccountAutoLoginProto* auto_login =
+ device_settings_.mutable_device_local_account_auto_login();
+ std::string id;
+ if (value->GetAsString(&id))
+ auto_login->set_id(id);
+ else
+ NOTREACHED();
+ } else if (prop == kAccountsPrefDeviceLocalAccountAutoLoginDelay) {
+ em::DeviceLocalAccountAutoLoginProto* auto_login =
+ device_settings_.mutable_device_local_account_auto_login();
+ int timer;
+ if (value->GetAsInteger(&timer))
+ auto_login->set_delay(timer);
+ else
+ NOTREACHED();
} else if (prop == kSignedDataRoamingEnabled) {
em::DataRoamingEnabledProto* roam =
device_settings_.mutable_data_roaming_enabled();
@@ -395,6 +413,19 @@ void DeviceSettingsProvider::DecodeLoginPolicies(
}
}
new_values_cache->SetValue(kAccountsPrefDeviceLocalAccounts, account_list);
+
+ if (policy.has_device_local_account_auto_login()) {
+ if (policy.device_local_account_auto_login().has_id()) {
+ new_values_cache->SetString(
+ kAccountsPrefDeviceLocalAccountAutoLoginId,
+ policy.device_local_account_auto_login().id());
+ }
+ if (policy.device_local_account_auto_login().has_delay()) {
+ new_values_cache->SetInteger(
+ kAccountsPrefDeviceLocalAccountAutoLoginDelay,
+ policy.device_local_account_auto_login().delay());
+ }
+ }
}
void DeviceSettingsProvider::DecodeKioskPolicies(

Powered by Google App Engine
This is Rietveld 408576698