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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 policy.has_ephemeral_users_enabled() && | 368 policy.has_ephemeral_users_enabled() && |
369 policy.ephemeral_users_enabled().has_ephemeral_users_enabled() && | 369 policy.ephemeral_users_enabled().has_ephemeral_users_enabled() && |
370 policy.ephemeral_users_enabled().ephemeral_users_enabled()); | 370 policy.ephemeral_users_enabled().ephemeral_users_enabled()); |
371 | 371 |
372 base::ListValue* list = new base::ListValue(); | 372 base::ListValue* list = new base::ListValue(); |
373 const em::UserWhitelistProto& whitelist_proto = policy.user_whitelist(); | 373 const em::UserWhitelistProto& whitelist_proto = policy.user_whitelist(); |
374 const RepeatedPtrField<std::string>& whitelist = | 374 const RepeatedPtrField<std::string>& whitelist = |
375 whitelist_proto.user_whitelist(); | 375 whitelist_proto.user_whitelist(); |
376 for (RepeatedPtrField<std::string>::const_iterator it = whitelist.begin(); | 376 for (RepeatedPtrField<std::string>::const_iterator it = whitelist.begin(); |
377 it != whitelist.end(); ++it) { | 377 it != whitelist.end(); ++it) { |
378 list->Append(base::Value::CreateStringValue(*it)); | 378 list->Append(new base::StringValue(*it)); |
379 } | 379 } |
380 new_values_cache->SetValue(kAccountsPrefUsers, list); | 380 new_values_cache->SetValue(kAccountsPrefUsers, list); |
381 | 381 |
382 base::ListValue* account_list = new base::ListValue(); | 382 base::ListValue* account_list = new base::ListValue(); |
383 const RepeatedPtrField<em::DeviceLocalAccountInfoProto>& accounts = | 383 const RepeatedPtrField<em::DeviceLocalAccountInfoProto>& accounts = |
384 policy.device_local_accounts().account(); | 384 policy.device_local_accounts().account(); |
385 RepeatedPtrField<em::DeviceLocalAccountInfoProto>::const_iterator entry; | 385 RepeatedPtrField<em::DeviceLocalAccountInfoProto>::const_iterator entry; |
386 for (entry = accounts.begin(); entry != accounts.end(); ++entry) { | 386 for (entry = accounts.begin(); entry != accounts.end(); ++entry) { |
387 if (entry->has_id()) | 387 if (entry->has_id()) |
388 account_list->AppendString(entry->id()); | 388 account_list->AppendString(entry->id()); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 } | 438 } |
439 new_values_cache->SetValue(kAppPack, list); | 439 new_values_cache->SetValue(kAppPack, list); |
440 } | 440 } |
441 | 441 |
442 if (policy.has_start_up_urls()) { | 442 if (policy.has_start_up_urls()) { |
443 base::ListValue* list = new base::ListValue(); | 443 base::ListValue* list = new base::ListValue(); |
444 const em::StartUpUrlsProto& urls_proto = policy.start_up_urls(); | 444 const em::StartUpUrlsProto& urls_proto = policy.start_up_urls(); |
445 const RepeatedPtrField<std::string>& urls = urls_proto.start_up_urls(); | 445 const RepeatedPtrField<std::string>& urls = urls_proto.start_up_urls(); |
446 for (RepeatedPtrField<std::string>::const_iterator it = urls.begin(); | 446 for (RepeatedPtrField<std::string>::const_iterator it = urls.begin(); |
447 it != urls.end(); ++it) { | 447 it != urls.end(); ++it) { |
448 list->Append(base::Value::CreateStringValue(*it)); | 448 list->Append(new base::StringValue(*it)); |
449 } | 449 } |
450 new_values_cache->SetValue(kStartUpUrls, list); | 450 new_values_cache->SetValue(kStartUpUrls, list); |
451 } | 451 } |
452 } | 452 } |
453 | 453 |
454 void DeviceSettingsProvider::DecodeNetworkPolicies( | 454 void DeviceSettingsProvider::DecodeNetworkPolicies( |
455 const em::ChromeDeviceSettingsProto& policy, | 455 const em::ChromeDeviceSettingsProto& policy, |
456 PrefValueMap* new_values_cache) const { | 456 PrefValueMap* new_values_cache) const { |
457 new_values_cache->SetBoolean( | 457 new_values_cache->SetBoolean( |
458 kSignedDataRoamingEnabled, | 458 kSignedDataRoamingEnabled, |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 void DeviceSettingsProvider::AttemptMigration() { | 762 void DeviceSettingsProvider::AttemptMigration() { |
763 if (device_settings_service_->HasPrivateOwnerKey()) { | 763 if (device_settings_service_->HasPrivateOwnerKey()) { |
764 PrefValueMap::const_iterator i; | 764 PrefValueMap::const_iterator i; |
765 for (i = migration_values_.begin(); i != migration_values_.end(); ++i) | 765 for (i = migration_values_.begin(); i != migration_values_.end(); ++i) |
766 DoSet(i->first, *i->second); | 766 DoSet(i->first, *i->second); |
767 migration_values_.Clear(); | 767 migration_values_.Clear(); |
768 } | 768 } |
769 } | 769 } |
770 | 770 |
771 } // namespace chromeos | 771 } // namespace chromeos |
OLD | NEW |