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 kAccountsPrefDeviceLoginScreenDomainAutoComplete, | |
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 | |
Mattias Nissler (ping if slow)
2015/04/07 12:29:45
Question: Is there a use case for turning off auto
peletskyi
2015/04/07 13:48:12
This use case is not mentioned in the design doc g
| |
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( | |
261 kAccountsPrefDeviceLoginScreenDomainAutoComplete, | |
262 policy.login_screen_domain_auto_complete() | |
263 .login_screen_domain_auto_complete()); | |
264 } | |
249 } | 265 } |
250 | 266 |
251 void DecodeNetworkPolicies( | 267 void DecodeNetworkPolicies( |
252 const em::ChromeDeviceSettingsProto& policy, | 268 const em::ChromeDeviceSettingsProto& policy, |
253 PrefValueMap* new_values_cache) { | 269 PrefValueMap* new_values_cache) { |
254 // kSignedDataRoamingEnabled has a default value of false. | 270 // kSignedDataRoamingEnabled has a default value of false. |
255 new_values_cache->SetBoolean( | 271 new_values_cache->SetBoolean( |
256 kSignedDataRoamingEnabled, | 272 kSignedDataRoamingEnabled, |
257 policy.has_data_roaming_enabled() && | 273 policy.has_data_roaming_enabled() && |
258 policy.data_roaming_enabled().has_data_roaming_enabled() && | 274 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() { | 820 void DeviceSettingsProvider::AttemptMigration() { |
805 if (device_settings_service_->HasPrivateOwnerKey()) { | 821 if (device_settings_service_->HasPrivateOwnerKey()) { |
806 PrefValueMap::const_iterator i; | 822 PrefValueMap::const_iterator i; |
807 for (i = migration_values_.begin(); i != migration_values_.end(); ++i) | 823 for (i = migration_values_.begin(); i != migration_values_.end(); ++i) |
808 DoSet(i->first, *i->second); | 824 DoSet(i->first, *i->second); |
809 migration_values_.Clear(); | 825 migration_values_.Clear(); |
810 } | 826 } |
811 } | 827 } |
812 | 828 |
813 } // namespace chromeos | 829 } // namespace chromeos |
OLD | NEW |