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 <memory> |
10 #include <set> | 10 #include <set> |
| 11 #include <utility> |
11 | 12 |
12 #include "base/logging.h" | 13 #include "base/logging.h" |
13 #include "base/macros.h" | 14 #include "base/macros.h" |
14 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
15 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
16 #include "base/values.h" | 17 #include "base/values.h" |
17 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" | 18 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" |
18 #include "chrome/browser/chromeos/settings/cros_settings.h" | 19 #include "chrome/browser/chromeos/settings/cros_settings.h" |
19 #include "chromeos/login/user_names.h" | 20 #include "chromeos/login/user_names.h" |
20 #include "chromeos/settings/cros_settings_names.h" | 21 #include "chromeos/settings/cros_settings_names.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 if (it->type == DeviceLocalAccount::TYPE_KIOSK_APP) { | 115 if (it->type == DeviceLocalAccount::TYPE_KIOSK_APP) { |
115 entry->SetStringWithoutPathExpansion( | 116 entry->SetStringWithoutPathExpansion( |
116 chromeos::kAccountsPrefDeviceLocalAccountsKeyKioskAppId, | 117 chromeos::kAccountsPrefDeviceLocalAccountsKeyKioskAppId, |
117 it->kiosk_app_id); | 118 it->kiosk_app_id); |
118 if (!it->kiosk_app_update_url.empty()) { | 119 if (!it->kiosk_app_update_url.empty()) { |
119 entry->SetStringWithoutPathExpansion( | 120 entry->SetStringWithoutPathExpansion( |
120 chromeos::kAccountsPrefDeviceLocalAccountsKeyKioskAppUpdateURL, | 121 chromeos::kAccountsPrefDeviceLocalAccountsKeyKioskAppUpdateURL, |
121 it->kiosk_app_update_url); | 122 it->kiosk_app_update_url); |
122 } | 123 } |
123 } | 124 } |
124 list.Append(entry.release()); | 125 list.Append(std::move(entry)); |
125 } | 126 } |
126 | 127 |
127 service->Set(chromeos::kAccountsPrefDeviceLocalAccounts, list); | 128 service->Set(chromeos::kAccountsPrefDeviceLocalAccounts, list); |
128 } | 129 } |
129 | 130 |
130 std::vector<DeviceLocalAccount> GetDeviceLocalAccounts( | 131 std::vector<DeviceLocalAccount> GetDeviceLocalAccounts( |
131 chromeos::CrosSettings* cros_settings) { | 132 chromeos::CrosSettings* cros_settings) { |
132 std::vector<DeviceLocalAccount> accounts; | 133 std::vector<DeviceLocalAccount> accounts; |
133 | 134 |
134 const base::ListValue* list = NULL; | 135 const base::ListValue* list = NULL; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 accounts.push_back( | 188 accounts.push_back( |
188 DeviceLocalAccount(static_cast<DeviceLocalAccount::Type>(type), | 189 DeviceLocalAccount(static_cast<DeviceLocalAccount::Type>(type), |
189 account_id, | 190 account_id, |
190 kiosk_app_id, | 191 kiosk_app_id, |
191 kiosk_app_update_url)); | 192 kiosk_app_update_url)); |
192 } | 193 } |
193 return accounts; | 194 return accounts; |
194 } | 195 } |
195 | 196 |
196 } // namespace policy | 197 } // namespace policy |
OLD | NEW |