OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_LOGIN_USERS_USER_MANAGER_INTERFACE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USERS_USER_MANAGER_INTERFACE_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USERS_USER_MANAGER_INTERFACE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USERS_USER_MANAGER_INTERFACE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "components/user_manager/user.h" | 9 #include "components/user_manager/user.h" |
10 #include "components/user_manager/user_type.h" | 10 #include "components/user_manager/user_type.h" |
11 | 11 |
| 12 class AccountId; |
| 13 |
12 namespace chromeos { | 14 namespace chromeos { |
13 | 15 |
14 class BootstrapManager; | 16 class BootstrapManager; |
15 class MultiProfileUserController; | 17 class MultiProfileUserController; |
16 class SupervisedUserManager; | 18 class SupervisedUserManager; |
17 class UserFlow; | 19 class UserFlow; |
18 class UserImageManager; | 20 class UserImageManager; |
19 | 21 |
20 // Chrome specific add-ons interface for the UserManager. | 22 // ChromeOS specific add-ons interface for the UserManager. |
21 class UserManagerInterface { | 23 class UserManagerInterface { |
22 public: | 24 public: |
23 UserManagerInterface() {} | 25 UserManagerInterface() {} |
24 virtual ~UserManagerInterface() {} | 26 virtual ~UserManagerInterface() {} |
25 | 27 |
26 virtual BootstrapManager* GetBootstrapManager() = 0; | 28 virtual BootstrapManager* GetBootstrapManager() = 0; |
27 virtual MultiProfileUserController* GetMultiProfileUserController() = 0; | 29 virtual MultiProfileUserController* GetMultiProfileUserController() = 0; |
28 virtual UserImageManager* GetUserImageManager(const std::string& user_id) = 0; | 30 virtual UserImageManager* GetUserImageManager( |
| 31 const AccountId& account_id) = 0; |
29 virtual SupervisedUserManager* GetSupervisedUserManager() = 0; | 32 virtual SupervisedUserManager* GetSupervisedUserManager() = 0; |
30 | 33 |
31 // Method that allows to set |flow| for user identified by |user_id|. | 34 // Method that allows to set |flow| for user identified by |account_id|. |
32 // Flow should be set before login attempt. | 35 // Flow should be set before login attempt. |
33 // Takes ownership of the |flow|, |flow| will be deleted in case of login | 36 // Takes ownership of the |flow|, |flow| will be deleted in case of login |
34 // failure. | 37 // failure. |
35 virtual void SetUserFlow(const std::string& user_id, UserFlow* flow) = 0; | 38 virtual void SetUserFlow(const AccountId& account_id, UserFlow* flow) = 0; |
36 | 39 |
37 // Return user flow for current user. Returns instance of DefaultUserFlow if | 40 // Return user flow for current user. Returns instance of DefaultUserFlow if |
38 // no flow was defined for current user, or user is not logged in. | 41 // no flow was defined for current user, or user is not logged in. |
39 // Returned value should not be cached. | 42 // Returned value should not be cached. |
40 virtual UserFlow* GetCurrentUserFlow() const = 0; | 43 virtual UserFlow* GetCurrentUserFlow() const = 0; |
41 | 44 |
42 // Return user flow for user identified by |user_id|. Returns instance of | 45 // Return user flow for user identified by |account_id|. Returns instance of |
43 // DefaultUserFlow if no flow was defined for user. | 46 // DefaultUserFlow if no flow was defined for user. |
44 // Returned value should not be cached. | 47 // Returned value should not be cached. |
45 virtual UserFlow* GetUserFlow(const std::string& user_id) const = 0; | 48 virtual UserFlow* GetUserFlow(const AccountId& account_id) const = 0; |
46 | 49 |
47 // Resets user flow for user identified by |user_id|. | 50 // Resets user flow for user identified by |account_id|. |
48 virtual void ResetUserFlow(const std::string& user_id) = 0; | 51 virtual void ResetUserFlow(const AccountId& account_id) = 0; |
49 | 52 |
50 // Returns list of users allowed for supervised user creation. | 53 // Returns list of users allowed for supervised user creation. |
51 // Returns an empty list in cases when supervised user creation or adding new | 54 // Returns an empty list in cases when supervised user creation or adding new |
52 // users is restricted. | 55 // users is restricted. |
53 virtual user_manager::UserList GetUsersAllowedForSupervisedUsersCreation() | 56 virtual user_manager::UserList GetUsersAllowedForSupervisedUsersCreation() |
54 const = 0; | 57 const = 0; |
55 | 58 |
56 DISALLOW_COPY_AND_ASSIGN(UserManagerInterface); | 59 DISALLOW_COPY_AND_ASSIGN(UserManagerInterface); |
57 }; | 60 }; |
58 | 61 |
59 } // namespace chromeos | 62 } // namespace chromeos |
60 | 63 |
61 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERS_USER_MANAGER_INTERFACE_H_ | 64 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERS_USER_MANAGER_INTERFACE_H_ |
OLD | NEW |