| 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/policy/device_policy_decoder_chromeos.h" | 5 #include "chrome/browser/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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 for (entry = accounts.begin(); entry != accounts.end(); ++entry) { | 125 for (entry = accounts.begin(); entry != accounts.end(); ++entry) { |
| 126 if (entry->has_id()) | 126 if (entry->has_id()) |
| 127 account_list->AppendString(entry->id()); | 127 account_list->AppendString(entry->id()); |
| 128 } | 128 } |
| 129 policies->Set(key::kDeviceLocalAccounts, | 129 policies->Set(key::kDeviceLocalAccounts, |
| 130 POLICY_LEVEL_MANDATORY, | 130 POLICY_LEVEL_MANDATORY, |
| 131 POLICY_SCOPE_MACHINE, | 131 POLICY_SCOPE_MACHINE, |
| 132 account_list); | 132 account_list); |
| 133 } | 133 } |
| 134 } | 134 } |
| 135 |
| 136 if (policy.has_device_local_account_auto_login()) { |
| 137 const em::DeviceLocalAccountAutoLoginProto& container( |
| 138 policy.device_local_account_auto_login()); |
| 139 if (container.has_id()) { |
| 140 policies->Set(key::kDeviceLocalAccountAutoLoginUsername, |
| 141 POLICY_LEVEL_MANDATORY, |
| 142 POLICY_SCOPE_MACHINE, |
| 143 Value::CreateStringValue(container.id())); |
| 144 } |
| 145 if (container.has_timer_millis()) { |
| 146 policies->Set(key::kDeviceLocalAccountAutoLoginTimerMillis, |
| 147 POLICY_LEVEL_MANDATORY, |
| 148 POLICY_SCOPE_MACHINE, |
| 149 DecodeIntegerValue(container.timer_millis())); |
| 150 } |
| 151 } |
| 135 } | 152 } |
| 136 | 153 |
| 137 void DecodeKioskPolicies(const em::ChromeDeviceSettingsProto& policy, | 154 void DecodeKioskPolicies(const em::ChromeDeviceSettingsProto& policy, |
| 138 PolicyMap* policies, | 155 PolicyMap* policies, |
| 139 EnterpriseInstallAttributes* install_attributes) { | 156 EnterpriseInstallAttributes* install_attributes) { |
| 140 // No policies if this is not KIOSK. | 157 // No policies if this is not KIOSK. |
| 141 if (install_attributes->GetMode() != DEVICE_MODE_KIOSK) | 158 if (install_attributes->GetMode() != DEVICE_MODE_KIOSK) |
| 142 return; | 159 return; |
| 143 | 160 |
| 144 if (policy.has_forced_logout_timeouts()) { | 161 if (policy.has_forced_logout_timeouts()) { |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 // Decode the various groups of policies. | 440 // Decode the various groups of policies. |
| 424 DecodeLoginPolicies(policy, policies); | 441 DecodeLoginPolicies(policy, policies); |
| 425 DecodeKioskPolicies(policy, policies, install_attributes); | 442 DecodeKioskPolicies(policy, policies, install_attributes); |
| 426 DecodeNetworkPolicies(policy, policies, install_attributes); | 443 DecodeNetworkPolicies(policy, policies, install_attributes); |
| 427 DecodeReportingPolicies(policy, policies); | 444 DecodeReportingPolicies(policy, policies); |
| 428 DecodeAutoUpdatePolicies(policy, policies); | 445 DecodeAutoUpdatePolicies(policy, policies); |
| 429 DecodeGenericPolicies(policy, policies); | 446 DecodeGenericPolicies(policy, policies); |
| 430 } | 447 } |
| 431 | 448 |
| 432 } // namespace policy | 449 } // namespace policy |
| OLD | NEW |