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 | 164 |
165 // The displayed user name. | 165 // The displayed user name. |
166 base::string16 display_name() const { return display_name_; } | 166 base::string16 display_name() const { return display_name_; } |
167 | 167 |
168 // The displayed (non-canonical) user email. | 168 // The displayed (non-canonical) user email. |
169 virtual std::string display_email() const; | 169 virtual std::string display_email() const; |
170 | 170 |
171 // OAuth token status for this user. | 171 // OAuth token status for this user. |
172 OAuthTokenStatus oauth_token_status() const { return oauth_token_status_; } | 172 OAuthTokenStatus oauth_token_status() const { return oauth_token_status_; } |
173 | 173 |
| 174 // Whether online authentication against GAIA should be enforced during the |
| 175 // user's next sign-in. |
| 176 bool force_online_signin() const { return force_online_signin_; } |
| 177 |
174 // True if the user's session can be locked (i.e. the user has a password with | 178 // True if the user's session can be locked (i.e. the user has a password with |
175 // which to unlock the session). | 179 // which to unlock the session). |
176 virtual bool can_lock() const; | 180 virtual bool can_lock() const; |
177 | 181 |
178 virtual std::string username_hash() const; | 182 virtual std::string username_hash() const; |
179 | 183 |
180 // True if current user is logged in. | 184 // True if current user is logged in. |
181 virtual bool is_logged_in() const; | 185 virtual bool is_logged_in() const; |
182 | 186 |
183 // True if current user is active within the current session. | 187 // True if current user is active within the current session. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 void set_display_email(const std::string& display_email) { | 237 void set_display_email(const std::string& display_email) { |
234 display_email_ = display_email; | 238 display_email_ = display_email; |
235 } | 239 } |
236 | 240 |
237 const UserImage& user_image() const { return user_image_; } | 241 const UserImage& user_image() const { return user_image_; } |
238 | 242 |
239 void set_oauth_token_status(OAuthTokenStatus status) { | 243 void set_oauth_token_status(OAuthTokenStatus status) { |
240 oauth_token_status_ = status; | 244 oauth_token_status_ = status; |
241 } | 245 } |
242 | 246 |
| 247 void set_force_online_signin(bool force_online_signin) { |
| 248 force_online_signin_ = force_online_signin; |
| 249 } |
| 250 |
243 void set_username_hash(const std::string& username_hash) { | 251 void set_username_hash(const std::string& username_hash) { |
244 username_hash_ = username_hash; | 252 username_hash_ = username_hash; |
245 } | 253 } |
246 | 254 |
247 void set_is_logged_in(bool is_logged_in) { | 255 void set_is_logged_in(bool is_logged_in) { |
248 is_logged_in_ = is_logged_in; | 256 is_logged_in_ = is_logged_in; |
249 } | 257 } |
250 | 258 |
251 void set_can_lock(bool can_lock) { | 259 void set_can_lock(bool can_lock) { |
252 can_lock_ = can_lock; | 260 can_lock_ = can_lock; |
(...skipping 11 matching lines...) Expand all Loading... |
264 bool has_gaia_account() const; | 272 bool has_gaia_account() const; |
265 | 273 |
266 private: | 274 private: |
267 std::string email_; | 275 std::string email_; |
268 base::string16 display_name_; | 276 base::string16 display_name_; |
269 base::string16 given_name_; | 277 base::string16 given_name_; |
270 // The displayed user email, defaults to |email_|. | 278 // The displayed user email, defaults to |email_|. |
271 std::string display_email_; | 279 std::string display_email_; |
272 UserImage user_image_; | 280 UserImage user_image_; |
273 OAuthTokenStatus oauth_token_status_; | 281 OAuthTokenStatus oauth_token_status_; |
| 282 bool force_online_signin_; |
274 | 283 |
275 // This is set to chromeos locale if account data has been downloaded. | 284 // This is set to chromeos locale if account data has been downloaded. |
276 // (Or failed to download, but at least one download attempt finished). | 285 // (Or failed to download, but at least one download attempt finished). |
277 // An empty string indicates error in data load, or in | 286 // An empty string indicates error in data load, or in |
278 // translation of Account locale to chromeos locale. | 287 // translation of Account locale to chromeos locale. |
279 scoped_ptr<std::string> account_locale_; | 288 scoped_ptr<std::string> account_locale_; |
280 | 289 |
281 // Used to identify homedir mount point. | 290 // Used to identify homedir mount point. |
282 std::string username_hash_; | 291 std::string username_hash_; |
283 | 292 |
(...skipping 21 matching lines...) Expand all Loading... |
305 | 314 |
306 DISALLOW_COPY_AND_ASSIGN(User); | 315 DISALLOW_COPY_AND_ASSIGN(User); |
307 }; | 316 }; |
308 | 317 |
309 // List of known users. | 318 // List of known users. |
310 typedef std::vector<User*> UserList; | 319 typedef std::vector<User*> UserList; |
311 | 320 |
312 } // namespace chromeos | 321 } // namespace chromeos |
313 | 322 |
314 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_H_ | 323 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_H_ |
OLD | NEW |