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 CHROME_BROWSER_CHROMEOS_LOGIN_USERS_CHROME_USER_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USERS_CHROME_USER_MANAGER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USERS_CHROME_USER_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USERS_CHROME_USER_MANAGER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "components/user_manager/user.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/task_runner.h" |
| 11 #include "chrome/browser/chromeos/login/users/user_manager_interface.h" |
10 #include "components/user_manager/user_manager_base.h" | 12 #include "components/user_manager/user_manager_base.h" |
11 | 13 |
12 namespace base { | |
13 class TaskRunner; | |
14 } | |
15 | |
16 namespace chromeos { | 14 namespace chromeos { |
17 | 15 |
18 class MultiProfileUserController; | |
19 class SupervisedUserManager; | |
20 class UserFlow; | |
21 class UserImageManager; | |
22 | |
23 // Chrome specific interface of the UserManager. | 16 // Chrome specific interface of the UserManager. |
24 class ChromeUserManager : public user_manager::UserManagerBase { | 17 class ChromeUserManager : public user_manager::UserManagerBase, |
| 18 public UserManagerInterface { |
25 public: | 19 public: |
26 ChromeUserManager(scoped_refptr<base::TaskRunner> task_runner, | 20 ChromeUserManager(scoped_refptr<base::TaskRunner> task_runner, |
27 scoped_refptr<base::TaskRunner> blocking_task_runner); | 21 scoped_refptr<base::TaskRunner> blocking_task_runner); |
28 ~ChromeUserManager() override; | 22 ~ChromeUserManager() override; |
29 | 23 |
30 // Returns current ChromeUserManager or NULL if instance hasn't been | 24 // Returns current ChromeUserManager or NULL if instance hasn't been |
31 // yet initialized. | 25 // yet initialized. |
32 static ChromeUserManager* Get(); | 26 static ChromeUserManager* Get(); |
33 | 27 |
34 // Helper method for sorting out of user list only users that can create | 28 // Helper method for sorting out of user list only users that can create |
35 // supervised users. | 29 // supervised users. |
36 static user_manager::UserList GetUsersAllowedAsSupervisedUserManagers( | 30 static user_manager::UserList GetUsersAllowedAsSupervisedUserManagers( |
37 const user_manager::UserList& user_list); | 31 const user_manager::UserList& user_list); |
38 | 32 |
39 virtual MultiProfileUserController* GetMultiProfileUserController() = 0; | |
40 virtual UserImageManager* GetUserImageManager(const std::string& user_id) = 0; | |
41 virtual SupervisedUserManager* GetSupervisedUserManager() = 0; | |
42 | |
43 // Method that allows to set |flow| for user identified by |user_id|. | |
44 // Flow should be set before login attempt. | |
45 // Takes ownership of the |flow|, |flow| will be deleted in case of login | |
46 // failure. | |
47 virtual void SetUserFlow(const std::string& user_id, UserFlow* flow) = 0; | |
48 | |
49 // Return user flow for current user. Returns instance of DefaultUserFlow if | |
50 // no flow was defined for current user, or user is not logged in. | |
51 // Returned value should not be cached. | |
52 virtual UserFlow* GetCurrentUserFlow() const = 0; | |
53 | |
54 // Return user flow for user identified by |user_id|. Returns instance of | |
55 // DefaultUserFlow if no flow was defined for user. | |
56 // Returned value should not be cached. | |
57 virtual UserFlow* GetUserFlow(const std::string& user_id) const = 0; | |
58 | |
59 // Resets user flow for user identified by |user_id|. | |
60 virtual void ResetUserFlow(const std::string& user_id) = 0; | |
61 | |
62 DISALLOW_COPY_AND_ASSIGN(ChromeUserManager); | 33 DISALLOW_COPY_AND_ASSIGN(ChromeUserManager); |
63 }; | 34 }; |
64 | 35 |
65 } // namespace chromeos | 36 } // namespace chromeos |
66 | 37 |
67 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERS_CHROME_USER_MANAGER_H_ | 38 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERS_CHROME_USER_MANAGER_H_ |
OLD | NEW |