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