| 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/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 policy.has_ephemeral_users_enabled() && | 351 policy.has_ephemeral_users_enabled() && |
| 352 policy.ephemeral_users_enabled().has_ephemeral_users_enabled() && | 352 policy.ephemeral_users_enabled().has_ephemeral_users_enabled() && |
| 353 policy.ephemeral_users_enabled().ephemeral_users_enabled()); | 353 policy.ephemeral_users_enabled().ephemeral_users_enabled()); |
| 354 | 354 |
| 355 base::ListValue* list = new base::ListValue(); | 355 base::ListValue* list = new base::ListValue(); |
| 356 const em::UserWhitelistProto& whitelist_proto = policy.user_whitelist(); | 356 const em::UserWhitelistProto& whitelist_proto = policy.user_whitelist(); |
| 357 const RepeatedPtrField<std::string>& whitelist = | 357 const RepeatedPtrField<std::string>& whitelist = |
| 358 whitelist_proto.user_whitelist(); | 358 whitelist_proto.user_whitelist(); |
| 359 for (RepeatedPtrField<std::string>::const_iterator it = whitelist.begin(); | 359 for (RepeatedPtrField<std::string>::const_iterator it = whitelist.begin(); |
| 360 it != whitelist.end(); ++it) { | 360 it != whitelist.end(); ++it) { |
| 361 list->Append(new base::StringValue(*it)); | 361 list->Append(base::Value::CreateStringValue(*it)); |
| 362 } | 362 } |
| 363 new_values_cache->SetValue(kAccountsPrefUsers, list); | 363 new_values_cache->SetValue(kAccountsPrefUsers, list); |
| 364 } | 364 } |
| 365 | 365 |
| 366 void DeviceSettingsProvider::DecodeKioskPolicies( | 366 void DeviceSettingsProvider::DecodeKioskPolicies( |
| 367 const em::ChromeDeviceSettingsProto& policy, | 367 const em::ChromeDeviceSettingsProto& policy, |
| 368 PrefValueMap* new_values_cache) const { | 368 PrefValueMap* new_values_cache) const { |
| 369 if (policy.has_forced_logout_timeouts()) { | 369 if (policy.has_forced_logout_timeouts()) { |
| 370 if (policy.forced_logout_timeouts().has_idle_logout_timeout()) { | 370 if (policy.forced_logout_timeouts().has_idle_logout_timeout()) { |
| 371 new_values_cache->SetInteger( | 371 new_values_cache->SetInteger( |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 } | 411 } |
| 412 new_values_cache->SetValue(kAppPack, list); | 412 new_values_cache->SetValue(kAppPack, list); |
| 413 } | 413 } |
| 414 | 414 |
| 415 if (policy.has_start_up_urls()) { | 415 if (policy.has_start_up_urls()) { |
| 416 base::ListValue* list = new base::ListValue(); | 416 base::ListValue* list = new base::ListValue(); |
| 417 const em::StartUpUrlsProto& urls_proto = policy.start_up_urls(); | 417 const em::StartUpUrlsProto& urls_proto = policy.start_up_urls(); |
| 418 const RepeatedPtrField<std::string>& urls = urls_proto.start_up_urls(); | 418 const RepeatedPtrField<std::string>& urls = urls_proto.start_up_urls(); |
| 419 for (RepeatedPtrField<std::string>::const_iterator it = urls.begin(); | 419 for (RepeatedPtrField<std::string>::const_iterator it = urls.begin(); |
| 420 it != urls.end(); ++it) { | 420 it != urls.end(); ++it) { |
| 421 list->Append(new base::StringValue(*it)); | 421 list->Append(base::Value::CreateStringValue(*it)); |
| 422 } | 422 } |
| 423 new_values_cache->SetValue(kStartUpUrls, list); | 423 new_values_cache->SetValue(kStartUpUrls, list); |
| 424 } | 424 } |
| 425 } | 425 } |
| 426 | 426 |
| 427 void DeviceSettingsProvider::DecodeNetworkPolicies( | 427 void DeviceSettingsProvider::DecodeNetworkPolicies( |
| 428 const em::ChromeDeviceSettingsProto& policy, | 428 const em::ChromeDeviceSettingsProto& policy, |
| 429 PrefValueMap* new_values_cache) const { | 429 PrefValueMap* new_values_cache) const { |
| 430 new_values_cache->SetBoolean( | 430 new_values_cache->SetBoolean( |
| 431 kSignedDataRoamingEnabled, | 431 kSignedDataRoamingEnabled, |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 void DeviceSettingsProvider::AttemptMigration() { | 735 void DeviceSettingsProvider::AttemptMigration() { |
| 736 if (device_settings_service_->HasPrivateOwnerKey()) { | 736 if (device_settings_service_->HasPrivateOwnerKey()) { |
| 737 PrefValueMap::const_iterator i; | 737 PrefValueMap::const_iterator i; |
| 738 for (i = migration_values_.begin(); i != migration_values_.end(); ++i) | 738 for (i = migration_values_.begin(); i != migration_values_.end(); ++i) |
| 739 DoSet(i->first, *i->second); | 739 DoSet(i->first, *i->second); |
| 740 migration_values_.Clear(); | 740 migration_values_.Clear(); |
| 741 } | 741 } |
| 742 } | 742 } |
| 743 | 743 |
| 744 } // namespace chromeos | 744 } // namespace chromeos |
| OLD | NEW |