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

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

Issue 271533004: Turning on MultiProfile by default for ChromeOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USER_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 virtual bool is_logged_in() const; 190 virtual bool is_logged_in() const;
191 191
192 // True if current user is active within the current session. 192 // True if current user is active within the current session.
193 virtual bool is_active() const; 193 virtual bool is_active() const;
194 194
195 // True if the user Profile is created. 195 // True if the user Profile is created.
196 bool is_profile_created() const { 196 bool is_profile_created() const {
197 return profile_is_created_; 197 return profile_is_created_;
198 } 198 }
199 199
200 static User* CreateRegularUser(const std::string& email);
201
200 protected: 202 protected:
201 friend class SupervisedUserManagerImpl; 203 friend class SupervisedUserManagerImpl;
202 friend class UserManagerImpl; 204 friend class UserManagerImpl;
203 friend class UserImageManagerImpl; 205 friend class UserImageManagerImpl;
204 // For testing: 206 // For testing:
205 friend class MockUserManager; 207 friend class MockUserManager;
206 friend class FakeLoginUtils; 208 friend class FakeLoginUtils;
207 friend class FakeUserManager; 209 friend class FakeUserManager;
208 friend class UserAddingScreenTest; 210 friend class UserAddingScreenTest;
209 211
210 // Do not allow anyone else to create new User instances. 212 // Do not allow anyone else to create new User instances.
211 static User* CreateRegularUser(const std::string& email);
212 static User* CreateGuestUser(); 213 static User* CreateGuestUser();
213 static User* CreateKioskAppUser(const std::string& kiosk_app_username); 214 static User* CreateKioskAppUser(const std::string& kiosk_app_username);
214 static User* CreateLocallyManagedUser(const std::string& username); 215 static User* CreateLocallyManagedUser(const std::string& username);
215 static User* CreateRetailModeUser(); 216 static User* CreateRetailModeUser();
216 static User* CreatePublicAccountUser(const std::string& email); 217 static User* CreatePublicAccountUser(const std::string& email);
217 218
218 explicit User(const std::string& email); 219 explicit User(const std::string& email);
219 virtual ~User(); 220 virtual ~User();
220 221
221 const std::string* GetAccountLocale() const { 222 const std::string* GetAccountLocale() const {
222 return account_locale_.get(); 223 return account_locale_.get();
223 } 224 }
224 225
225 // Setters are private so only UserManager can call them. 226 // Setters are private so only UserManager can call them.
226 void SetAccountLocale(const std::string& resolved_account_locale); 227 void SetAccountLocale(const std::string& resolved_account_locale);
227 228
228 void SetImage(const UserImage& user_image, int image_index); 229 void SetImage(const UserImage& user_image, int image_index);
229 230
230 void SetImageURL(const GURL& image_url); 231 void SetImageURL(const GURL& image_url);
231 232
232 // Sets a stub image until the next |SetImage| call. |image_index| may be 233 // Sets a stub image until the next |SetImage| call. |image_index| may be
233 // one of |kExternalImageIndex| or |kProfileImageIndex|. 234 // one of |kExternalImageIndex| or |kProfileImageIndex|.
234 // If |is_loading| is |true|, that means user image is being loaded from file. 235 // If |is_loading| is |true|, that means user image is being loaded from file.
235 void SetStubImage(int image_index, bool is_loading); 236 void SetStubImage(int image_index, bool is_loading);
236 237
237 void set_display_name(const base::string16& display_name) { 238 void set_display_name(const base::string16& display_name) {
238 display_name_ = display_name; 239 display_name_ = display_name;
239 } 240 }
240 241
241 void set_given_name(const base::string16& given_name) { given_name_ = given_na me; } 242 void set_given_name(const base::string16& given_name) { given_name_ = given_na me; }
Mr4D (OOO till 08-26) 2014/05/14 16:32:40 Can you please make this into 80 chars?
zel 2014/05/14 17:48:39 Done.
242 243
243 void set_display_email(const std::string& display_email) { 244 void set_display_email(const std::string& display_email) {
244 display_email_ = display_email; 245 display_email_ = display_email;
245 } 246 }
246 247
247 const UserImage& user_image() const { return user_image_; } 248 const UserImage& user_image() const { return user_image_; }
248 249
249 void set_oauth_token_status(OAuthTokenStatus status) { 250 void set_oauth_token_status(OAuthTokenStatus status) {
250 oauth_token_status_ = status; 251 oauth_token_status_ = status;
251 } 252 }
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 321
321 DISALLOW_COPY_AND_ASSIGN(User); 322 DISALLOW_COPY_AND_ASSIGN(User);
322 }; 323 };
323 324
324 // List of known users. 325 // List of known users.
325 typedef std::vector<User*> UserList; 326 typedef std::vector<User*> UserList;
326 327
327 } // namespace chromeos 328 } // namespace chromeos
328 329
329 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_H_ 330 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698