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

Unified Diff: chrome/browser/chromeos/login/user_manager_impl.h

Issue 14139003: Chrome OS multi-profiles backend and UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move IsMultiProfilesEnabled() out of cros Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/login/user_manager.h ('k') | chrome/browser/chromeos/login/user_manager_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/user_manager_impl.h
diff --git a/chrome/browser/chromeos/login/user_manager_impl.h b/chrome/browser/chromeos/login/user_manager_impl.h
index cb9c5c8503f8ed26df2e39adf92365eb3956b4fb..1f58592c10279e3f12b0314c328883231ce3b9be 100644
--- a/chrome/browser/chromeos/login/user_manager_impl.h
+++ b/chrome/browser/chromeos/login/user_manager_impl.h
@@ -46,9 +46,11 @@ class UserManagerImpl
virtual void Shutdown() OVERRIDE;
virtual UserImageManager* GetUserImageManager() OVERRIDE;
virtual const UserList& GetUsers() const OVERRIDE;
+ virtual const UserList& GetLoggedInUsers() const OVERRIDE;
virtual void UserLoggedIn(const std::string& email,
const std::string& username_hash,
bool browser_restart) OVERRIDE;
+ virtual void SwitchActiveUser(const std::string& email) OVERRIDE;
virtual void RetailModeUserLoggedIn() OVERRIDE;
virtual void GuestUserLoggedIn() OVERRIDE;
virtual void KioskAppLoggedIn(const std::string& username) OVERRIDE;
@@ -68,6 +70,8 @@ class UserManagerImpl
const string16& display_name) const OVERRIDE;
virtual const User* GetLoggedInUser() const OVERRIDE;
virtual User* GetLoggedInUser() OVERRIDE;
+ virtual const User* GetActiveUser() const OVERRIDE;
+ virtual User* GetActiveUser() OVERRIDE;
virtual void SaveUserOAuthStatus(
const std::string& username,
User::OAuthTokenStatus oauth_token_status) OVERRIDE;
@@ -153,11 +157,24 @@ class UserManagerImpl
// and ephemeral users are enabled.
bool AreEphemeralUsersEnabled() const;
+ // Returns a list of users who have logged into this device previously.
+ // Same as GetUsers but used if you need to modify User from that list.
+ UserList& GetUsersAndModify();
+
+ // Returns the user with the given email address if found in the persistent
+ // list or currently logged in as ephemeral. Returns |NULL| otherwise.
+ // Same as FindUser but returns non-const pointer to User object.
+ User* FindUserAndModify(const std::string& email);
+
// Returns the user with the given email address if found in the persistent
// list. Returns |NULL| otherwise.
const User* FindUserInList(const std::string& email) const;
- // Notifies that new user session has started.
+ // Same as FindUserInList but returns non-const pointer to User object.
+ User* FindUserInListAndModify(const std::string& email);
+
+ // Notifies that user has logged in.
+ // Sends NOTIFICATION_LOGIN_USER_CHANGED notification.
void NotifyOnLogin();
// Reads user's oauth token status from local state preferences.
@@ -221,10 +238,15 @@ class UserManagerImpl
// |UpdateAndCleanUpPublicAccounts|.
UserList users_;
- // The logged-in user. NULL until a user has logged in, then points to one
+ // List of all users that are logged in current session. These point to User
+ // instances in |users_|. Only one of them could be marked as active.
+ UserList logged_in_users_;
+
+ // The logged-in user that is currently active in current session.
+ // NULL until a user has logged in, then points to one
// of the User instances in |users_|, the |guest_user_| instance or an
// ephemeral user instance.
- User* logged_in_user_;
+ User* active_user_;
// True if SessionStarted() has been called.
bool session_started_;
« no previous file with comments | « chrome/browser/chromeos/login/user_manager.h ('k') | chrome/browser/chromeos/login/user_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698