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 <set> | 7 #include <set> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 const std::string& account_id, | 31 const std::string& account_id, |
32 const std::string& kiosk_app_id, | 32 const std::string& kiosk_app_id, |
33 const std::string& kiosk_app_update_url) | 33 const std::string& kiosk_app_update_url) |
34 : type(type), | 34 : type(type), |
35 account_id(account_id), | 35 account_id(account_id), |
36 user_id(GenerateDeviceLocalAccountUserId(account_id, type)), | 36 user_id(GenerateDeviceLocalAccountUserId(account_id, type)), |
37 kiosk_app_id(kiosk_app_id), | 37 kiosk_app_id(kiosk_app_id), |
38 kiosk_app_update_url(kiosk_app_update_url) { | 38 kiosk_app_update_url(kiosk_app_update_url) { |
39 } | 39 } |
40 | 40 |
| 41 DeviceLocalAccount::DeviceLocalAccount(Type type) |
| 42 : type(type) { |
| 43 } |
| 44 |
41 DeviceLocalAccount::~DeviceLocalAccount() { | 45 DeviceLocalAccount::~DeviceLocalAccount() { |
42 } | 46 } |
43 | 47 |
44 std::string GenerateDeviceLocalAccountUserId(const std::string& account_id, | 48 std::string GenerateDeviceLocalAccountUserId(const std::string& account_id, |
45 DeviceLocalAccount::Type type) { | 49 DeviceLocalAccount::Type type) { |
46 std::string domain_prefix; | 50 std::string domain_prefix; |
47 switch (type) { | 51 switch (type) { |
48 case DeviceLocalAccount::TYPE_PUBLIC_SESSION: | 52 case DeviceLocalAccount::TYPE_PUBLIC_SESSION: |
49 domain_prefix = kPublicAccountDomainPrefix; | 53 domain_prefix = kPublicAccountDomainPrefix; |
50 break; | 54 break; |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 accounts.push_back( | 184 accounts.push_back( |
181 DeviceLocalAccount(static_cast<DeviceLocalAccount::Type>(type), | 185 DeviceLocalAccount(static_cast<DeviceLocalAccount::Type>(type), |
182 account_id, | 186 account_id, |
183 kiosk_app_id, | 187 kiosk_app_id, |
184 kiosk_app_update_url)); | 188 kiosk_app_update_url)); |
185 } | 189 } |
186 return accounts; | 190 return accounts; |
187 } | 191 } |
188 | 192 |
189 } // namespace policy | 193 } // namespace policy |
OLD | NEW |