Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(361)

Side by Side Diff: chrome/browser/chromeos/login/user_manager_impl.h

Issue 14756019: Adding new user menu section to the SystemTrayMenu & refactoring of user access (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_USER_MANAGER_IMPL_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 29 matching lines...) Expand all
40 public content::NotificationObserver, 40 public content::NotificationObserver,
41 public policy::DeviceLocalAccountPolicyService::Observer { 41 public policy::DeviceLocalAccountPolicyService::Observer {
42 public: 42 public:
43 virtual ~UserManagerImpl(); 43 virtual ~UserManagerImpl();
44 44
45 // UserManager implementation: 45 // UserManager implementation:
46 virtual void Shutdown() OVERRIDE; 46 virtual void Shutdown() OVERRIDE;
47 virtual UserImageManager* GetUserImageManager() OVERRIDE; 47 virtual UserImageManager* GetUserImageManager() OVERRIDE;
48 virtual const UserList& GetUsers() const OVERRIDE; 48 virtual const UserList& GetUsers() const OVERRIDE;
49 virtual const UserList& GetLoggedInUsers() const OVERRIDE; 49 virtual const UserList& GetLoggedInUsers() const OVERRIDE;
50 virtual const UserList& GetLRULoggedInUsers() OVERRIDE;
Nikita (slow) 2013/05/17 17:00:32 Please add test for UserManager.
Mr4D (OOO till 08-26) 2013/05/17 18:45:09 As stated in my issue header: That will come with
50 virtual void UserLoggedIn(const std::string& email, 51 virtual void UserLoggedIn(const std::string& email,
51 const std::string& username_hash, 52 const std::string& username_hash,
52 bool browser_restart) OVERRIDE; 53 bool browser_restart) OVERRIDE;
53 virtual void SwitchActiveUser(const std::string& email) OVERRIDE; 54 virtual void SwitchActiveUser(const std::string& email) OVERRIDE;
54 virtual void SessionStarted() OVERRIDE; 55 virtual void SessionStarted() OVERRIDE;
55 virtual void RemoveUser(const std::string& email, 56 virtual void RemoveUser(const std::string& email,
56 RemoveUserDelegate* delegate) OVERRIDE; 57 RemoveUserDelegate* delegate) OVERRIDE;
57 virtual void RemoveUserFromList(const std::string& email) OVERRIDE; 58 virtual void RemoveUserFromList(const std::string& email) OVERRIDE;
58 virtual bool IsKnownUser(const std::string& email) const OVERRIDE; 59 virtual bool IsKnownUser(const std::string& email) const OVERRIDE;
59 virtual const User* FindUser(const std::string& email) const OVERRIDE; 60 virtual const User* FindUser(const std::string& email) const OVERRIDE;
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 245
245 // Lazily creates default user flow. 246 // Lazily creates default user flow.
246 UserFlow* GetDefaultUserFlow() const; 247 UserFlow* GetDefaultUserFlow() const;
247 248
248 // Update the global LoginState. 249 // Update the global LoginState.
249 void UpdateLoginState(); 250 void UpdateLoginState();
250 251
251 // Gets the list of public accounts defined in device settings. 252 // Gets the list of public accounts defined in device settings.
252 void ReadPublicAccounts(base::ListValue* public_accounts); 253 void ReadPublicAccounts(base::ListValue* public_accounts);
253 254
255 // Insert |user| at the front of the LRU user list..
256 void SetLRUUser(User* user);
257
254 // Interface to the signed settings store. 258 // Interface to the signed settings store.
255 CrosSettings* cros_settings_; 259 CrosSettings* cros_settings_;
256 260
257 // Interface to device-local account definitions and associated policy. 261 // Interface to device-local account definitions and associated policy.
258 policy::DeviceLocalAccountPolicyService* device_local_account_policy_service_; 262 policy::DeviceLocalAccountPolicyService* device_local_account_policy_service_;
259 263
260 // True if users have been loaded from prefs already. 264 // True if users have been loaded from prefs already.
261 bool users_loaded_; 265 bool users_loaded_;
262 266
263 // List of all known users. User instances are owned by |this|. Regular users 267 // List of all known users. User instances are owned by |this|. Regular users
264 // are removed by |RemoveUserFromList|, public accounts by 268 // are removed by |RemoveUserFromList|, public accounts by
265 // |UpdateAndCleanUpPublicAccounts|. 269 // |UpdateAndCleanUpPublicAccounts|.
266 UserList users_; 270 UserList users_;
267 271
268 // List of all users that are logged in current session. These point to User 272 // List of all users that are logged in current session. These point to User
269 // instances in |users_|. Only one of them could be marked as active. 273 // instances in |users_|. Only one of them could be marked as active.
270 UserList logged_in_users_; 274 UserList logged_in_users_;
271 275
276 // A list of all users that are logged in the current session. In contrast to
277 // |logged_in_users|, the order of this list is least recently used so that
278 // the active user should always be the first one in the list.
279 UserList lru_logged_in_users_;
280
281 // The list which gets reported when the |lru_logged_in_users_| list is empty.
282 UserList temp_single_logged_in_users_;
283
272 // The logged-in user that is currently active in current session. 284 // The logged-in user that is currently active in current session.
273 // NULL until a user has logged in, then points to one 285 // NULL until a user has logged in, then points to one
274 // of the User instances in |users_|, the |guest_user_| instance or an 286 // of the User instances in |users_|, the |guest_user_| instance or an
275 // ephemeral user instance. 287 // ephemeral user instance.
276 User* active_user_; 288 User* active_user_;
277 289
278 // True if SessionStarted() has been called. 290 // True if SessionStarted() has been called.
279 bool session_started_; 291 bool session_started_;
280 292
281 // Cached flag of whether currently logged-in user is owner or not. 293 // Cached flag of whether currently logged-in user is owner or not.
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 348
337 // Specific flows by user e-mail. 349 // Specific flows by user e-mail.
338 FlowMap specific_flows_; 350 FlowMap specific_flows_;
339 351
340 DISALLOW_COPY_AND_ASSIGN(UserManagerImpl); 352 DISALLOW_COPY_AND_ASSIGN(UserManagerImpl);
341 }; 353 };
342 354
343 } // namespace chromeos 355 } // namespace chromeos
344 356
345 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_ 357 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698