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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 const AccountId& GetAccountId() const; | 51 const AccountId& GetAccountId() const; |
52 const std::string& GetGaiaID() const; | 52 const std::string& GetGaiaID() const; |
53 const Key* GetKey() const; | 53 const Key* GetKey() const; |
54 Key* GetKey(); | 54 Key* GetKey(); |
55 const std::string& GetAuthCode() const; | 55 const std::string& GetAuthCode() const; |
56 const std::string& GetRefreshToken() const; | 56 const std::string& GetRefreshToken() const; |
57 const std::string& GetAccessToken() const; | 57 const std::string& GetAccessToken() const; |
58 const std::string& GetUserIDHash() const; | 58 const std::string& GetUserIDHash() const; |
59 bool IsUsingOAuth() const; | 59 bool IsUsingOAuth() const; |
60 bool IsUsingPin() const; | 60 bool IsUsingPin() const; |
| 61 bool IsForcingDircrypto() const; |
61 AuthFlow GetAuthFlow() const; | 62 AuthFlow GetAuthFlow() const; |
62 user_manager::UserType GetUserType() const; | 63 user_manager::UserType GetUserType() const; |
63 const std::string& GetPublicSessionLocale() const; | 64 const std::string& GetPublicSessionLocale() const; |
64 const std::string& GetPublicSessionInputMethod() const; | 65 const std::string& GetPublicSessionInputMethod() const; |
65 const std::string& GetDeviceId() const; | 66 const std::string& GetDeviceId() const; |
66 const std::string& GetGAPSCookie() const; | 67 const std::string& GetGAPSCookie() const; |
67 | 68 |
68 bool HasCredentials() const; | 69 bool HasCredentials() const; |
69 | 70 |
70 void SetAccountId(const AccountId& account_id); | 71 void SetAccountId(const AccountId& account_id); |
71 void SetKey(const Key& key); | 72 void SetKey(const Key& key); |
72 void SetAuthCode(const std::string& auth_code); | 73 void SetAuthCode(const std::string& auth_code); |
73 void SetRefreshToken(const std::string& refresh_token); | 74 void SetRefreshToken(const std::string& refresh_token); |
74 void SetAccessToken(const std::string& access_token); | 75 void SetAccessToken(const std::string& access_token); |
75 void SetUserIDHash(const std::string& user_id_hash); | 76 void SetUserIDHash(const std::string& user_id_hash); |
76 void SetIsUsingOAuth(bool is_using_oauth); | 77 void SetIsUsingOAuth(bool is_using_oauth); |
77 void SetIsUsingPin(bool is_using_pin); | 78 void SetIsUsingPin(bool is_using_pin); |
| 79 void SetIsForcingDircrypto(bool is_forcing_dircrypto); |
78 void SetAuthFlow(AuthFlow auth_flow); | 80 void SetAuthFlow(AuthFlow auth_flow); |
79 void SetUserType(user_manager::UserType user_type); | 81 void SetUserType(user_manager::UserType user_type); |
80 void SetPublicSessionLocale(const std::string& locale); | 82 void SetPublicSessionLocale(const std::string& locale); |
81 void SetPublicSessionInputMethod(const std::string& input_method); | 83 void SetPublicSessionInputMethod(const std::string& input_method); |
82 void SetDeviceId(const std::string& device_id); | 84 void SetDeviceId(const std::string& device_id); |
83 void SetGAPSCookie(const std::string& gaps_cookie); | 85 void SetGAPSCookie(const std::string& gaps_cookie); |
84 | 86 |
85 void ClearSecrets(); | 87 void ClearSecrets(); |
86 | 88 |
87 private: | 89 private: |
88 AccountId account_id_; | 90 AccountId account_id_; |
89 Key key_; | 91 Key key_; |
90 std::string auth_code_; | 92 std::string auth_code_; |
91 std::string refresh_token_; | 93 std::string refresh_token_; |
92 std::string access_token_; // OAuthLogin scoped access token. | 94 std::string access_token_; // OAuthLogin scoped access token. |
93 std::string user_id_hash_; | 95 std::string user_id_hash_; |
94 bool is_using_oauth_ = true; | 96 bool is_using_oauth_ = true; |
95 bool is_using_pin_ = false; | 97 bool is_using_pin_ = false; |
| 98 bool is_forcing_dircrypto_ = false; |
96 AuthFlow auth_flow_ = AUTH_FLOW_OFFLINE; | 99 AuthFlow auth_flow_ = AUTH_FLOW_OFFLINE; |
97 user_manager::UserType user_type_ = user_manager::USER_TYPE_REGULAR; | 100 user_manager::UserType user_type_ = user_manager::USER_TYPE_REGULAR; |
98 std::string public_session_locale_; | 101 std::string public_session_locale_; |
99 std::string public_session_input_method_; | 102 std::string public_session_input_method_; |
100 std::string device_id_; | 103 std::string device_id_; |
101 std::string gaps_cookie_; | 104 std::string gaps_cookie_; |
102 }; | 105 }; |
103 | 106 |
104 } // namespace chromeos | 107 } // namespace chromeos |
105 | 108 |
106 #endif // CHROMEOS_LOGIN_AUTH_USER_CONTEXT_H_ | 109 #endif // CHROMEOS_LOGIN_AUTH_USER_CONTEXT_H_ |
OLD | NEW |