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

Side by Side Diff: chrome/browser/chromeos/login/user_manager.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 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_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 virtual void Shutdown() = 0; 88 virtual void Shutdown() = 0;
89 89
90 virtual ~UserManager(); 90 virtual ~UserManager();
91 91
92 virtual UserImageManager* GetUserImageManager() = 0; 92 virtual UserImageManager* GetUserImageManager() = 0;
93 93
94 // Returns a list of users who have logged into this device previously. This 94 // Returns a list of users who have logged into this device previously. This
95 // is sorted by last login date with the most recent user at the beginning. 95 // is sorted by last login date with the most recent user at the beginning.
96 virtual const UserList& GetUsers() const = 0; 96 virtual const UserList& GetUsers() const = 0;
97 97
98 // Returns a list of users who are currently logged in.
99 virtual const UserList& GetLoggedInUsers() const = 0;
100
98 // Indicates that a user with the given |email| has just logged in. The 101 // Indicates that a user with the given |email| has just logged in. The
99 // persistent list is updated accordingly if the user is not ephemeral. 102 // persistent list is updated accordingly if the user is not ephemeral.
100 // |browser_restart| is true when reloading Chrome after crash to distinguish 103 // |browser_restart| is true when reloading Chrome after crash to distinguish
101 // from normal sign in flow. 104 // from normal sign in flow.
102 // |username_hash| is used to identify homedir mount point. 105 // |username_hash| is used to identify homedir mount point.
103 virtual void UserLoggedIn(const std::string& email, 106 virtual void UserLoggedIn(const std::string& email,
104 const std::string& username_hash, 107 const std::string& username_hash,
105 bool browser_restart) = 0; 108 bool browser_restart) = 0;
106 109
110 // Switches to active user identified by |email|. User has to be logged in.
111 virtual void SwitchActiveUser(const std::string& email) = 0;
112
107 // Indicates that user just logged on as the retail mode user. 113 // Indicates that user just logged on as the retail mode user.
108 virtual void RetailModeUserLoggedIn() = 0; 114 virtual void RetailModeUserLoggedIn() = 0;
109 115
110 // Indicates that user just started incognito session. 116 // Indicates that user just started incognito session.
111 virtual void GuestUserLoggedIn() = 0; 117 virtual void GuestUserLoggedIn() = 0;
112 118
113 // Indicates that a kiosk app robot just logged in. 119 // Indicates that a kiosk app robot just logged in.
114 virtual void KioskAppLoggedIn(const std::string& app_id) = 0; 120 virtual void KioskAppLoggedIn(const std::string& app_id) = 0;
115 121
116 // Indicates that a locally managed user just logged in. 122 // Indicates that a locally managed user just logged in.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 // Returns the user with the given email address if found in the persistent 167 // Returns the user with the given email address if found in the persistent
162 // list or currently logged in as ephemeral. Returns |NULL| otherwise. 168 // list or currently logged in as ephemeral. Returns |NULL| otherwise.
163 virtual const User* FindUser(const std::string& email) const = 0; 169 virtual const User* FindUser(const std::string& email) const = 0;
164 170
165 // Returns the locally managed user with the given |display_name| if found in 171 // Returns the locally managed user with the given |display_name| if found in
166 // the persistent list. Returns |NULL| otherwise. 172 // the persistent list. Returns |NULL| otherwise.
167 virtual const User* FindLocallyManagedUser( 173 virtual const User* FindLocallyManagedUser(
168 const string16& display_name) const = 0; 174 const string16& display_name) const = 0;
169 175
170 // Returns the logged-in user. 176 // Returns the logged-in user.
177 // TODO(nkostylev): Deprecate this call, move clients to GetActiveUser().
178 // http://crbug.com/230852
171 virtual const User* GetLoggedInUser() const = 0; 179 virtual const User* GetLoggedInUser() const = 0;
172 virtual User* GetLoggedInUser() = 0; 180 virtual User* GetLoggedInUser() = 0;
173 181
182 // Returns the logged-in user that is currently active within this session.
183 // There could be multiple users logged in at the the same but for now
184 // we support only one of them being active.
185 virtual const User* GetActiveUser() const = 0;
186 virtual User* GetActiveUser() = 0;
187
174 // Saves user's oauth token status in local state preferences. 188 // Saves user's oauth token status in local state preferences.
175 virtual void SaveUserOAuthStatus( 189 virtual void SaveUserOAuthStatus(
176 const std::string& username, 190 const std::string& username,
177 User::OAuthTokenStatus oauth_token_status) = 0; 191 User::OAuthTokenStatus oauth_token_status) = 0;
178 192
179 // Saves user's displayed name in local state preferences. 193 // Saves user's displayed name in local state preferences.
180 // Ignored If there is no such user. 194 // Ignored If there is no such user.
181 virtual void SaveUserDisplayName(const std::string& username, 195 virtual void SaveUserDisplayName(const std::string& username,
182 const string16& display_name) = 0; 196 const string16& display_name) = 0;
183 197
(...skipping 22 matching lines...) Expand all
206 220
207 // Returns true if data stored or cached for the current user outside that 221 // Returns true if data stored or cached for the current user outside that
208 // user's cryptohome (wallpaper, avatar, OAuth token status, display name, 222 // user's cryptohome (wallpaper, avatar, OAuth token status, display name,
209 // display email) is ephemeral. 223 // display email) is ephemeral.
210 virtual bool IsCurrentUserNonCryptohomeDataEphemeral() const = 0; 224 virtual bool IsCurrentUserNonCryptohomeDataEphemeral() const = 0;
211 225
212 // Returns true if the current user's session can be locked (i.e. the user has 226 // Returns true if the current user's session can be locked (i.e. the user has
213 // a password with which to unlock the session). 227 // a password with which to unlock the session).
214 virtual bool CanCurrentUserLock() const = 0; 228 virtual bool CanCurrentUserLock() const = 0;
215 229
216 // Returns true if user is signed in. 230 // Returns true if at least one user has signed in.
217 virtual bool IsUserLoggedIn() const = 0; 231 virtual bool IsUserLoggedIn() const = 0;
218 232
219 // Returns true if we're logged in as a regular user. 233 // Returns true if we're logged in as a regular user.
220 virtual bool IsLoggedInAsRegularUser() const = 0; 234 virtual bool IsLoggedInAsRegularUser() const = 0;
221 235
222 // Returns true if we're logged in as a demo user. 236 // Returns true if we're logged in as a demo user.
223 virtual bool IsLoggedInAsDemoUser() const = 0; 237 virtual bool IsLoggedInAsDemoUser() const = 0;
224 238
225 // Returns true if we're logged in as a public account. 239 // Returns true if we're logged in as a public account.
226 virtual bool IsLoggedInAsPublicAccount() const = 0; 240 virtual bool IsLoggedInAsPublicAccount() const = 0;
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 313
300 virtual void AddObserver(Observer* obs) = 0; 314 virtual void AddObserver(Observer* obs) = 0;
301 virtual void RemoveObserver(Observer* obs) = 0; 315 virtual void RemoveObserver(Observer* obs) = 0;
302 316
303 virtual void NotifyLocalStateChanged() = 0; 317 virtual void NotifyLocalStateChanged() = 0;
304 }; 318 };
305 319
306 } // namespace chromeos 320 } // namespace chromeos
307 321
308 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ 322 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/user.cc ('k') | chrome/browser/chromeos/login/user_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698