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 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_LOCAL_ACCOUNT_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_LOCAL_ACCOUNT_H_ |
6 #define CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_LOCAL_ACCOUNT_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_LOCAL_ACCOUNT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 namespace chromeos { | 11 namespace chromeos { |
12 class CrosSettings; | 12 class CrosSettings; |
| 13 class OwnerSettingsServiceChromeOS; |
13 } | 14 } |
14 | 15 |
15 namespace policy { | 16 namespace policy { |
16 | 17 |
17 // This must match DeviceLocalAccountInfoProto.AccountType in | 18 // This must match DeviceLocalAccountInfoProto.AccountType in |
18 // chrome_device_policy.proto. | 19 // chrome_device_policy.proto. |
19 struct DeviceLocalAccount { | 20 struct DeviceLocalAccount { |
20 enum Type { | 21 enum Type { |
21 // A login-less, policy-configured browsing session. | 22 // A login-less, policy-configured browsing session. |
22 TYPE_PUBLIC_SESSION, | 23 TYPE_PUBLIC_SESSION, |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 }; | 58 }; |
58 | 59 |
59 std::string GenerateDeviceLocalAccountUserId(const std::string& account_id, | 60 std::string GenerateDeviceLocalAccountUserId(const std::string& account_id, |
60 DeviceLocalAccount::Type type); | 61 DeviceLocalAccount::Type type); |
61 | 62 |
62 // Determines whether |user_id| belongs to a device-local account and if so, | 63 // Determines whether |user_id| belongs to a device-local account and if so, |
63 // returns the type of device-local account in |type| unless |type| is NULL. | 64 // returns the type of device-local account in |type| unless |type| is NULL. |
64 bool IsDeviceLocalAccountUser(const std::string& user_id, | 65 bool IsDeviceLocalAccountUser(const std::string& user_id, |
65 DeviceLocalAccount::Type* type); | 66 DeviceLocalAccount::Type* type); |
66 | 67 |
67 // Stores a list of device-local accounts in |cros_settings|. The accounts are | 68 // Stores a list of device-local accounts in |service|. The accounts are stored |
68 // stored as a list of dictionaries with each dictionary containing the | 69 // as a list of dictionaries with each dictionary containing the information |
69 // information about one |DeviceLocalAccount|. | 70 // about one |DeviceLocalAccount|. |
70 void SetDeviceLocalAccounts( | 71 void SetDeviceLocalAccounts(chromeos::OwnerSettingsServiceChromeOS* service, |
71 chromeos::CrosSettings* cros_settings, | 72 const std::vector<DeviceLocalAccount>& accounts); |
72 const std::vector<DeviceLocalAccount>& accounts); | |
73 | 73 |
74 // Retrieves a list of device-local accounts from |cros_settings|. | 74 // Retrieves a list of device-local accounts from |cros_settings|. |
75 std::vector<DeviceLocalAccount> GetDeviceLocalAccounts( | 75 std::vector<DeviceLocalAccount> GetDeviceLocalAccounts( |
76 chromeos::CrosSettings* cros_settings); | 76 chromeos::CrosSettings* cros_settings); |
77 | 77 |
78 } // namespace policy | 78 } // namespace policy |
79 | 79 |
80 #endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_LOCAL_ACCOUNT_H_ | 80 #endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_LOCAL_ACCOUNT_H_ |
OLD | NEW |