blob: fd145c097447f915568550843ed7f19f3b7ccdba [file] [log] [blame]
[email protected]babc1482014-08-02 05:44:131// 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
[email protected]4d390782014-08-15 09:22:585#ifndef COMPONENTS_USER_MANAGER_USER_MANAGER_BASE_H_
6#define COMPONENTS_USER_MANAGER_USER_MANAGER_BASE_H_
[email protected]babc1482014-08-02 05:44:137
alemate16e470e2015-04-14 15:55:408#include <map>
dcheng3f767dc32016-04-25 22:54:229#include <memory>
[email protected]babc1482014-08-02 05:44:1310#include <set>
11#include <string>
12#include <vector>
13
avi5dd91f82015-12-25 22:30:4614#include "base/macros.h"
[email protected]babc1482014-08-02 05:44:1315#include "base/memory/weak_ptr.h"
16#include "base/observer_list.h"
17#include "base/synchronization/lock.h"
18#include "base/time/time.h"
Alexander Alekseev3f09a8f2018-05-03 02:52:1019#include "components/account_id/account_id.h"
[email protected]babc1482014-08-02 05:44:1320#include "components/user_manager/user.h"
[email protected]4d390782014-08-15 09:22:5821#include "components/user_manager/user_manager.h"
22#include "components/user_manager/user_manager_export.h"
merkulovab82b7132014-11-17 11:06:5023#include "components/user_manager/user_type.h"
[email protected]babc1482014-08-02 05:44:1324
[email protected]babc1482014-08-02 05:44:1325class PrefRegistrySimple;
26
[email protected]4d390782014-08-15 09:22:5827namespace base {
28class ListValue;
29class TaskRunner;
30}
31
32namespace user_manager {
[email protected]babc1482014-08-02 05:44:1333
34class RemoveUserDelegate;
35
36// Base implementation of the UserManager interface.
[email protected]4d390782014-08-15 09:22:5837class USER_MANAGER_EXPORT UserManagerBase : public UserManager {
[email protected]babc1482014-08-02 05:44:1338 public:
[email protected]ac58eaf72014-08-19 13:06:4239 // Creates UserManagerBase with |task_runner| for UI thread and
40 // |blocking_task_runner| for SequencedWorkerPool.
alemate33433e22016-01-13 14:50:3041 explicit UserManagerBase(scoped_refptr<base::TaskRunner> task_runner);
dchengbd5bd4f2015-01-23 16:01:3842 ~UserManagerBase() override;
[email protected]babc1482014-08-02 05:44:1343
44 // Registers UserManagerBase preferences.
45 static void RegisterPrefs(PrefRegistrySimple* registry);
46
47 // UserManager implementation:
dchengbd5bd4f2015-01-23 16:01:3848 void Shutdown() override;
49 const UserList& GetUsers() const override;
50 const UserList& GetLoggedInUsers() const override;
51 const UserList& GetLRULoggedInUsers() const override;
alemate3ffbde6f2015-11-03 02:02:5552 const AccountId& GetOwnerAccountId() const override;
53 void UserLoggedIn(const AccountId& account_id,
dchengbd5bd4f2015-01-23 16:01:3854 const std::string& user_id_hash,
Alexander Alekseev2a5efd62017-12-06 07:27:2855 bool browser_restart,
56 bool is_child) override;
alemate3ffbde6f2015-11-03 02:02:5557 void SwitchActiveUser(const AccountId& account_id) override;
dchengbd5bd4f2015-01-23 16:01:3858 void SwitchToLastActiveUser() override;
xiyuan834f3bc2016-10-26 19:40:5359 void OnSessionStarted() override;
atwilsond5a7eabf2017-03-09 13:18:3960 void OnProfileInitialized(User* user) override;
alemate3ffbde6f2015-11-03 02:02:5561 void RemoveUser(const AccountId& account_id,
dchengbd5bd4f2015-01-23 16:01:3862 RemoveUserDelegate* delegate) override;
alemate3ffbde6f2015-11-03 02:02:5563 void RemoveUserFromList(const AccountId& account_id) override;
64 bool IsKnownUser(const AccountId& account_id) const override;
65 const User* FindUser(const AccountId& account_id) const override;
66 User* FindUserAndModify(const AccountId& account_id) override;
dchengbd5bd4f2015-01-23 16:01:3867 const User* GetActiveUser() const override;
68 User* GetActiveUser() override;
69 const User* GetPrimaryUser() const override;
alemate3ffbde6f2015-11-03 02:02:5570 void SaveUserOAuthStatus(const AccountId& account_id,
dchengbd5bd4f2015-01-23 16:01:3871 User::OAuthTokenStatus oauth_token_status) override;
alemate3ffbde6f2015-11-03 02:02:5572 void SaveForceOnlineSignin(const AccountId& account_id,
dchengbd5bd4f2015-01-23 16:01:3873 bool force_online_signin) override;
alemate3ffbde6f2015-11-03 02:02:5574 void SaveUserDisplayName(const AccountId& account_id,
dchengbd5bd4f2015-01-23 16:01:3875 const base::string16& display_name) override;
alemate3ffbde6f2015-11-03 02:02:5576 base::string16 GetUserDisplayName(const AccountId& account_id) const override;
77 void SaveUserDisplayEmail(const AccountId& account_id,
dchengbd5bd4f2015-01-23 16:01:3878 const std::string& display_email) override;
alemate3ffbde6f2015-11-03 02:02:5579 std::string GetUserDisplayEmail(const AccountId& account_id) const override;
Alexander Alekseev2a5efd62017-12-06 07:27:2880 void SaveUserType(const User* user) override;
alemate3ffbde6f2015-11-03 02:02:5581 void UpdateUserAccountData(const AccountId& account_id,
dchengbd5bd4f2015-01-23 16:01:3882 const UserAccountData& account_data) override;
83 bool IsCurrentUserOwner() const override;
84 bool IsCurrentUserNew() const override;
85 bool IsCurrentUserNonCryptohomeDataEphemeral() const override;
rsorokin79e93442016-04-29 07:54:1286 bool IsCurrentUserCryptohomeDataEphemeral() const override;
dchengbd5bd4f2015-01-23 16:01:3887 bool CanCurrentUserLock() const override;
88 bool IsUserLoggedIn() const override;
89 bool IsLoggedInAsUserWithGaiaAccount() const override;
90 bool IsLoggedInAsChildUser() const override;
91 bool IsLoggedInAsPublicAccount() const override;
92 bool IsLoggedInAsGuest() const override;
93 bool IsLoggedInAsSupervisedUser() const override;
94 bool IsLoggedInAsKioskApp() const override;
peletskyi53c440d2016-10-25 15:09:5595 bool IsLoggedInAsArcKioskApp() const override;
dchengbd5bd4f2015-01-23 16:01:3896 bool IsLoggedInAsStub() const override;
dchengbd5bd4f2015-01-23 16:01:3897 bool IsUserNonCryptohomeDataEphemeral(
alemate3ffbde6f2015-11-03 02:02:5598 const AccountId& account_id) const override;
rsorokin79e93442016-04-29 07:54:1299 bool IsUserCryptohomeDataEphemeral(
100 const AccountId& account_id) const override;
dchengbd5bd4f2015-01-23 16:01:38101 void AddObserver(UserManager::Observer* obs) override;
102 void RemoveObserver(UserManager::Observer* obs) override;
103 void AddSessionStateObserver(
mostynbfe59f482014-10-06 15:04:46104 UserManager::UserSessionStateObserver* obs) override;
dchengbd5bd4f2015-01-23 16:01:38105 void RemoveSessionStateObserver(
mostynbfe59f482014-10-06 15:04:46106 UserManager::UserSessionStateObserver* obs) override;
dchengbd5bd4f2015-01-23 16:01:38107 void NotifyLocalStateChanged() override;
xiyuan66e41772016-12-13 21:57:58108 void NotifyUserImageChanged(const User& user) override;
109 void NotifyUserProfileImageUpdateFailed(const User& user) override;
110 void NotifyUserProfileImageUpdated(
111 const User& user,
112 const gfx::ImageSkia& profile_image) override;
Daria Yakovlevaea3ce4b2017-10-11 19:51:59113 void NotifyUsersSignInConstraintsChanged() override;
Pavol Markoa9808a62017-08-31 16:22:37114 void ResetProfileEverInitialized(const AccountId& account_id) override;
alemate33433e22016-01-13 14:50:30115 void Initialize() override;
[email protected]babc1482014-08-02 05:44:13116
alemate3ffbde6f2015-11-03 02:02:55117 // This method updates "User was added to the device in this session nad is
118 // not full initialized yet" flag.
alematee66a4962015-02-26 16:12:00119 virtual void SetIsCurrentUserNew(bool is_new);
120
hcarmonab1723ed32015-11-18 21:52:58121 // Helper function that converts users from |users_list| to |users_vector| and
[email protected]babc1482014-08-02 05:44:13122 // |users_set|. Duplicates and users already present in |existing_users| are
123 // skipped.
hcarmonab1723ed32015-11-18 21:52:58124 void ParseUserList(const base::ListValue& users_list,
125 const std::set<AccountId>& existing_users,
126 std::vector<AccountId>* users_vector,
127 std::set<AccountId>* users_set);
[email protected]babc1482014-08-02 05:44:13128
alemate0242b472015-04-20 09:53:40129 // Returns true if trusted device policies have successfully been retrieved
130 // and ephemeral users are enabled.
131 virtual bool AreEphemeralUsersEnabled() const = 0;
132
isandrk98a3e4a12017-05-26 21:14:50133 void AddUserRecordForTesting(User* user) {
134 return AddUserRecord(user);
135 }
136
Jia08639632018-01-12 00:32:41137 // Returns true if device is enterprise managed.
138 virtual bool IsEnterpriseManaged() const = 0;
139
[email protected]babc1482014-08-02 05:44:13140 protected:
[email protected]babc1482014-08-02 05:44:13141 // Adds |user| to users list, and adds it to front of LRU list. It is assumed
142 // that there is no user with same id.
[email protected]4d390782014-08-15 09:22:58143 virtual void AddUserRecord(User* user);
[email protected]babc1482014-08-02 05:44:13144
[email protected]babc1482014-08-02 05:44:13145 // Returns true if user may be removed.
[email protected]4d390782014-08-15 09:22:58146 virtual bool CanUserBeRemoved(const User* user) const;
[email protected]babc1482014-08-02 05:44:13147
148 // A wrapper around C++ delete operator. Deletes |user|, and when |user|
149 // equals to active_user_, active_user_ is reset to NULL.
[email protected]4d390782014-08-15 09:22:58150 virtual void DeleteUser(User* user);
[email protected]babc1482014-08-02 05:44:13151
152 // Returns the locale used by the application.
153 virtual const std::string& GetApplicationLocale() const = 0;
154
[email protected]babc1482014-08-02 05:44:13155 // Loads |users_| from Local State if the list has not been loaded yet.
156 // Subsequent calls have no effect. Must be called on the UI thread.
merkulova793f3022015-02-04 10:18:30157 virtual void EnsureUsersLoaded();
[email protected]babc1482014-08-02 05:44:13158
alemate3ffbde6f2015-11-03 02:02:55159 // Handle OAuth token |status| change for |account_id|.
[email protected]4d390782014-08-15 09:22:58160 virtual void HandleUserOAuthTokenStatusChange(
alemate3ffbde6f2015-11-03 02:02:55161 const AccountId& account_id,
[email protected]4d390782014-08-15 09:22:58162 User::OAuthTokenStatus status) const = 0;
163
xiyuand4f04572016-04-19 18:22:53164 // Loads device local accounts from the Local state and fills in
165 // |device_local_accounts_set|.
166 virtual void LoadDeviceLocalAccounts(
167 std::set<AccountId>* device_local_accounts_set) = 0;
[email protected]babc1482014-08-02 05:44:13168
169 // Notifies that user has logged in.
170 virtual void NotifyOnLogin();
171
172 // Notifies observers that another user was added to the session.
173 // If |user_switch_pending| is true this means that user has not been fully
174 // initialized yet like waiting for profile to be loaded.
[email protected]4d390782014-08-15 09:22:58175 virtual void NotifyUserAddedToSession(const User* added_user,
[email protected]babc1482014-08-02 05:44:13176 bool user_switch_pending);
177
178 // Performs any additional actions before user list is loaded.
179 virtual void PerformPreUserListLoadingActions() = 0;
180
181 // Performs any additional actions after user list is loaded.
182 virtual void PerformPostUserListLoadingActions() = 0;
183
184 // Performs any additional actions after UserLoggedIn() execution has been
185 // completed.
186 // |browser_restart| is true when reloading Chrome after crash to distinguish
187 // from normal sign in flow.
188 virtual void PerformPostUserLoggedInActions(bool browser_restart) = 0;
189
190 // Implementation for RemoveUser method. It is synchronous. It is called from
191 // RemoveUserInternal after owner check.
alemate3ffbde6f2015-11-03 02:02:55192 virtual void RemoveNonOwnerUserInternal(const AccountId& account_id,
[email protected]babc1482014-08-02 05:44:13193 RemoveUserDelegate* delegate);
194
195 // Removes a regular or supervised user from the user list.
196 // Returns the user if found or NULL otherwise.
197 // Also removes the user from the persistent user list.
Sergey Poromov38f7af82018-02-12 10:59:05198 // |notify| is true when OnUserRemoved() should be triggered,
199 // meaning that the user won't be added after the removal.
200 User* RemoveRegularOrSupervisedUserFromList(const AccountId& account_id,
201 bool notify);
[email protected]babc1482014-08-02 05:44:13202
203 // Implementation for RemoveUser method. This is an asynchronous part of the
204 // method, that verifies that owner will not get deleted, and calls
205 // |RemoveNonOwnerUserInternal|.
alemate3ffbde6f2015-11-03 02:02:55206 virtual void RemoveUserInternal(const AccountId& account_id,
[email protected]babc1482014-08-02 05:44:13207 RemoveUserDelegate* delegate);
208
209 // Removes data stored or cached outside the user's cryptohome (wallpaper,
210 // avatar, OAuth token status, display name, display email).
alemate3ffbde6f2015-11-03 02:02:55211 virtual void RemoveNonCryptohomeData(const AccountId& account_id);
[email protected]babc1482014-08-02 05:44:13212
213 // Check for a particular user type.
214
alemate3ffbde6f2015-11-03 02:02:55215 // Returns true if |account_id| represents demo app.
216 virtual bool IsDemoApp(const AccountId& account_id) const = 0;
[email protected]babc1482014-08-02 05:44:13217
[email protected]babc1482014-08-02 05:44:13218 // These methods are called when corresponding user type has signed in.
219
220 // Indicates that the demo account has just logged in.
221 virtual void DemoAccountLoggedIn() = 0;
222
223 // Indicates that a user just logged in as guest.
224 virtual void GuestUserLoggedIn();
225
226 // Indicates that a kiosk app robot just logged in.
xiyuand4f04572016-04-19 18:22:53227 virtual void KioskAppLoggedIn(User* user) = 0;
[email protected]babc1482014-08-02 05:44:13228
poromov008f8d02016-11-17 16:34:19229 // Indicates that an ARC kiosk app robot just logged in.
230 virtual void ArcKioskAppLoggedIn(User* user) = 0;
231
[email protected]babc1482014-08-02 05:44:13232 // Indicates that a user just logged into a public session.
[email protected]4d390782014-08-15 09:22:58233 virtual void PublicAccountUserLoggedIn(User* user) = 0;
[email protected]babc1482014-08-02 05:44:13234
235 // Indicates that a regular user just logged in.
Alexander Alekseev2a5efd62017-12-06 07:27:28236 virtual void RegularUserLoggedIn(const AccountId& account_id,
237 const UserType user_type);
[email protected]babc1482014-08-02 05:44:13238
239 // Indicates that a regular user just logged in as ephemeral.
Alexander Alekseev2a5efd62017-12-06 07:27:28240 virtual void RegularUserLoggedInAsEphemeral(const AccountId& account_id,
241 const UserType user_type);
[email protected]babc1482014-08-02 05:44:13242
[email protected]babc1482014-08-02 05:44:13243 // Indicates that a supervised user just logged in.
alemate3ffbde6f2015-11-03 02:02:55244 virtual void SupervisedUserLoggedIn(const AccountId& account_id) = 0;
[email protected]babc1482014-08-02 05:44:13245
peletskyi2b8c9d232015-07-31 16:23:58246 // Should be called when regular user was removed.
alemate3ffbde6f2015-11-03 02:02:55247 virtual void OnUserRemoved(const AccountId& account_id) = 0;
peletskyi2b8c9d232015-07-31 16:23:58248
alemate33433e22016-01-13 14:50:30249 // Update the global LoginState.
250 virtual void UpdateLoginState(const User* active_user,
251 const User* primary_user,
252 bool is_current_user_owner) const = 0;
253
[email protected]babc1482014-08-02 05:44:13254 // Getters/setters for private members.
255
[email protected]babc1482014-08-02 05:44:13256 virtual bool GetEphemeralUsersEnabled() const;
257 virtual void SetEphemeralUsersEnabled(bool enabled);
258
alemate3ffbde6f2015-11-03 02:02:55259 virtual void SetOwnerId(const AccountId& owner_account_id);
[email protected]babc1482014-08-02 05:44:13260
alemate3ffbde6f2015-11-03 02:02:55261 virtual const AccountId& GetPendingUserSwitchID() const;
262 virtual void SetPendingUserSwitchId(const AccountId& account_id);
[email protected]babc1482014-08-02 05:44:13263
264 // The logged-in user that is currently active in current session.
265 // NULL until a user has logged in, then points to one
266 // of the User instances in |users_|, the |guest_user_| instance or an
267 // ephemeral user instance.
alemate3ffbde6f2015-11-03 02:02:55268 User* active_user_ = nullptr;
[email protected]babc1482014-08-02 05:44:13269
270 // The primary user of the current session. It is recorded for the first
271 // signed-in user and does not change thereafter.
alemate3ffbde6f2015-11-03 02:02:55272 User* primary_user_ = nullptr;
[email protected]babc1482014-08-02 05:44:13273
274 // List of all known users. User instances are owned by |this|. Regular users
xiyuand4f04572016-04-19 18:22:53275 // are removed by |RemoveUserFromList|, device local accounts by
276 // |UpdateAndCleanUpDeviceLocalAccounts|.
[email protected]4d390782014-08-15 09:22:58277 UserList users_;
[email protected]babc1482014-08-02 05:44:13278
merkulova793f3022015-02-04 10:18:30279 // List of all users that are logged in current session. These point to User
280 // instances in |users_|. Only one of them could be marked as active.
281 UserList logged_in_users_;
282
283 // A list of all users that are logged in the current session. In contrast to
284 // |logged_in_users|, the order of this list is least recently used so that
285 // the active user should always be the first one in the list.
286 UserList lru_logged_in_users_;
287
[email protected]babc1482014-08-02 05:44:13288 private:
289 // Stages of loading user list from preferences. Some methods can have
290 // different behavior depending on stage.
291 enum UserLoadStage { STAGE_NOT_LOADED = 0, STAGE_LOADING, STAGE_LOADED };
292
293 // Returns a list of users who have logged into this device previously.
294 // Same as GetUsers but used if you need to modify User from that list.
[email protected]4d390782014-08-15 09:22:58295 UserList& GetUsersAndModify();
[email protected]babc1482014-08-02 05:44:13296
297 // Returns the user with the given email address if found in the persistent
298 // list. Returns |NULL| otherwise.
alemate3ffbde6f2015-11-03 02:02:55299 const User* FindUserInList(const AccountId& account_id) const;
[email protected]babc1482014-08-02 05:44:13300
301 // Returns |true| if user with the given id is found in the persistent list.
302 // Returns |false| otherwise. Does not trigger user loading.
alemate3ffbde6f2015-11-03 02:02:55303 bool UserExistsInList(const AccountId& account_id) const;
[email protected]babc1482014-08-02 05:44:13304
305 // Same as FindUserInList but returns non-const pointer to User object.
alemate3ffbde6f2015-11-03 02:02:55306 User* FindUserInListAndModify(const AccountId& account_id);
[email protected]babc1482014-08-02 05:44:13307
308 // Reads user's oauth token status from local state preferences.
alemate3ffbde6f2015-11-03 02:02:55309 User::OAuthTokenStatus LoadUserOAuthStatus(const AccountId& account_id) const;
[email protected]babc1482014-08-02 05:44:13310
311 // Read a flag indicating whether online authentication against GAIA should
312 // be enforced during the user's next sign-in from local state preferences.
alemate3ffbde6f2015-11-03 02:02:55313 bool LoadForceOnlineSignin(const AccountId& account_id) const;
[email protected]babc1482014-08-02 05:44:13314
atwilsond5a7eabf2017-03-09 13:18:39315 // Read a flag indicating whether session initialization has completed at
316 // least once.
317 bool LoadSessionInitialized(const AccountId& account_id) const;
318
[email protected]babc1482014-08-02 05:44:13319 // Notifies observers that merge session state had changed.
320 void NotifyMergeSessionStateChanged();
321
322 // Notifies observers that active user has changed.
[email protected]4d390782014-08-15 09:22:58323 void NotifyActiveUserChanged(const User* active_user);
[email protected]babc1482014-08-02 05:44:13324
alemate3ffbde6f2015-11-03 02:02:55325 // Notifies observers that active account_id hash has changed.
[email protected]babc1482014-08-02 05:44:13326 void NotifyActiveUserHashChanged(const std::string& hash);
327
alemate33433e22016-01-13 14:50:30328 // Call UpdateLoginState.
329 void CallUpdateLoginState();
[email protected]babc1482014-08-02 05:44:13330
331 // Insert |user| at the front of the LRU user list.
[email protected]4d390782014-08-15 09:22:58332 void SetLRUUser(User* user);
[email protected]babc1482014-08-02 05:44:13333
merkulovac3ae44d2014-11-17 09:35:07334 // Sends metrics in response to a user with gaia account (regular) logging in.
alemate3ffbde6f2015-11-03 02:02:55335 void SendGaiaUserLoginMetrics(const AccountId& account_id);
[email protected]babc1482014-08-02 05:44:13336
alemate3ffbde6f2015-11-03 02:02:55337 // Sets account locale for user with id |account_id|.
338 virtual void UpdateUserAccountLocale(const AccountId& account_id,
[email protected]babc1482014-08-02 05:44:13339 const std::string& locale);
340
341 // Updates user account after locale was resolved.
alemate3ffbde6f2015-11-03 02:02:55342 void DoUpdateAccountLocale(const AccountId& account_id,
dcheng3f767dc32016-04-25 22:54:22343 std::unique_ptr<std::string> resolved_locale);
[email protected]babc1482014-08-02 05:44:13344
345 // Indicates stage of loading user from prefs.
alemate3ffbde6f2015-11-03 02:02:55346 UserLoadStage user_loading_stage_ = STAGE_NOT_LOADED;
[email protected]babc1482014-08-02 05:44:13347
[email protected]babc1482014-08-02 05:44:13348 // Cached flag of whether the currently logged-in user existed before this
349 // login.
alemate3ffbde6f2015-11-03 02:02:55350 bool is_current_user_new_ = false;
[email protected]babc1482014-08-02 05:44:13351
352 // Cached flag of whether the currently logged-in user is a regular user who
353 // logged in as ephemeral. Storage of persistent information is avoided for
354 // such users by not adding them to the persistent user list, not downloading
355 // their custom avatars and mounting their cryptohomes using tmpfs. Defaults
356 // to |false|.
alemate3ffbde6f2015-11-03 02:02:55357 bool is_current_user_ephemeral_regular_user_ = false;
[email protected]babc1482014-08-02 05:44:13358
359 // Cached flag indicating whether the ephemeral user policy is enabled.
360 // Defaults to |false| if the value has not been read from trusted device
361 // policy yet.
alemate3ffbde6f2015-11-03 02:02:55362 bool ephemeral_users_enabled_ = false;
[email protected]babc1482014-08-02 05:44:13363
alemate3ffbde6f2015-11-03 02:02:55364 // Cached name of device owner. Defaults to empty if the value has not
[email protected]babc1482014-08-02 05:44:13365 // been read from trusted device policy yet.
alemate3ffbde6f2015-11-03 02:02:55366 AccountId owner_account_id_ = EmptyAccountId();
[email protected]babc1482014-08-02 05:44:13367
Trent Apteda250ec3ab2018-08-19 08:52:19368 base::ObserverList<UserManager::Observer>::Unchecked observer_list_;
[email protected]babc1482014-08-02 05:44:13369
370 // TODO(nkostylev): Merge with session state refactoring CL.
Trent Apteda250ec3ab2018-08-19 08:52:19371 base::ObserverList<UserManager::UserSessionStateObserver>::Unchecked
[email protected]babc1482014-08-02 05:44:13372 session_state_observer_list_;
373
374 // Time at which this object was created.
alemate3ffbde6f2015-11-03 02:02:55375 base::TimeTicks manager_creation_time_ = base::TimeTicks::Now();
[email protected]babc1482014-08-02 05:44:13376
377 // ID of the user just added to the session that needs to be activated
378 // as soon as user's profile is loaded.
alemate3ffbde6f2015-11-03 02:02:55379 AccountId pending_user_switch_ = EmptyAccountId();
[email protected]babc1482014-08-02 05:44:13380
nkostylev5df7e992014-09-26 09:03:47381 // ID of the user that was active in the previous session.
382 // Preference value is stored here before first user signs in
383 // because pref will be overidden once session restore starts.
alemate3ffbde6f2015-11-03 02:02:55384 AccountId last_session_active_account_id_ = EmptyAccountId();
385 bool last_session_active_account_id_initialized_ = false;
nkostylev5df7e992014-09-26 09:03:47386
[email protected]ac58eaf72014-08-19 13:06:42387 // TaskRunner for UI thread.
[email protected]4d390782014-08-15 09:22:58388 scoped_refptr<base::TaskRunner> task_runner_;
[email protected]ac58eaf72014-08-19 13:06:42389
[email protected]babc1482014-08-02 05:44:13390 base::WeakPtrFactory<UserManagerBase> weak_factory_;
391
392 DISALLOW_COPY_AND_ASSIGN(UserManagerBase);
393};
394
[email protected]4d390782014-08-15 09:22:58395} // namespace user_manager
[email protected]babc1482014-08-02 05:44:13396
[email protected]4d390782014-08-15 09:22:58397#endif // COMPONENTS_USER_MANAGER_USER_MANAGER_BASE_H_