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/settings/device_settings_provider.h" | 5 #include "chrome/browser/chromeos/settings/device_settings_provider.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 kAccountsPrefDeviceLocalAccounts, | 44 kAccountsPrefDeviceLocalAccounts, |
45 kAccountsPrefDeviceLocalAccountAutoLoginBailoutEnabled, | 45 kAccountsPrefDeviceLocalAccountAutoLoginBailoutEnabled, |
46 kAccountsPrefDeviceLocalAccountAutoLoginDelay, | 46 kAccountsPrefDeviceLocalAccountAutoLoginDelay, |
47 kAccountsPrefDeviceLocalAccountAutoLoginId, | 47 kAccountsPrefDeviceLocalAccountAutoLoginId, |
48 kAccountsPrefDeviceLocalAccountPromptForNetworkWhenOffline, | 48 kAccountsPrefDeviceLocalAccountPromptForNetworkWhenOffline, |
49 kAccountsPrefEphemeralUsersEnabled, | 49 kAccountsPrefEphemeralUsersEnabled, |
50 kAccountsPrefShowUserNamesOnSignIn, | 50 kAccountsPrefShowUserNamesOnSignIn, |
51 kAccountsPrefSupervisedUsersEnabled, | 51 kAccountsPrefSupervisedUsersEnabled, |
52 kAccountsPrefTransferSAMLCookies, | 52 kAccountsPrefTransferSAMLCookies, |
53 kAccountsPrefUsers, | 53 kAccountsPrefUsers, |
| 54 kAccountsPrefLoginScreenDomainAutoComplete, |
54 kAllowRedeemChromeOsRegistrationOffers, | 55 kAllowRedeemChromeOsRegistrationOffers, |
55 kAllowedConnectionTypesForUpdate, | 56 kAllowedConnectionTypesForUpdate, |
56 kAttestationForContentProtectionEnabled, | 57 kAttestationForContentProtectionEnabled, |
57 kDeviceAttestationEnabled, | 58 kDeviceAttestationEnabled, |
58 kDeviceOwner, | 59 kDeviceOwner, |
59 kHeartbeatEnabled, | 60 kHeartbeatEnabled, |
60 kHeartbeatFrequency, | 61 kHeartbeatFrequency, |
61 kPolicyMissingMitigationMode, | 62 kPolicyMissingMitigationMode, |
62 kReleaseChannel, | 63 kReleaseChannel, |
63 kReleaseChannelDelegated, | 64 kReleaseChannelDelegated, |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 list->Append(new base::StringValue(*it)); | 240 list->Append(new base::StringValue(*it)); |
240 } | 241 } |
241 new_values_cache->SetValue(kStartUpFlags, list); | 242 new_values_cache->SetValue(kStartUpFlags, list); |
242 } | 243 } |
243 | 244 |
244 if (policy.has_saml_settings()) { | 245 if (policy.has_saml_settings()) { |
245 new_values_cache->SetBoolean( | 246 new_values_cache->SetBoolean( |
246 kAccountsPrefTransferSAMLCookies, | 247 kAccountsPrefTransferSAMLCookies, |
247 policy.saml_settings().transfer_saml_cookies()); | 248 policy.saml_settings().transfer_saml_cookies()); |
248 } | 249 } |
| 250 |
| 251 // The behavior when policy is not set and when it is set to an empty string |
| 252 // is the same. Thus lets add policy only if it is set and its value is not |
| 253 // an empty string. |
| 254 if (policy.has_login_screen_domain_auto_complete() && |
| 255 policy.login_screen_domain_auto_complete() |
| 256 .has_login_screen_domain_auto_complete() && |
| 257 !policy.login_screen_domain_auto_complete() |
| 258 .login_screen_domain_auto_complete() |
| 259 .empty()) { |
| 260 new_values_cache->SetString(kAccountsPrefLoginScreenDomainAutoComplete, |
| 261 policy.login_screen_domain_auto_complete() |
| 262 .login_screen_domain_auto_complete()); |
| 263 } |
249 } | 264 } |
250 | 265 |
251 void DecodeNetworkPolicies( | 266 void DecodeNetworkPolicies( |
252 const em::ChromeDeviceSettingsProto& policy, | 267 const em::ChromeDeviceSettingsProto& policy, |
253 PrefValueMap* new_values_cache) { | 268 PrefValueMap* new_values_cache) { |
254 // kSignedDataRoamingEnabled has a default value of false. | 269 // kSignedDataRoamingEnabled has a default value of false. |
255 new_values_cache->SetBoolean( | 270 new_values_cache->SetBoolean( |
256 kSignedDataRoamingEnabled, | 271 kSignedDataRoamingEnabled, |
257 policy.has_data_roaming_enabled() && | 272 policy.has_data_roaming_enabled() && |
258 policy.data_roaming_enabled().has_data_roaming_enabled() && | 273 policy.data_roaming_enabled().has_data_roaming_enabled() && |
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 void DeviceSettingsProvider::AttemptMigration() { | 819 void DeviceSettingsProvider::AttemptMigration() { |
805 if (device_settings_service_->HasPrivateOwnerKey()) { | 820 if (device_settings_service_->HasPrivateOwnerKey()) { |
806 PrefValueMap::const_iterator i; | 821 PrefValueMap::const_iterator i; |
807 for (i = migration_values_.begin(); i != migration_values_.end(); ++i) | 822 for (i = migration_values_.begin(); i != migration_values_.end(); ++i) |
808 DoSet(i->first, *i->second); | 823 DoSet(i->first, *i->second); |
809 migration_values_.Clear(); | 824 migration_values_.Clear(); |
810 } | 825 } |
811 } | 826 } |
812 | 827 |
813 } // namespace chromeos | 828 } // namespace chromeos |
OLD | NEW |