Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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); | |
|
Nikita (slow)
2014/05/14 20:10:16
I don't see this being used in this CL so makes se
zel
2014/05/14 21:17:57
Done.
| |
| 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) { |
| 243 given_name_ = given_name; | |
| 244 } | |
| 242 | 245 |
| 243 void set_display_email(const std::string& display_email) { | 246 void set_display_email(const std::string& display_email) { |
| 244 display_email_ = display_email; | 247 display_email_ = display_email; |
| 245 } | 248 } |
| 246 | 249 |
| 247 const UserImage& user_image() const { return user_image_; } | 250 const UserImage& user_image() const { return user_image_; } |
| 248 | 251 |
| 249 void set_oauth_token_status(OAuthTokenStatus status) { | 252 void set_oauth_token_status(OAuthTokenStatus status) { |
| 250 oauth_token_status_ = status; | 253 oauth_token_status_ = status; |
| 251 } | 254 } |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 320 | 323 |
| 321 DISALLOW_COPY_AND_ASSIGN(User); | 324 DISALLOW_COPY_AND_ASSIGN(User); |
| 322 }; | 325 }; |
| 323 | 326 |
| 324 // List of known users. | 327 // List of known users. |
| 325 typedef std::vector<User*> UserList; | 328 typedef std::vector<User*> UserList; |
| 326 | 329 |
| 327 } // namespace chromeos | 330 } // namespace chromeos |
| 328 | 331 |
| 329 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_H_ | 332 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_H_ |
| OLD | NEW |