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 |
(...skipping 10 matching lines...) Expand all Loading... |
21 // A login-less, policy-configured browsing session. | 21 // A login-less, policy-configured browsing session. |
22 TYPE_PUBLIC_SESSION, | 22 TYPE_PUBLIC_SESSION, |
23 // An account that serves as a container for a single full-screen app. | 23 // An account that serves as a container for a single full-screen app. |
24 TYPE_KIOSK_APP, | 24 TYPE_KIOSK_APP, |
25 // Sentinel, must be last. | 25 // Sentinel, must be last. |
26 TYPE_COUNT | 26 TYPE_COUNT |
27 }; | 27 }; |
28 | 28 |
29 DeviceLocalAccount(Type type, | 29 DeviceLocalAccount(Type type, |
30 const std::string& account_id, | 30 const std::string& account_id, |
31 const std::string& kiosk_app_id, | 31 const std::string& kiosk_app_id); |
32 const std::string& kiosk_app_update_url); | |
33 ~DeviceLocalAccount(); | 32 ~DeviceLocalAccount(); |
34 | 33 |
35 Type type; | 34 Type type; |
36 std::string account_id; | 35 std::string account_id; |
37 std::string user_id; | 36 std::string user_id; |
38 std::string kiosk_app_id; | 37 std::string kiosk_app_id; |
39 std::string kiosk_app_update_url; | |
40 }; | 38 }; |
41 | 39 |
42 std::string GenerateDeviceLocalAccountUserId(const std::string& account_id, | 40 std::string GenerateDeviceLocalAccountUserId(const std::string& account_id, |
43 DeviceLocalAccount::Type type); | 41 DeviceLocalAccount::Type type); |
44 | 42 |
45 bool IsDeviceLocalAccountUser(const std::string& user_id); | 43 bool IsDeviceLocalAccountUser(const std::string& user_id); |
46 | 44 |
47 bool IsKioskAppUser(const std::string& user_id); | 45 bool IsKioskAppUser(const std::string& user_id); |
48 | 46 |
49 // Stores a list of device-local accounts in |cros_settings|. The accounts are | 47 // Stores a list of device-local accounts in |cros_settings|. The accounts are |
50 // stored as a list of dictionaries with each dictionary containing the | 48 // stored as a list of dictionaries with each dictionary containing the |
51 // information about one |DeviceLocalAccount|. | 49 // information about one |DeviceLocalAccount|. |
52 void SetDeviceLocalAccounts( | 50 void SetDeviceLocalAccounts( |
53 chromeos::CrosSettings* cros_settings, | 51 chromeos::CrosSettings* cros_settings, |
54 const std::vector<DeviceLocalAccount>& accounts); | 52 const std::vector<DeviceLocalAccount>& accounts); |
55 | 53 |
56 // Retrieves a list of device-local accounts from |cros_settings|. | 54 // Retrieves a list of device-local accounts from |cros_settings|. |
57 std::vector<DeviceLocalAccount> GetDeviceLocalAccounts( | 55 std::vector<DeviceLocalAccount> GetDeviceLocalAccounts( |
58 chromeos::CrosSettings* cros_settings); | 56 chromeos::CrosSettings* cros_settings); |
59 | 57 |
60 } // namespace policy | 58 } // namespace policy |
61 | 59 |
62 #endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_LOCAL_ACCOUNT_H_ | 60 #endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_LOCAL_ACCOUNT_H_ |
OLD | NEW |