| 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_USER_MANAGER_BASE_H_ | 5 #ifndef COMPONENTS_USER_MANAGER_USER_MANAGER_BASE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USERS_USER_MANAGER_BASE_H_ | 6 #define COMPONENTS_USER_MANAGER_USER_MANAGER_BASE_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
| 15 #include "base/synchronization/lock.h" | 15 #include "base/synchronization/lock.h" |
| 16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
| 17 #include "chrome/browser/chromeos/login/users/user_manager.h" | |
| 18 #include "components/user_manager/user.h" | 17 #include "components/user_manager/user.h" |
| 18 #include "components/user_manager/user_manager.h" |
| 19 #include "components/user_manager/user_manager_export.h" |
| 19 | 20 |
| 20 class PrefService; | 21 class PrefService; |
| 21 class PrefRegistrySimple; | 22 class PrefRegistrySimple; |
| 22 | 23 |
| 23 namespace chromeos { | 24 namespace base { |
| 25 class ListValue; |
| 26 } |
| 27 |
| 28 namespace user_manager { |
| 24 | 29 |
| 25 class RemoveUserDelegate; | 30 class RemoveUserDelegate; |
| 26 | 31 |
| 27 // Base implementation of the UserManager interface. | 32 // Base implementation of the UserManager interface. |
| 28 class UserManagerBase : public UserManager { | 33 class USER_MANAGER_EXPORT UserManagerBase : public UserManager { |
| 29 public: | 34 public: |
| 30 virtual ~UserManagerBase(); | 35 virtual ~UserManagerBase(); |
| 31 | 36 |
| 32 // Registers UserManagerBase preferences. | 37 // Registers UserManagerBase preferences. |
| 33 static void RegisterPrefs(PrefRegistrySimple* registry); | 38 static void RegisterPrefs(PrefRegistrySimple* registry); |
| 34 | 39 |
| 35 // UserManager implementation: | 40 // UserManager implementation: |
| 36 virtual void Shutdown() OVERRIDE; | 41 virtual void Shutdown() OVERRIDE; |
| 37 virtual const user_manager::UserList& GetUsers() const OVERRIDE; | 42 virtual const UserList& GetUsers() const OVERRIDE; |
| 38 virtual const user_manager::UserList& GetLoggedInUsers() const OVERRIDE; | 43 virtual const UserList& GetLoggedInUsers() const OVERRIDE; |
| 39 virtual const user_manager::UserList& GetLRULoggedInUsers() const OVERRIDE; | 44 virtual const UserList& GetLRULoggedInUsers() const OVERRIDE; |
| 40 virtual const std::string& GetOwnerEmail() const OVERRIDE; | 45 virtual const std::string& GetOwnerEmail() const OVERRIDE; |
| 41 virtual void UserLoggedIn(const std::string& user_id, | 46 virtual void UserLoggedIn(const std::string& user_id, |
| 42 const std::string& user_id_hash, | 47 const std::string& user_id_hash, |
| 43 bool browser_restart) OVERRIDE; | 48 bool browser_restart) OVERRIDE; |
| 44 virtual void SwitchActiveUser(const std::string& user_id) OVERRIDE; | 49 virtual void SwitchActiveUser(const std::string& user_id) OVERRIDE; |
| 45 virtual void SessionStarted() OVERRIDE; | 50 virtual void SessionStarted() OVERRIDE; |
| 46 virtual void RemoveUser(const std::string& user_id, | 51 virtual void RemoveUser(const std::string& user_id, |
| 47 RemoveUserDelegate* delegate) OVERRIDE; | 52 RemoveUserDelegate* delegate) OVERRIDE; |
| 48 virtual void RemoveUserFromList(const std::string& user_id) OVERRIDE; | 53 virtual void RemoveUserFromList(const std::string& user_id) OVERRIDE; |
| 49 virtual bool IsKnownUser(const std::string& user_id) const OVERRIDE; | 54 virtual bool IsKnownUser(const std::string& user_id) const OVERRIDE; |
| 50 virtual const user_manager::User* FindUser( | 55 virtual const User* FindUser(const std::string& user_id) const OVERRIDE; |
| 51 const std::string& user_id) const OVERRIDE; | 56 virtual User* FindUserAndModify(const std::string& user_id) OVERRIDE; |
| 52 virtual user_manager::User* FindUserAndModify( | 57 virtual const User* GetLoggedInUser() const OVERRIDE; |
| 53 const std::string& user_id) OVERRIDE; | 58 virtual User* GetLoggedInUser() OVERRIDE; |
| 54 virtual const user_manager::User* GetLoggedInUser() const OVERRIDE; | 59 virtual const User* GetActiveUser() const OVERRIDE; |
| 55 virtual user_manager::User* GetLoggedInUser() OVERRIDE; | 60 virtual User* GetActiveUser() OVERRIDE; |
| 56 virtual const user_manager::User* GetActiveUser() const OVERRIDE; | 61 virtual const User* GetPrimaryUser() const OVERRIDE; |
| 57 virtual user_manager::User* GetActiveUser() OVERRIDE; | |
| 58 virtual const user_manager::User* GetPrimaryUser() const OVERRIDE; | |
| 59 virtual void SaveUserOAuthStatus( | 62 virtual void SaveUserOAuthStatus( |
| 60 const std::string& user_id, | 63 const std::string& user_id, |
| 61 user_manager::User::OAuthTokenStatus oauth_token_status) OVERRIDE; | 64 User::OAuthTokenStatus oauth_token_status) OVERRIDE; |
| 62 virtual void SaveForceOnlineSignin(const std::string& user_id, | 65 virtual void SaveForceOnlineSignin(const std::string& user_id, |
| 63 bool force_online_signin) OVERRIDE; | 66 bool force_online_signin) OVERRIDE; |
| 64 virtual void SaveUserDisplayName(const std::string& user_id, | 67 virtual void SaveUserDisplayName(const std::string& user_id, |
| 65 const base::string16& display_name) OVERRIDE; | 68 const base::string16& display_name) OVERRIDE; |
| 66 virtual base::string16 GetUserDisplayName( | 69 virtual base::string16 GetUserDisplayName( |
| 67 const std::string& user_id) const OVERRIDE; | 70 const std::string& user_id) const OVERRIDE; |
| 68 virtual void SaveUserDisplayEmail(const std::string& user_id, | 71 virtual void SaveUserDisplayEmail(const std::string& user_id, |
| 69 const std::string& display_email) OVERRIDE; | 72 const std::string& display_email) OVERRIDE; |
| 70 virtual std::string GetUserDisplayEmail( | 73 virtual std::string GetUserDisplayEmail( |
| 71 const std::string& user_id) const OVERRIDE; | 74 const std::string& user_id) const OVERRIDE; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 101 static void ParseUserList(const base::ListValue& users_list, | 104 static void ParseUserList(const base::ListValue& users_list, |
| 102 const std::set<std::string>& existing_users, | 105 const std::set<std::string>& existing_users, |
| 103 std::vector<std::string>* users_vector, | 106 std::vector<std::string>* users_vector, |
| 104 std::set<std::string>* users_set); | 107 std::set<std::string>* users_set); |
| 105 | 108 |
| 106 protected: | 109 protected: |
| 107 UserManagerBase(); | 110 UserManagerBase(); |
| 108 | 111 |
| 109 // Adds |user| to users list, and adds it to front of LRU list. It is assumed | 112 // Adds |user| to users list, and adds it to front of LRU list. It is assumed |
| 110 // that there is no user with same id. | 113 // that there is no user with same id. |
| 111 virtual void AddUserRecord(user_manager::User* user); | 114 virtual void AddUserRecord(User* user); |
| 112 | 115 |
| 113 // Returns true if trusted device policies have successfully been retrieved | 116 // Returns true if trusted device policies have successfully been retrieved |
| 114 // and ephemeral users are enabled. | 117 // and ephemeral users are enabled. |
| 115 virtual bool AreEphemeralUsersEnabled() const = 0; | 118 virtual bool AreEphemeralUsersEnabled() const = 0; |
| 116 | 119 |
| 117 // Returns true if user may be removed. | 120 // Returns true if user may be removed. |
| 118 virtual bool CanUserBeRemoved(const user_manager::User* user) const; | 121 virtual bool CanUserBeRemoved(const User* user) const; |
| 119 | 122 |
| 120 // A wrapper around C++ delete operator. Deletes |user|, and when |user| | 123 // A wrapper around C++ delete operator. Deletes |user|, and when |user| |
| 121 // equals to active_user_, active_user_ is reset to NULL. | 124 // equals to active_user_, active_user_ is reset to NULL. |
| 122 virtual void DeleteUser(user_manager::User* user); | 125 virtual void DeleteUser(User* user); |
| 123 | 126 |
| 124 // Returns the locale used by the application. | 127 // Returns the locale used by the application. |
| 125 virtual const std::string& GetApplicationLocale() const = 0; | 128 virtual const std::string& GetApplicationLocale() const = 0; |
| 126 | 129 |
| 127 // Returns "Local State" PrefService instance. | 130 // Returns "Local State" PrefService instance. |
| 128 virtual PrefService* GetLocalState() const = 0; | 131 virtual PrefService* GetLocalState() const = 0; |
| 129 | 132 |
| 130 // Loads |users_| from Local State if the list has not been loaded yet. | 133 // Loads |users_| from Local State if the list has not been loaded yet. |
| 131 // Subsequent calls have no effect. Must be called on the UI thread. | 134 // Subsequent calls have no effect. Must be called on the UI thread. |
| 132 void EnsureUsersLoaded(); | 135 void EnsureUsersLoaded(); |
| 133 | 136 |
| 137 // Handle OAuth token |status| change for |user_id|. |
| 138 virtual void HandleUserOAuthTokenStatusChange( |
| 139 const std::string& user_id, |
| 140 User::OAuthTokenStatus status) const = 0; |
| 141 |
| 134 // Returns true if device is enterprise managed. | 142 // Returns true if device is enterprise managed. |
| 135 virtual bool IsEnterpriseManaged() const = 0; | 143 virtual bool IsEnterpriseManaged() const = 0; |
| 136 | 144 |
| 137 // Helper function that copies users from |users_list| to |users_vector| and | 145 // Helper function that copies users from |users_list| to |users_vector| and |
| 138 // |users_set|. Duplicates and users already present in |existing_users| are | 146 // |users_set|. Duplicates and users already present in |existing_users| are |
| 139 // skipped. | 147 // skipped. |
| 140 // Loads public accounts from the Local state and fills in | 148 // Loads public accounts from the Local state and fills in |
| 141 // |public_sessions_set|. | 149 // |public_sessions_set|. |
| 142 virtual void LoadPublicAccounts( | 150 virtual void LoadPublicAccounts( |
| 143 std::set<std::string>* public_sessions_set) = 0; | 151 std::set<std::string>* public_sessions_set) = 0; |
| 144 | 152 |
| 145 // Notifies that user has logged in. | 153 // Notifies that user has logged in. |
| 146 virtual void NotifyOnLogin(); | 154 virtual void NotifyOnLogin(); |
| 147 | 155 |
| 148 // Notifies observers that another user was added to the session. | 156 // Notifies observers that another user was added to the session. |
| 149 // If |user_switch_pending| is true this means that user has not been fully | 157 // If |user_switch_pending| is true this means that user has not been fully |
| 150 // initialized yet like waiting for profile to be loaded. | 158 // initialized yet like waiting for profile to be loaded. |
| 151 virtual void NotifyUserAddedToSession(const user_manager::User* added_user, | 159 virtual void NotifyUserAddedToSession(const User* added_user, |
| 152 bool user_switch_pending); | 160 bool user_switch_pending); |
| 153 | 161 |
| 154 // Performs any additional actions before user list is loaded. | 162 // Performs any additional actions before user list is loaded. |
| 155 virtual void PerformPreUserListLoadingActions() = 0; | 163 virtual void PerformPreUserListLoadingActions() = 0; |
| 156 | 164 |
| 157 // Performs any additional actions after user list is loaded. | 165 // Performs any additional actions after user list is loaded. |
| 158 virtual void PerformPostUserListLoadingActions() = 0; | 166 virtual void PerformPostUserListLoadingActions() = 0; |
| 159 | 167 |
| 160 // Performs any additional actions after UserLoggedIn() execution has been | 168 // Performs any additional actions after UserLoggedIn() execution has been |
| 161 // completed. | 169 // completed. |
| 162 // |browser_restart| is true when reloading Chrome after crash to distinguish | 170 // |browser_restart| is true when reloading Chrome after crash to distinguish |
| 163 // from normal sign in flow. | 171 // from normal sign in flow. |
| 164 virtual void PerformPostUserLoggedInActions(bool browser_restart) = 0; | 172 virtual void PerformPostUserLoggedInActions(bool browser_restart) = 0; |
| 165 | 173 |
| 166 // Implementation for RemoveUser method. It is synchronous. It is called from | 174 // Implementation for RemoveUser method. It is synchronous. It is called from |
| 167 // RemoveUserInternal after owner check. | 175 // RemoveUserInternal after owner check. |
| 168 virtual void RemoveNonOwnerUserInternal(const std::string& user_email, | 176 virtual void RemoveNonOwnerUserInternal(const std::string& user_email, |
| 169 RemoveUserDelegate* delegate); | 177 RemoveUserDelegate* delegate); |
| 170 | 178 |
| 171 // Removes a regular or supervised user from the user list. | 179 // Removes a regular or supervised user from the user list. |
| 172 // Returns the user if found or NULL otherwise. | 180 // Returns the user if found or NULL otherwise. |
| 173 // Also removes the user from the persistent user list. | 181 // Also removes the user from the persistent user list. |
| 174 user_manager::User* RemoveRegularOrSupervisedUserFromList( | 182 User* RemoveRegularOrSupervisedUserFromList(const std::string& user_id); |
| 175 const std::string& user_id); | |
| 176 | 183 |
| 177 // Implementation for RemoveUser method. This is an asynchronous part of the | 184 // Implementation for RemoveUser method. This is an asynchronous part of the |
| 178 // method, that verifies that owner will not get deleted, and calls | 185 // method, that verifies that owner will not get deleted, and calls |
| 179 // |RemoveNonOwnerUserInternal|. | 186 // |RemoveNonOwnerUserInternal|. |
| 180 virtual void RemoveUserInternal(const std::string& user_email, | 187 virtual void RemoveUserInternal(const std::string& user_email, |
| 181 RemoveUserDelegate* delegate); | 188 RemoveUserDelegate* delegate); |
| 182 | 189 |
| 183 // Removes data stored or cached outside the user's cryptohome (wallpaper, | 190 // Removes data stored or cached outside the user's cryptohome (wallpaper, |
| 184 // avatar, OAuth token status, display name, display email). | 191 // avatar, OAuth token status, display name, display email). |
| 185 virtual void RemoveNonCryptohomeData(const std::string& user_id); | 192 virtual void RemoveNonCryptohomeData(const std::string& user_id); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 202 // Indicates that the demo account has just logged in. | 209 // Indicates that the demo account has just logged in. |
| 203 virtual void DemoAccountLoggedIn() = 0; | 210 virtual void DemoAccountLoggedIn() = 0; |
| 204 | 211 |
| 205 // Indicates that a user just logged in as guest. | 212 // Indicates that a user just logged in as guest. |
| 206 virtual void GuestUserLoggedIn(); | 213 virtual void GuestUserLoggedIn(); |
| 207 | 214 |
| 208 // Indicates that a kiosk app robot just logged in. | 215 // Indicates that a kiosk app robot just logged in. |
| 209 virtual void KioskAppLoggedIn(const std::string& app_id) = 0; | 216 virtual void KioskAppLoggedIn(const std::string& app_id) = 0; |
| 210 | 217 |
| 211 // Indicates that a user just logged into a public session. | 218 // Indicates that a user just logged into a public session. |
| 212 virtual void PublicAccountUserLoggedIn(user_manager::User* user) = 0; | 219 virtual void PublicAccountUserLoggedIn(User* user) = 0; |
| 213 | 220 |
| 214 // Indicates that a regular user just logged in. | 221 // Indicates that a regular user just logged in. |
| 215 virtual void RegularUserLoggedIn(const std::string& user_id); | 222 virtual void RegularUserLoggedIn(const std::string& user_id); |
| 216 | 223 |
| 217 // Indicates that a regular user just logged in as ephemeral. | 224 // Indicates that a regular user just logged in as ephemeral. |
| 218 virtual void RegularUserLoggedInAsEphemeral(const std::string& user_id); | 225 virtual void RegularUserLoggedInAsEphemeral(const std::string& user_id); |
| 219 | 226 |
| 220 // Indicates that a user just logged into a retail mode session. | 227 // Indicates that a user just logged into a retail mode session. |
| 221 virtual void RetailModeUserLoggedIn() = 0; | 228 virtual void RetailModeUserLoggedIn() = 0; |
| 222 | 229 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 234 | 241 |
| 235 virtual void SetOwnerEmail(std::string owner_user_id); | 242 virtual void SetOwnerEmail(std::string owner_user_id); |
| 236 | 243 |
| 237 virtual const std::string& GetPendingUserSwitchID() const; | 244 virtual const std::string& GetPendingUserSwitchID() const; |
| 238 virtual void SetPendingUserSwitchID(std::string user_id); | 245 virtual void SetPendingUserSwitchID(std::string user_id); |
| 239 | 246 |
| 240 // The logged-in user that is currently active in current session. | 247 // The logged-in user that is currently active in current session. |
| 241 // NULL until a user has logged in, then points to one | 248 // NULL until a user has logged in, then points to one |
| 242 // of the User instances in |users_|, the |guest_user_| instance or an | 249 // of the User instances in |users_|, the |guest_user_| instance or an |
| 243 // ephemeral user instance. | 250 // ephemeral user instance. |
| 244 user_manager::User* active_user_; | 251 User* active_user_; |
| 245 | 252 |
| 246 // The primary user of the current session. It is recorded for the first | 253 // The primary user of the current session. It is recorded for the first |
| 247 // signed-in user and does not change thereafter. | 254 // signed-in user and does not change thereafter. |
| 248 user_manager::User* primary_user_; | 255 User* primary_user_; |
| 249 | 256 |
| 250 // List of all known users. User instances are owned by |this|. Regular users | 257 // List of all known users. User instances are owned by |this|. Regular users |
| 251 // are removed by |RemoveUserFromList|, public accounts by | 258 // are removed by |RemoveUserFromList|, public accounts by |
| 252 // |UpdateAndCleanUpPublicAccounts|. | 259 // |UpdateAndCleanUpPublicAccounts|. |
| 253 user_manager::UserList users_; | 260 UserList users_; |
| 254 | 261 |
| 255 private: | 262 private: |
| 256 // Stages of loading user list from preferences. Some methods can have | 263 // Stages of loading user list from preferences. Some methods can have |
| 257 // different behavior depending on stage. | 264 // different behavior depending on stage. |
| 258 enum UserLoadStage { STAGE_NOT_LOADED = 0, STAGE_LOADING, STAGE_LOADED }; | 265 enum UserLoadStage { STAGE_NOT_LOADED = 0, STAGE_LOADING, STAGE_LOADED }; |
| 259 | 266 |
| 260 // Returns a list of users who have logged into this device previously. | 267 // Returns a list of users who have logged into this device previously. |
| 261 // Same as GetUsers but used if you need to modify User from that list. | 268 // Same as GetUsers but used if you need to modify User from that list. |
| 262 user_manager::UserList& GetUsersAndModify(); | 269 UserList& GetUsersAndModify(); |
| 263 | 270 |
| 264 // Returns the user with the given email address if found in the persistent | 271 // Returns the user with the given email address if found in the persistent |
| 265 // list. Returns |NULL| otherwise. | 272 // list. Returns |NULL| otherwise. |
| 266 const user_manager::User* FindUserInList(const std::string& user_id) const; | 273 const User* FindUserInList(const std::string& user_id) const; |
| 267 | 274 |
| 268 // Returns |true| if user with the given id is found in the persistent list. | 275 // Returns |true| if user with the given id is found in the persistent list. |
| 269 // Returns |false| otherwise. Does not trigger user loading. | 276 // Returns |false| otherwise. Does not trigger user loading. |
| 270 const bool UserExistsInList(const std::string& user_id) const; | 277 const bool UserExistsInList(const std::string& user_id) const; |
| 271 | 278 |
| 272 // Same as FindUserInList but returns non-const pointer to User object. | 279 // Same as FindUserInList but returns non-const pointer to User object. |
| 273 user_manager::User* FindUserInListAndModify(const std::string& user_id); | 280 User* FindUserInListAndModify(const std::string& user_id); |
| 274 | 281 |
| 275 // Reads user's oauth token status from local state preferences. | 282 // Reads user's oauth token status from local state preferences. |
| 276 user_manager::User::OAuthTokenStatus LoadUserOAuthStatus( | 283 User::OAuthTokenStatus LoadUserOAuthStatus(const std::string& user_id) const; |
| 277 const std::string& user_id) const; | |
| 278 | 284 |
| 279 // Read a flag indicating whether online authentication against GAIA should | 285 // Read a flag indicating whether online authentication against GAIA should |
| 280 // be enforced during the user's next sign-in from local state preferences. | 286 // be enforced during the user's next sign-in from local state preferences. |
| 281 bool LoadForceOnlineSignin(const std::string& user_id) const; | 287 bool LoadForceOnlineSignin(const std::string& user_id) const; |
| 282 | 288 |
| 283 // Notifies observers that merge session state had changed. | 289 // Notifies observers that merge session state had changed. |
| 284 void NotifyMergeSessionStateChanged(); | 290 void NotifyMergeSessionStateChanged(); |
| 285 | 291 |
| 286 // Notifies observers that active user has changed. | 292 // Notifies observers that active user has changed. |
| 287 void NotifyActiveUserChanged(const user_manager::User* active_user); | 293 void NotifyActiveUserChanged(const User* active_user); |
| 288 | 294 |
| 289 // Notifies observers that active user_id hash has changed. | 295 // Notifies observers that active user_id hash has changed. |
| 290 void NotifyActiveUserHashChanged(const std::string& hash); | 296 void NotifyActiveUserHashChanged(const std::string& hash); |
| 291 | 297 |
| 292 // Update the global LoginState. | 298 // Update the global LoginState. |
| 293 void UpdateLoginState(); | 299 void UpdateLoginState(); |
| 294 | 300 |
| 295 // Insert |user| at the front of the LRU user list. | 301 // Insert |user| at the front of the LRU user list. |
| 296 void SetLRUUser(user_manager::User* user); | 302 void SetLRUUser(User* user); |
| 297 | 303 |
| 298 // Sends metrics in response to a regular user logging in. | 304 // Sends metrics in response to a regular user logging in. |
| 299 void SendRegularUserLoginMetrics(const std::string& user_id); | 305 void SendRegularUserLoginMetrics(const std::string& user_id); |
| 300 | 306 |
| 301 // Sets account locale for user with id |user_id|. | 307 // Sets account locale for user with id |user_id|. |
| 302 virtual void UpdateUserAccountLocale(const std::string& user_id, | 308 virtual void UpdateUserAccountLocale(const std::string& user_id, |
| 303 const std::string& locale); | 309 const std::string& locale); |
| 304 | 310 |
| 305 // Updates user account after locale was resolved. | 311 // Updates user account after locale was resolved. |
| 306 void DoUpdateAccountLocale(const std::string& user_id, | 312 void DoUpdateAccountLocale(const std::string& user_id, |
| 307 const std::string& resolved_locale); | 313 const std::string& resolved_locale); |
| 308 | 314 |
| 309 // Indicates stage of loading user from prefs. | 315 // Indicates stage of loading user from prefs. |
| 310 UserLoadStage user_loading_stage_; | 316 UserLoadStage user_loading_stage_; |
| 311 | 317 |
| 312 // List of all users that are logged in current session. These point to User | 318 // List of all users that are logged in current session. These point to User |
| 313 // instances in |users_|. Only one of them could be marked as active. | 319 // instances in |users_|. Only one of them could be marked as active. |
| 314 user_manager::UserList logged_in_users_; | 320 UserList logged_in_users_; |
| 315 | 321 |
| 316 // A list of all users that are logged in the current session. In contrast to | 322 // A list of all users that are logged in the current session. In contrast to |
| 317 // |logged_in_users|, the order of this list is least recently used so that | 323 // |logged_in_users|, the order of this list is least recently used so that |
| 318 // the active user should always be the first one in the list. | 324 // the active user should always be the first one in the list. |
| 319 user_manager::UserList lru_logged_in_users_; | 325 UserList lru_logged_in_users_; |
| 320 | 326 |
| 321 // True if SessionStarted() has been called. | 327 // True if SessionStarted() has been called. |
| 322 bool session_started_; | 328 bool session_started_; |
| 323 | 329 |
| 324 // Cached flag of whether currently logged-in user is owner or not. | 330 // Cached flag of whether currently logged-in user is owner or not. |
| 325 // May be accessed on different threads, requires locking. | 331 // May be accessed on different threads, requires locking. |
| 326 bool is_current_user_owner_; | 332 bool is_current_user_owner_; |
| 327 mutable base::Lock is_current_user_owner_lock_; | 333 mutable base::Lock is_current_user_owner_lock_; |
| 328 | 334 |
| 329 // Cached flag of whether the currently logged-in user existed before this | 335 // Cached flag of whether the currently logged-in user existed before this |
| (...skipping 27 matching lines...) Expand all Loading... |
| 357 | 363 |
| 358 // ID of the user just added to the session that needs to be activated | 364 // ID of the user just added to the session that needs to be activated |
| 359 // as soon as user's profile is loaded. | 365 // as soon as user's profile is loaded. |
| 360 std::string pending_user_switch_; | 366 std::string pending_user_switch_; |
| 361 | 367 |
| 362 base::WeakPtrFactory<UserManagerBase> weak_factory_; | 368 base::WeakPtrFactory<UserManagerBase> weak_factory_; |
| 363 | 369 |
| 364 DISALLOW_COPY_AND_ASSIGN(UserManagerBase); | 370 DISALLOW_COPY_AND_ASSIGN(UserManagerBase); |
| 365 }; | 371 }; |
| 366 | 372 |
| 367 } // namespace chromeos | 373 } // namespace user_manager |
| 368 | 374 |
| 369 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERS_USER_MANAGER_BASE_H_ | 375 #endif // COMPONENTS_USER_MANAGER_USER_MANAGER_BASE_H_ |
| OLD | NEW |