OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_USER_MANAGER_USER_MANAGER_H_ | 5 #ifndef COMPONENTS_USER_MANAGER_USER_MANAGER_H_ |
6 #define COMPONENTS_USER_MANAGER_USER_MANAGER_H_ | 6 #define COMPONENTS_USER_MANAGER_USER_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "components/user_manager/user.h" | 10 #include "components/user_manager/user.h" |
11 #include "components/user_manager/user_manager_export.h" | 11 #include "components/user_manager/user_manager_export.h" |
| 12 #include "components/user_manager/user_type.h" |
12 | 13 |
13 namespace chromeos { | 14 namespace chromeos { |
14 class ScopedUserManagerEnabler; | 15 class ScopedUserManagerEnabler; |
15 } | 16 } |
16 | 17 |
17 namespace user_manager { | 18 namespace user_manager { |
18 | 19 |
19 class RemoveUserDelegate; | 20 class RemoveUserDelegate; |
20 | 21 |
21 // Interface for UserManagerBase - that provides base implementation for | 22 // Interface for UserManagerBase - that provides base implementation for |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 107 |
107 // Returns a list of users who have logged into this device previously. This | 108 // Returns a list of users who have logged into this device previously. This |
108 // is sorted by last login date with the most recent user at the beginning. | 109 // is sorted by last login date with the most recent user at the beginning. |
109 virtual const UserList& GetUsers() const = 0; | 110 virtual const UserList& GetUsers() const = 0; |
110 | 111 |
111 // Returns list of users allowed for logging in into multi-profile session. | 112 // Returns list of users allowed for logging in into multi-profile session. |
112 // Users that have a policy that prevents them from being added to the | 113 // Users that have a policy that prevents them from being added to the |
113 // multi-profile session will still be part of this list as long as they | 114 // multi-profile session will still be part of this list as long as they |
114 // are regular users (i.e. not a public session/supervised etc.). | 115 // are regular users (i.e. not a public session/supervised etc.). |
115 // Returns an empty list in case when primary user is not a regular one or | 116 // Returns an empty list in case when primary user is not a regular one or |
116 // has a policy that prohibids it to be part of multi-profile session. | 117 // has a policy that prohibits it to be part of multi-profile session. |
117 virtual UserList GetUsersAllowedForMultiProfile() const = 0; | 118 virtual UserList GetUsersAllowedForMultiProfile() const = 0; |
118 | 119 |
| 120 // Returns list of users allowed for supervised user creation. |
| 121 // Returns an empty list in cases when supervised user creation or adding new |
| 122 // users is restricted. |
| 123 virtual UserList GetUsersAllowedForSupervisedUsersCreation() const = 0; |
| 124 |
119 // Returns a list of users who are currently logged in. | 125 // Returns a list of users who are currently logged in. |
120 virtual const UserList& GetLoggedInUsers() const = 0; | 126 virtual const UserList& GetLoggedInUsers() const = 0; |
121 | 127 |
122 // Returns a list of users who are currently logged in in the LRU order - | 128 // Returns a list of users who are currently logged in in the LRU order - |
123 // so the active user is the first one in the list. If there is no user logged | 129 // so the active user is the first one in the list. If there is no user logged |
124 // in, the current user will be returned. | 130 // in, the current user will be returned. |
125 virtual const UserList& GetLRULoggedInUsers() const = 0; | 131 virtual const UserList& GetLRULoggedInUsers() const = 0; |
126 | 132 |
127 // Returns a list of users who can unlock the device. | 133 // Returns a list of users who can unlock the device. |
128 // This list is based on policy and whether user is able to do unlock. | 134 // This list is based on policy and whether user is able to do unlock. |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 // Saves user's displayed (non-canonical) email in local state preferences. | 234 // Saves user's displayed (non-canonical) email in local state preferences. |
229 // Ignored If there is no such user. | 235 // Ignored If there is no such user. |
230 virtual void SaveUserDisplayEmail(const std::string& user_id, | 236 virtual void SaveUserDisplayEmail(const std::string& user_id, |
231 const std::string& display_email) = 0; | 237 const std::string& display_email) = 0; |
232 | 238 |
233 // Returns the display email for user |user_id| if it is known (was | 239 // Returns the display email for user |user_id| if it is known (was |
234 // previously set by a |SaveUserDisplayEmail| call). | 240 // previously set by a |SaveUserDisplayEmail| call). |
235 // Otherwise, returns |user_id| itself. | 241 // Otherwise, returns |user_id| itself. |
236 virtual std::string GetUserDisplayEmail(const std::string& user_id) const = 0; | 242 virtual std::string GetUserDisplayEmail(const std::string& user_id) const = 0; |
237 | 243 |
| 244 // Saves user's type for user |user_id| into local state preferences. |
| 245 // Ignored If there is no such user. |
| 246 virtual void SaveUserType(const std::string& user_id, |
| 247 const UserType& user_type) = 0; |
| 248 |
238 // Returns true if current user is an owner. | 249 // Returns true if current user is an owner. |
239 virtual bool IsCurrentUserOwner() const = 0; | 250 virtual bool IsCurrentUserOwner() const = 0; |
240 | 251 |
241 // Returns true if current user is not existing one (hasn't signed in before). | 252 // Returns true if current user is not existing one (hasn't signed in before). |
242 virtual bool IsCurrentUserNew() const = 0; | 253 virtual bool IsCurrentUserNew() const = 0; |
243 | 254 |
244 // Returns true if data stored or cached for the current user outside that | 255 // Returns true if data stored or cached for the current user outside that |
245 // user's cryptohome (wallpaper, avatar, OAuth token status, display name, | 256 // user's cryptohome (wallpaper, avatar, OAuth token status, display name, |
246 // display email) is ephemeral. | 257 // display email) is ephemeral. |
247 virtual bool IsCurrentUserNonCryptohomeDataEphemeral() const = 0; | 258 virtual bool IsCurrentUserNonCryptohomeDataEphemeral() const = 0; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 static UserManager* GetForTesting(); | 332 static UserManager* GetForTesting(); |
322 | 333 |
323 // Sets UserManager instance to the given |user_manager|. | 334 // Sets UserManager instance to the given |user_manager|. |
324 // Returns the previous value of the instance. | 335 // Returns the previous value of the instance. |
325 static UserManager* SetForTesting(UserManager* user_manager); | 336 static UserManager* SetForTesting(UserManager* user_manager); |
326 }; | 337 }; |
327 | 338 |
328 } // namespace user_manager | 339 } // namespace user_manager |
329 | 340 |
330 #endif // COMPONENTS_USER_MANAGER_USER_MANAGER_H_ | 341 #endif // COMPONENTS_USER_MANAGER_USER_MANAGER_H_ |
OLD | NEW |