OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/policy/device_policy_decoder_chromeos.h" | 5 #include "chrome/browser/chromeos/policy/device_policy_decoder_chromeos.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 if (container.has_ephemeral_users_enabled()) { | 110 if (container.has_ephemeral_users_enabled()) { |
111 policies->Set(key::kDeviceEphemeralUsersEnabled, | 111 policies->Set(key::kDeviceEphemeralUsersEnabled, |
112 POLICY_LEVEL_MANDATORY, | 112 POLICY_LEVEL_MANDATORY, |
113 POLICY_SCOPE_MACHINE, | 113 POLICY_SCOPE_MACHINE, |
114 Value::CreateBooleanValue( | 114 Value::CreateBooleanValue( |
115 container.ephemeral_users_enabled())); | 115 container.ephemeral_users_enabled())); |
116 } | 116 } |
117 } | 117 } |
118 | 118 |
119 if (policy.has_device_local_accounts()) { | 119 if (policy.has_device_local_accounts()) { |
| 120 const em::DeviceLocalAccountsProto& container( |
| 121 policy.device_local_accounts()); |
120 const RepeatedPtrField<em::DeviceLocalAccountInfoProto>& accounts = | 122 const RepeatedPtrField<em::DeviceLocalAccountInfoProto>& accounts = |
121 policy.device_local_accounts().account(); | 123 container.account(); |
122 if (accounts.size() > 0) { | 124 if (accounts.size() > 0) { |
123 ListValue* account_list = new ListValue(); | 125 ListValue* account_list = new ListValue(); |
124 RepeatedPtrField<em::DeviceLocalAccountInfoProto>::const_iterator entry; | 126 RepeatedPtrField<em::DeviceLocalAccountInfoProto>::const_iterator entry; |
125 for (entry = accounts.begin(); entry != accounts.end(); ++entry) { | 127 for (entry = accounts.begin(); entry != accounts.end(); ++entry) { |
126 if (entry->has_id()) | 128 if (entry->has_id()) |
127 account_list->AppendString(entry->id()); | 129 account_list->AppendString(entry->id()); |
128 } | 130 } |
129 policies->Set(key::kDeviceLocalAccounts, | 131 policies->Set(key::kDeviceLocalAccounts, |
130 POLICY_LEVEL_MANDATORY, | 132 POLICY_LEVEL_MANDATORY, |
131 POLICY_SCOPE_MACHINE, | 133 POLICY_SCOPE_MACHINE, |
132 account_list); | 134 account_list); |
133 } | 135 } |
| 136 if (container.has_auto_login_id()) { |
| 137 policies->Set(key::kDeviceLocalAccountAutoLoginId, |
| 138 POLICY_LEVEL_MANDATORY, |
| 139 POLICY_SCOPE_MACHINE, |
| 140 Value::CreateStringValue(container.auto_login_id())); |
| 141 } |
| 142 if (container.has_auto_login_delay()) { |
| 143 policies->Set(key::kDeviceLocalAccountAutoLoginDelay, |
| 144 POLICY_LEVEL_MANDATORY, |
| 145 POLICY_SCOPE_MACHINE, |
| 146 DecodeIntegerValue(container.auto_login_delay())); |
| 147 } |
134 } | 148 } |
135 } | 149 } |
136 | 150 |
137 void DecodeKioskPolicies(const em::ChromeDeviceSettingsProto& policy, | 151 void DecodeKioskPolicies(const em::ChromeDeviceSettingsProto& policy, |
138 PolicyMap* policies, | 152 PolicyMap* policies, |
139 EnterpriseInstallAttributes* install_attributes) { | 153 EnterpriseInstallAttributes* install_attributes) { |
140 // No policies if this is not KIOSK. | 154 // No policies if this is not KIOSK. |
141 if (install_attributes->GetMode() != DEVICE_MODE_KIOSK) | 155 if (install_attributes->GetMode() != DEVICE_MODE_KIOSK) |
142 return; | 156 return; |
143 | 157 |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 // Decode the various groups of policies. | 466 // Decode the various groups of policies. |
453 DecodeLoginPolicies(policy, policies); | 467 DecodeLoginPolicies(policy, policies); |
454 DecodeKioskPolicies(policy, policies, install_attributes); | 468 DecodeKioskPolicies(policy, policies, install_attributes); |
455 DecodeNetworkPolicies(policy, policies, install_attributes); | 469 DecodeNetworkPolicies(policy, policies, install_attributes); |
456 DecodeReportingPolicies(policy, policies); | 470 DecodeReportingPolicies(policy, policies); |
457 DecodeAutoUpdatePolicies(policy, policies); | 471 DecodeAutoUpdatePolicies(policy, policies); |
458 DecodeGenericPolicies(policy, policies); | 472 DecodeGenericPolicies(policy, policies); |
459 } | 473 } |
460 | 474 |
461 } // namespace policy | 475 } // namespace policy |
OLD | NEW |