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