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

Side by Side Diff: chrome/browser/chromeos/login/auth/user_context.h

Issue 324463003: ChromeOS login webui refactoring : Simplify login methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_AUTH_USER_CONTEXT_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_USER_CONTEXT_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_USER_CONTEXT_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_USER_CONTEXT_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "chrome/browser/chromeos/login/auth/key.h" 10 #include "chrome/browser/chromeos/login/auth/key.h"
11 #include "chrome/browser/chromeos/login/users/user.h"
11 12
12 namespace chromeos { 13 namespace chromeos {
13 14
14 // Information that is passed around while authentication is in progress. The 15 // Information that is passed around while authentication is in progress. The
15 // credentials may consist of a |user_id_|, |key_| pair or a GAIA |auth_code_|. 16 // credentials may consist of a |user_id_|, |key_| pair or a GAIA |auth_code_|.
16 // The |user_id_hash_| is used to locate the user's home directory 17 // The |user_id_hash_| is used to locate the user's home directory
17 // mount point for the user. It is set when the mount has been completed. 18 // mount point for the user. It is set when the mount has been completed.
18 class UserContext { 19 class UserContext {
19 public: 20 public:
20 // The authentication flow used during sign-in. 21 // The authentication flow used during sign-in.
(...skipping 14 matching lines...) Expand all
35 bool operator==(const UserContext& context) const; 36 bool operator==(const UserContext& context) const;
36 bool operator!=(const UserContext& context) const; 37 bool operator!=(const UserContext& context) const;
37 38
38 const std::string& GetUserID() const; 39 const std::string& GetUserID() const;
39 const Key* GetKey() const; 40 const Key* GetKey() const;
40 Key* GetKey(); 41 Key* GetKey();
41 const std::string& GetAuthCode() const; 42 const std::string& GetAuthCode() const;
42 const std::string& GetUserIDHash() const; 43 const std::string& GetUserIDHash() const;
43 bool IsUsingOAuth() const; 44 bool IsUsingOAuth() const;
44 AuthFlow GetAuthFlow() const; 45 AuthFlow GetAuthFlow() const;
46 User::UserType GetUserType() const;
45 47
46 bool HasCredentials() const; 48 bool HasCredentials() const;
47 49
48 void SetUserID(const std::string& user_id); 50 void SetUserID(const std::string& user_id);
49 void SetKey(const Key& key); 51 void SetKey(const Key& key);
50 void SetAuthCode(const std::string& auth_code); 52 void SetAuthCode(const std::string& auth_code);
51 void SetUserIDHash(const std::string& user_id_hash); 53 void SetUserIDHash(const std::string& user_id_hash);
52 void SetIsUsingOAuth(bool is_using_oauth); 54 void SetIsUsingOAuth(bool is_using_oauth);
53 void SetAuthFlow(AuthFlow auth_flow); 55 void SetAuthFlow(AuthFlow auth_flow);
56 void SetUserType(User::UserType user_type);
54 57
55 void ClearSecrets(); 58 void ClearSecrets();
56 59
57 private: 60 private:
58 std::string user_id_; 61 std::string user_id_;
59 Key key_; 62 Key key_;
60 std::string auth_code_; 63 std::string auth_code_;
61 std::string user_id_hash_; 64 std::string user_id_hash_;
62 bool is_using_oauth_; 65 bool is_using_oauth_;
63 AuthFlow auth_flow_; 66 AuthFlow auth_flow_;
67 User::UserType user_type_;
64 }; 68 };
65 69
66 } // namespace chromeos 70 } // namespace chromeos
67 71
68 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_USER_CONTEXT_H_ 72 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_USER_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698