| 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 virtual bool can_lock() const; | 164 virtual bool can_lock() const; |
| 165 | 165 |
| 166 virtual std::string username_hash() const; | 166 virtual std::string username_hash() const; |
| 167 | 167 |
| 168 // True if current user is logged in. | 168 // True if current user is logged in. |
| 169 virtual bool is_logged_in() const; | 169 virtual bool is_logged_in() const; |
| 170 | 170 |
| 171 // True if current user is active within the current session. | 171 // True if current user is active within the current session. |
| 172 virtual bool is_active() const; | 172 virtual bool is_active() const; |
| 173 | 173 |
| 174 // True if the user Profile is created. |
| 175 bool is_profile_created() const { |
| 176 return profile_is_created_; |
| 177 } |
| 178 |
| 174 protected: | 179 protected: |
| 175 friend class SupervisedUserManagerImpl; | 180 friend class SupervisedUserManagerImpl; |
| 176 friend class UserManagerImpl; | 181 friend class UserManagerImpl; |
| 177 friend class UserImageManagerImpl; | 182 friend class UserImageManagerImpl; |
| 178 // For testing: | 183 // For testing: |
| 179 friend class MockUserManager; | 184 friend class MockUserManager; |
| 180 friend class FakeUserManager; | 185 friend class FakeUserManager; |
| 181 | 186 |
| 182 // Do not allow anyone else to create new User instances. | 187 // Do not allow anyone else to create new User instances. |
| 183 static User* CreateRegularUser(const std::string& email); | 188 static User* CreateRegularUser(const std::string& email); |
| 184 static User* CreateGuestUser(); | 189 static User* CreateGuestUser(); |
| 185 static User* CreateKioskAppUser(const std::string& kiosk_app_username); | 190 static User* CreateKioskAppUser(const std::string& kiosk_app_username); |
| 186 static User* CreateLocallyManagedUser(const std::string& username); | 191 static User* CreateLocallyManagedUser(const std::string& username); |
| 187 static User* CreateRetailModeUser(); | 192 static User* CreateRetailModeUser(); |
| 188 static User* CreatePublicAccountUser(const std::string& email); | 193 static User* CreatePublicAccountUser(const std::string& email); |
| 189 | 194 |
| 190 explicit User(const std::string& email); | 195 explicit User(const std::string& email); |
| 191 virtual ~User(); | 196 virtual ~User(); |
| 192 | 197 |
| 193 bool is_profile_created() const { | |
| 194 return profile_is_created_; | |
| 195 } | |
| 196 | |
| 197 const std::string* GetAccountLocale() const { | 198 const std::string* GetAccountLocale() const { |
| 198 return account_locale_.get(); | 199 return account_locale_.get(); |
| 199 } | 200 } |
| 200 | 201 |
| 201 // Setters are private so only UserManager can call them. | 202 // Setters are private so only UserManager can call them. |
| 202 void SetAccountLocale(const std::string& resolved_account_locale); | 203 void SetAccountLocale(const std::string& resolved_account_locale); |
| 203 | 204 |
| 204 void SetImage(const UserImage& user_image, int image_index); | 205 void SetImage(const UserImage& user_image, int image_index); |
| 205 | 206 |
| 206 void SetImageURL(const GURL& image_url); | 207 void SetImageURL(const GURL& image_url); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 | 285 |
| 285 DISALLOW_COPY_AND_ASSIGN(User); | 286 DISALLOW_COPY_AND_ASSIGN(User); |
| 286 }; | 287 }; |
| 287 | 288 |
| 288 // List of known users. | 289 // List of known users. |
| 289 typedef std::vector<User*> UserList; | 290 typedef std::vector<User*> UserList; |
| 290 | 291 |
| 291 } // namespace chromeos | 292 } // namespace chromeos |
| 292 | 293 |
| 293 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_H_ | 294 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_H_ |
| OLD | NEW |