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" |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 account->set_type( | 262 account->set_type( |
263 static_cast<em::DeviceLocalAccountInfoProto::AccountType>( | 263 static_cast<em::DeviceLocalAccountInfoProto::AccountType>( |
264 type)); | 264 type)); |
265 } | 265 } |
266 std::string kiosk_app_id; | 266 std::string kiosk_app_id; |
267 if (entry_dict->GetStringWithoutPathExpansion( | 267 if (entry_dict->GetStringWithoutPathExpansion( |
268 kAccountsPrefDeviceLocalAccountsKeyKioskAppId, | 268 kAccountsPrefDeviceLocalAccountsKeyKioskAppId, |
269 &kiosk_app_id)) { | 269 &kiosk_app_id)) { |
270 account->mutable_kiosk_app()->set_app_id(kiosk_app_id); | 270 account->mutable_kiosk_app()->set_app_id(kiosk_app_id); |
271 } | 271 } |
272 std::string kiosk_app_update_url; | |
273 if (entry_dict->GetStringWithoutPathExpansion( | |
274 kAccountsPrefDeviceLocalAccountsKeyKioskAppUpdateURL, | |
275 &kiosk_app_update_url)) { | |
276 account->mutable_kiosk_app()->set_update_url(kiosk_app_update_url); | |
277 } | |
278 } else { | 272 } else { |
279 NOTREACHED(); | 273 NOTREACHED(); |
280 } | 274 } |
281 } | 275 } |
282 } else { | 276 } else { |
283 NOTREACHED(); | 277 NOTREACHED(); |
284 } | 278 } |
285 } else if (prop == kAccountsPrefDeviceLocalAccountAutoLoginId) { | 279 } else if (prop == kAccountsPrefDeviceLocalAccountAutoLoginId) { |
286 em::DeviceLocalAccountsProto* device_local_accounts = | 280 em::DeviceLocalAccountsProto* device_local_accounts = |
287 device_settings_.mutable_device_local_accounts(); | 281 device_settings_.mutable_device_local_accounts(); |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 entry_dict->SetStringWithoutPathExpansion( | 508 entry_dict->SetStringWithoutPathExpansion( |
515 kAccountsPrefDeviceLocalAccountsKeyId, entry->account_id()); | 509 kAccountsPrefDeviceLocalAccountsKeyId, entry->account_id()); |
516 } | 510 } |
517 entry_dict->SetIntegerWithoutPathExpansion( | 511 entry_dict->SetIntegerWithoutPathExpansion( |
518 kAccountsPrefDeviceLocalAccountsKeyType, entry->type()); | 512 kAccountsPrefDeviceLocalAccountsKeyType, entry->type()); |
519 if (entry->kiosk_app().has_app_id()) { | 513 if (entry->kiosk_app().has_app_id()) { |
520 entry_dict->SetStringWithoutPathExpansion( | 514 entry_dict->SetStringWithoutPathExpansion( |
521 kAccountsPrefDeviceLocalAccountsKeyKioskAppId, | 515 kAccountsPrefDeviceLocalAccountsKeyKioskAppId, |
522 entry->kiosk_app().app_id()); | 516 entry->kiosk_app().app_id()); |
523 } | 517 } |
524 if (entry->kiosk_app().has_update_url()) { | |
525 entry_dict->SetStringWithoutPathExpansion( | |
526 kAccountsPrefDeviceLocalAccountsKeyKioskAppUpdateURL, | |
527 entry->kiosk_app().update_url()); | |
528 } | |
529 } else if (entry->has_deprecated_public_session_id()) { | 518 } else if (entry->has_deprecated_public_session_id()) { |
530 // Deprecated public session specification. | 519 // Deprecated public session specification. |
531 entry_dict->SetStringWithoutPathExpansion( | 520 entry_dict->SetStringWithoutPathExpansion( |
532 kAccountsPrefDeviceLocalAccountsKeyId, | 521 kAccountsPrefDeviceLocalAccountsKeyId, |
533 entry->deprecated_public_session_id()); | 522 entry->deprecated_public_session_id()); |
534 entry_dict->SetIntegerWithoutPathExpansion( | 523 entry_dict->SetIntegerWithoutPathExpansion( |
535 kAccountsPrefDeviceLocalAccountsKeyType, | 524 kAccountsPrefDeviceLocalAccountsKeyType, |
536 policy::DeviceLocalAccount::TYPE_PUBLIC_SESSION); | 525 policy::DeviceLocalAccount::TYPE_PUBLIC_SESSION); |
537 } | 526 } |
538 account_list->Append(entry_dict.release()); | 527 account_list->Append(entry_dict.release()); |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1014 void DeviceSettingsProvider::AttemptMigration() { | 1003 void DeviceSettingsProvider::AttemptMigration() { |
1015 if (device_settings_service_->HasPrivateOwnerKey()) { | 1004 if (device_settings_service_->HasPrivateOwnerKey()) { |
1016 PrefValueMap::const_iterator i; | 1005 PrefValueMap::const_iterator i; |
1017 for (i = migration_values_.begin(); i != migration_values_.end(); ++i) | 1006 for (i = migration_values_.begin(); i != migration_values_.end(); ++i) |
1018 DoSet(i->first, *i->second); | 1007 DoSet(i->first, *i->second); |
1019 migration_values_.Clear(); | 1008 migration_values_.Clear(); |
1020 } | 1009 } |
1021 } | 1010 } |
1022 | 1011 |
1023 } // namespace chromeos | 1012 } // namespace chromeos |
OLD | NEW |