OLD | NEW |
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 CHROMEOS_LOGIN_AUTH_USER_CONTEXT_H_ | 5 #ifndef CHROMEOS_LOGIN_AUTH_USER_CONTEXT_H_ |
6 #define CHROMEOS_LOGIN_AUTH_USER_CONTEXT_H_ | 6 #define CHROMEOS_LOGIN_AUTH_USER_CONTEXT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chromeos/chromeos_export.h" | 10 #include "chromeos/chromeos_export.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 UserContext(); | 34 UserContext(); |
35 UserContext(const UserContext& other); | 35 UserContext(const UserContext& other); |
36 explicit UserContext(const std::string& user_id); | 36 explicit UserContext(const std::string& user_id); |
37 UserContext(user_manager::UserType user_type, const std::string& user_id); | 37 UserContext(user_manager::UserType user_type, const std::string& user_id); |
38 ~UserContext(); | 38 ~UserContext(); |
39 | 39 |
40 bool operator==(const UserContext& context) const; | 40 bool operator==(const UserContext& context) const; |
41 bool operator!=(const UserContext& context) const; | 41 bool operator!=(const UserContext& context) const; |
42 | 42 |
43 const std::string& GetUserID() const; | 43 const std::string& GetUserID() const; |
44 const std::string& GetGaiaID() const; | |
45 const Key* GetKey() const; | 44 const Key* GetKey() const; |
46 Key* GetKey(); | 45 Key* GetKey(); |
47 const std::string& GetAuthCode() const; | 46 const std::string& GetAuthCode() const; |
48 const std::string& GetUserIDHash() const; | 47 const std::string& GetUserIDHash() const; |
49 bool IsUsingOAuth() const; | 48 bool IsUsingOAuth() const; |
50 AuthFlow GetAuthFlow() const; | 49 AuthFlow GetAuthFlow() const; |
51 user_manager::UserType GetUserType() const; | 50 user_manager::UserType GetUserType() const; |
52 const std::string& GetPublicSessionLocale() const; | 51 const std::string& GetPublicSessionLocale() const; |
53 const std::string& GetPublicSessionInputMethod() const; | 52 const std::string& GetPublicSessionInputMethod() const; |
54 | 53 |
55 bool HasCredentials() const; | 54 bool HasCredentials() const; |
56 | 55 |
57 void SetUserID(const std::string& user_id); | 56 void SetUserID(const std::string& user_id); |
58 void SetGaiaID(const std::string& gaia_id); | |
59 void SetKey(const Key& key); | 57 void SetKey(const Key& key); |
60 void SetAuthCode(const std::string& auth_code); | 58 void SetAuthCode(const std::string& auth_code); |
61 void SetUserIDHash(const std::string& user_id_hash); | 59 void SetUserIDHash(const std::string& user_id_hash); |
62 void SetIsUsingOAuth(bool is_using_oauth); | 60 void SetIsUsingOAuth(bool is_using_oauth); |
63 void SetAuthFlow(AuthFlow auth_flow); | 61 void SetAuthFlow(AuthFlow auth_flow); |
64 void SetUserType(user_manager::UserType user_type); | 62 void SetUserType(user_manager::UserType user_type); |
65 void SetPublicSessionLocale(const std::string& locale); | 63 void SetPublicSessionLocale(const std::string& locale); |
66 void SetPublicSessionInputMethod(const std::string& input_method); | 64 void SetPublicSessionInputMethod(const std::string& input_method); |
67 | 65 |
68 void ClearSecrets(); | 66 void ClearSecrets(); |
69 | 67 |
70 private: | 68 private: |
71 std::string user_id_; | 69 std::string user_id_; |
72 std::string gaia_id_; | |
73 Key key_; | 70 Key key_; |
74 std::string auth_code_; | 71 std::string auth_code_; |
75 std::string user_id_hash_; | 72 std::string user_id_hash_; |
76 bool is_using_oauth_; | 73 bool is_using_oauth_; |
77 AuthFlow auth_flow_; | 74 AuthFlow auth_flow_; |
78 user_manager::UserType user_type_; | 75 user_manager::UserType user_type_; |
79 std::string public_session_locale_; | 76 std::string public_session_locale_; |
80 std::string public_session_input_method_; | 77 std::string public_session_input_method_; |
81 }; | 78 }; |
82 | 79 |
83 } // namespace chromeos | 80 } // namespace chromeos |
84 | 81 |
85 #endif // CHROMEOS_LOGIN_AUTH_USER_CONTEXT_H_ | 82 #endif // CHROMEOS_LOGIN_AUTH_USER_CONTEXT_H_ |
OLD | NEW |