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

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

Issue 143873012: Add local state flag to force online login for a user (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 bool force_online_signin() const { return force_online_signin_; }
Nikita (slow) 2014/01/23 16:06:56 nit: Please add comment.
bartfab (slow) 2014/01/24 12:08:05 Done.
175
174 // True if the user's session can be locked (i.e. the user has a password with 176 // True if the user's session can be locked (i.e. the user has a password with
175 // which to unlock the session). 177 // which to unlock the session).
176 virtual bool can_lock() const; 178 virtual bool can_lock() const;
177 179
178 virtual std::string username_hash() const; 180 virtual std::string username_hash() const;
179 181
180 // True if current user is logged in. 182 // True if current user is logged in.
181 virtual bool is_logged_in() const; 183 virtual bool is_logged_in() const;
182 184
183 // True if current user is active within the current session. 185 // True if current user is active within the current session.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 void set_display_email(const std::string& display_email) { 234 void set_display_email(const std::string& display_email) {
233 display_email_ = display_email; 235 display_email_ = display_email;
234 } 236 }
235 237
236 const UserImage& user_image() const { return user_image_; } 238 const UserImage& user_image() const { return user_image_; }
237 239
238 void set_oauth_token_status(OAuthTokenStatus status) { 240 void set_oauth_token_status(OAuthTokenStatus status) {
239 oauth_token_status_ = status; 241 oauth_token_status_ = status;
240 } 242 }
241 243
244 void set_force_online_signin(bool force_online_signin) {
245 force_online_signin_ = force_online_signin;
246 }
247
242 void set_username_hash(const std::string& username_hash) { 248 void set_username_hash(const std::string& username_hash) {
243 username_hash_ = username_hash; 249 username_hash_ = username_hash;
244 } 250 }
245 251
246 void set_is_logged_in(bool is_logged_in) { 252 void set_is_logged_in(bool is_logged_in) {
247 is_logged_in_ = is_logged_in; 253 is_logged_in_ = is_logged_in;
248 } 254 }
249 255
250 void set_is_active(bool is_active) { 256 void set_is_active(bool is_active) {
251 is_active_ = is_active; 257 is_active_ = is_active;
252 } 258 }
253 259
254 void set_profile_is_created() { 260 void set_profile_is_created() {
255 profile_is_created_ = true; 261 profile_is_created_ = true;
256 } 262 }
257 263
258 // True if user has google account (not a guest or managed user). 264 // True if user has google account (not a guest or managed user).
259 bool has_gaia_account() const; 265 bool has_gaia_account() const;
260 266
261 private: 267 private:
262 std::string email_; 268 std::string email_;
263 base::string16 display_name_; 269 base::string16 display_name_;
264 base::string16 given_name_; 270 base::string16 given_name_;
265 // The displayed user email, defaults to |email_|. 271 // The displayed user email, defaults to |email_|.
266 std::string display_email_; 272 std::string display_email_;
267 UserImage user_image_; 273 UserImage user_image_;
268 OAuthTokenStatus oauth_token_status_; 274 OAuthTokenStatus oauth_token_status_;
275 bool force_online_signin_;
269 276
270 // This is set to chromeos locale if account data has been downloaded. 277 // This is set to chromeos locale if account data has been downloaded.
271 // (Or failed to download, but at least one download attempt finished). 278 // (Or failed to download, but at least one download attempt finished).
272 // An empty string indicates error in data load, or in 279 // An empty string indicates error in data load, or in
273 // translation of Account locale to chromeos locale. 280 // translation of Account locale to chromeos locale.
274 scoped_ptr<std::string> account_locale_; 281 scoped_ptr<std::string> account_locale_;
275 282
276 // Used to identify homedir mount point. 283 // Used to identify homedir mount point.
277 std::string username_hash_; 284 std::string username_hash_;
278 285
(...skipping 18 matching lines...) Expand all
297 304
298 DISALLOW_COPY_AND_ASSIGN(User); 305 DISALLOW_COPY_AND_ASSIGN(User);
299 }; 306 };
300 307
301 // List of known users. 308 // List of known users.
302 typedef std::vector<User*> UserList; 309 typedef std::vector<User*> UserList;
303 310
304 } // namespace chromeos 311 } // namespace chromeos
305 312
306 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_H_ 313 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698