Chromium Code Reviews| 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 44a253483f2d3526fcd75a3ebf92865684ebd655..ba9e71eeb3e66e7ae6cb0a03bb91df2b16ea52a1 100644 |
| --- a/chrome/browser/chromeos/settings/device_settings_provider.cc |
| +++ b/chrome/browser/chromeos/settings/device_settings_provider.cc |
| @@ -43,8 +43,10 @@ const char* kKnownSettings[] = { |
| kAccountsPrefEphemeralUsersEnabled, |
| kAccountsPrefShowUserNamesOnSignIn, |
| kAccountsPrefUsers, |
| - kAccountsPrefDeviceLocalAccounts, |
| kAllowRedeemChromeOsRegistrationOffers, |
|
bartfab (slow)
2013/02/25 16:51:23
The list seems to have been ordered alphabetically
dconnelly
2013/02/26 18:04:15
Done.
|
| + kAccountsPrefDeviceLocalAccounts, |
| + kAccountsPrefDeviceLocalAccountAutoLoginId, |
| + kAccountsPrefDeviceLocalAccountAutoLoginDelay, |
| kAppPack, |
| kDeviceOwner, |
| kIdleLogoutTimeout, |
| @@ -233,6 +235,22 @@ void DeviceSettingsProvider::SetInPolicy() { |
| } else { |
| NOTREACHED(); |
| } |
| + } else if (prop == kAccountsPrefDeviceLocalAccountAutoLoginId) { |
| + em::DeviceLocalAccountsProto* device_local_accounts = |
| + device_settings_.mutable_device_local_accounts(); |
| + std::string id; |
| + if (value->GetAsString(&id)) |
| + device_local_accounts->set_auto_login_id(id); |
| + else |
| + NOTREACHED(); |
| + } else if (prop == kAccountsPrefDeviceLocalAccountAutoLoginDelay) { |
| + em::DeviceLocalAccountsProto* device_local_accounts = |
| + device_settings_.mutable_device_local_accounts(); |
| + int timer; |
|
bartfab (slow)
2013/02/25 16:51:23
This should be called |delay|, not |timer|.
dconnelly
2013/02/26 18:04:15
Done.
|
| + if (value->GetAsInteger(&timer)) |
| + device_local_accounts->set_auto_login_delay(timer); |
| + else |
| + NOTREACHED(); |
| } else if (prop == kSignedDataRoamingEnabled) { |
| em::DataRoamingEnabledProto* roam = |
| device_settings_.mutable_data_roaming_enabled(); |
| @@ -397,13 +415,25 @@ void DeviceSettingsProvider::DecodeLoginPolicies( |
| base::ListValue* account_list = new base::ListValue(); |
| CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| if (!command_line->HasSwitch(switches::kDisableLocalAccounts)) { |
| + const em::DeviceLocalAccountsProto device_local_accounts_proto = |
| + policy.device_local_accounts(); |
| const RepeatedPtrField<em::DeviceLocalAccountInfoProto>& accounts = |
| - policy.device_local_accounts().account(); |
| + device_local_accounts_proto.account(); |
| RepeatedPtrField<em::DeviceLocalAccountInfoProto>::const_iterator entry; |
| for (entry = accounts.begin(); entry != accounts.end(); ++entry) { |
| if (entry->has_id()) |
| account_list->AppendString(entry->id()); |
| } |
| + if (device_local_accounts_proto.has_auto_login_id()) { |
| + new_values_cache->SetString( |
| + kAccountsPrefDeviceLocalAccountAutoLoginId, |
| + device_local_accounts_proto.auto_login_id()); |
| + } |
| + if (device_local_accounts_proto.has_auto_login_delay()) { |
| + new_values_cache->SetInteger( |
| + kAccountsPrefDeviceLocalAccountAutoLoginDelay, |
| + device_local_accounts_proto.auto_login_delay()); |
| + } |
| } |
| new_values_cache->SetValue(kAccountsPrefDeviceLocalAccounts, account_list); |
| } |