OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/policy/device_local_account.h" | 5 #include "chrome/browser/chromeos/policy/device_local_account.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
| 9 #include <memory> |
9 #include <set> | 10 #include <set> |
10 | 11 |
11 #include "base/logging.h" | 12 #include "base/logging.h" |
12 #include "base/macros.h" | 13 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | |
14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
16 #include "base/values.h" | 16 #include "base/values.h" |
17 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" | 17 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" |
18 #include "chrome/browser/chromeos/settings/cros_settings.h" | 18 #include "chrome/browser/chromeos/settings/cros_settings.h" |
19 #include "chromeos/login/user_names.h" | 19 #include "chromeos/login/user_names.h" |
20 #include "chromeos/settings/cros_settings_names.h" | 20 #include "chromeos/settings/cros_settings_names.h" |
21 #include "components/signin/core/account_id/account_id.h" | 21 #include "components/signin/core/account_id/account_id.h" |
22 #include "google_apis/gaia/gaia_auth_util.h" | 22 #include "google_apis/gaia/gaia_auth_util.h" |
23 | 23 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 if (type) | 94 if (type) |
95 *type = DeviceLocalAccount::TYPE_COUNT; | 95 *type = DeviceLocalAccount::TYPE_COUNT; |
96 return true; | 96 return true; |
97 } | 97 } |
98 | 98 |
99 void SetDeviceLocalAccounts(chromeos::OwnerSettingsServiceChromeOS* service, | 99 void SetDeviceLocalAccounts(chromeos::OwnerSettingsServiceChromeOS* service, |
100 const std::vector<DeviceLocalAccount>& accounts) { | 100 const std::vector<DeviceLocalAccount>& accounts) { |
101 base::ListValue list; | 101 base::ListValue list; |
102 for (std::vector<DeviceLocalAccount>::const_iterator it = accounts.begin(); | 102 for (std::vector<DeviceLocalAccount>::const_iterator it = accounts.begin(); |
103 it != accounts.end(); ++it) { | 103 it != accounts.end(); ++it) { |
104 scoped_ptr<base::DictionaryValue> entry(new base::DictionaryValue); | 104 std::unique_ptr<base::DictionaryValue> entry(new base::DictionaryValue); |
105 entry->SetStringWithoutPathExpansion( | 105 entry->SetStringWithoutPathExpansion( |
106 chromeos::kAccountsPrefDeviceLocalAccountsKeyId, | 106 chromeos::kAccountsPrefDeviceLocalAccountsKeyId, |
107 it->account_id); | 107 it->account_id); |
108 entry->SetIntegerWithoutPathExpansion( | 108 entry->SetIntegerWithoutPathExpansion( |
109 chromeos::kAccountsPrefDeviceLocalAccountsKeyType, | 109 chromeos::kAccountsPrefDeviceLocalAccountsKeyType, |
110 it->type); | 110 it->type); |
111 if (it->type == DeviceLocalAccount::TYPE_KIOSK_APP) { | 111 if (it->type == DeviceLocalAccount::TYPE_KIOSK_APP) { |
112 entry->SetStringWithoutPathExpansion( | 112 entry->SetStringWithoutPathExpansion( |
113 chromeos::kAccountsPrefDeviceLocalAccountsKeyKioskAppId, | 113 chromeos::kAccountsPrefDeviceLocalAccountsKeyKioskAppId, |
114 it->kiosk_app_id); | 114 it->kiosk_app_id); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 accounts.push_back( | 184 accounts.push_back( |
185 DeviceLocalAccount(static_cast<DeviceLocalAccount::Type>(type), | 185 DeviceLocalAccount(static_cast<DeviceLocalAccount::Type>(type), |
186 account_id, | 186 account_id, |
187 kiosk_app_id, | 187 kiosk_app_id, |
188 kiosk_app_update_url)); | 188 kiosk_app_update_url)); |
189 } | 189 } |
190 return accounts; | 190 return accounts; |
191 } | 191 } |
192 | 192 |
193 } // namespace policy | 193 } // namespace policy |
OLD | NEW |