| 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/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
| 14 #include "base/prefs/pref_service.h" | 14 #include "base/prefs/pref_service.h" |
| 15 #include "base/string_util.h" | 15 #include "base/string_util.h" |
| 16 #include "base/threading/thread_restrictions.h" | 16 #include "base/threading/thread_restrictions.h" |
| 17 #include "base/values.h" | 17 #include "base/values.h" |
| 18 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
| 19 #include "chrome/browser/chromeos/cros/cros_library.h" | 19 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 20 #include "chrome/browser/chromeos/cros/network_library.h" | 20 #include "chrome/browser/chromeos/cros/network_library.h" |
| 21 #include "chrome/browser/chromeos/policy/device_local_account.h" |
| 21 #include "chrome/browser/chromeos/settings/cros_settings.h" | 22 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 22 #include "chrome/browser/chromeos/settings/cros_settings_names.h" | 23 #include "chrome/browser/chromeos/settings/cros_settings_names.h" |
| 23 #include "chrome/browser/chromeos/settings/device_settings_cache.h" | 24 #include "chrome/browser/chromeos/settings/device_settings_cache.h" |
| 24 #include "chrome/browser/policy/browser_policy_connector.h" | 25 #include "chrome/browser/policy/browser_policy_connector.h" |
| 25 #include "chrome/browser/policy/cloud/cloud_policy_constants.h" | 26 #include "chrome/browser/policy/cloud/cloud_policy_constants.h" |
| 26 #include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h" | 27 #include "chrome/browser/policy/proto/cloud/device_management_backend.pb.h" |
| 27 #include "chrome/browser/ui/options/options_util.h" | 28 #include "chrome/browser/ui/options/options_util.h" |
| 28 #include "chrome/installer/util/google_update_settings.h" | 29 #include "chrome/installer/util/google_update_settings.h" |
| 29 #include "chromeos/chromeos_switches.h" | 30 #include "chromeos/chromeos_switches.h" |
| 30 | 31 |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 kAccountsPrefDeviceLocalAccountsKeyKioskAppUpdateURL, | 496 kAccountsPrefDeviceLocalAccountsKeyKioskAppUpdateURL, |
| 496 entry->kiosk_app().update_url()); | 497 entry->kiosk_app().update_url()); |
| 497 } | 498 } |
| 498 } else if (entry->has_deprecated_public_session_id()) { | 499 } else if (entry->has_deprecated_public_session_id()) { |
| 499 // Deprecated public session specification. | 500 // Deprecated public session specification. |
| 500 entry_dict->SetStringWithoutPathExpansion( | 501 entry_dict->SetStringWithoutPathExpansion( |
| 501 kAccountsPrefDeviceLocalAccountsKeyId, | 502 kAccountsPrefDeviceLocalAccountsKeyId, |
| 502 entry->deprecated_public_session_id()); | 503 entry->deprecated_public_session_id()); |
| 503 entry_dict->SetIntegerWithoutPathExpansion( | 504 entry_dict->SetIntegerWithoutPathExpansion( |
| 504 kAccountsPrefDeviceLocalAccountsKeyType, | 505 kAccountsPrefDeviceLocalAccountsKeyType, |
| 505 DEVICE_LOCAL_ACCOUNT_TYPE_PUBLIC_SESSION); | 506 policy::DeviceLocalAccount::TYPE_PUBLIC_SESSION); |
| 506 } | 507 } |
| 507 account_list->Append(entry_dict.release()); | 508 account_list->Append(entry_dict.release()); |
| 508 } | 509 } |
| 509 } | 510 } |
| 510 new_values_cache->SetValue(kAccountsPrefDeviceLocalAccounts, | 511 new_values_cache->SetValue(kAccountsPrefDeviceLocalAccounts, |
| 511 account_list.release()); | 512 account_list.release()); |
| 512 | 513 |
| 513 if (policy.has_device_local_accounts()) { | 514 if (policy.has_device_local_accounts()) { |
| 514 if (policy.device_local_accounts().has_auto_login_id()) { | 515 if (policy.device_local_accounts().has_auto_login_id()) { |
| 515 new_values_cache->SetString( | 516 new_values_cache->SetString( |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 940 void DeviceSettingsProvider::AttemptMigration() { | 941 void DeviceSettingsProvider::AttemptMigration() { |
| 941 if (device_settings_service_->HasPrivateOwnerKey()) { | 942 if (device_settings_service_->HasPrivateOwnerKey()) { |
| 942 PrefValueMap::const_iterator i; | 943 PrefValueMap::const_iterator i; |
| 943 for (i = migration_values_.begin(); i != migration_values_.end(); ++i) | 944 for (i = migration_values_.begin(); i != migration_values_.end(); ++i) |
| 944 DoSet(i->first, *i->second); | 945 DoSet(i->first, *i->second); |
| 945 migration_values_.Clear(); | 946 migration_values_.Clear(); |
| 946 } | 947 } |
| 947 } | 948 } |
| 948 | 949 |
| 949 } // namespace chromeos | 950 } // namespace chromeos |
| OLD | NEW |