diff options
author | achuith <achuith@chromium.org> | 2015-04-25 06:10:25 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-25 13:10:30 +0000 |
commit | 09f1fa1af73e355514a2eb1594c4ba1f2e76acbd (patch) | |
tree | ac379800a160aac68471ef7cc1bdc9ea5f540fa2 /chromeos/login/auth | |
parent | 4bd1016edc10a99ceca3b08aa5c13a43509ab183 (diff) | |
download | chromium_src-09f1fa1af73e355514a2eb1594c4ba1f2e76acbd.zip chromium_src-09f1fa1af73e355514a2eb1594c4ba1f2e76acbd.tar.gz chromium_src-09f1fa1af73e355514a2eb1594c4ba1f2e76acbd.tar.bz2 |
Fetch OAuth2 tokens prior to profile creation.
BUG=470984
TEST=
Committed: https://crrev.com/163a4a63af5e56801395eed067a69e501e7b51a5
Cr-Commit-Position: refs/heads/master@{#326691}
Review URL: https://codereview.chromium.org/1097663003
Cr-Commit-Position: refs/heads/master@{#326967}
Diffstat (limited to 'chromeos/login/auth')
-rw-r--r-- | chromeos/login/auth/user_context.cc | 20 | ||||
-rw-r--r-- | chromeos/login/auth/user_context.h | 3 |
2 files changed, 17 insertions, 6 deletions
diff --git a/chromeos/login/auth/user_context.cc b/chromeos/login/auth/user_context.cc index d82ae5a..4f51b34 100644 --- a/chromeos/login/auth/user_context.cc +++ b/chromeos/login/auth/user_context.cc @@ -19,6 +19,7 @@ UserContext::UserContext(const UserContext& other) key_(other.key_), auth_code_(other.auth_code_), refresh_token_(other.refresh_token_), + access_token_(other.access_token_), user_id_hash_(other.user_id_hash_), is_using_oauth_(other.is_using_oauth_), auth_flow_(other.auth_flow_), @@ -49,14 +50,13 @@ UserContext::~UserContext() { } bool UserContext::operator==(const UserContext& context) const { - return context.user_id_ == user_id_ && - context.gaia_id_ == gaia_id_ && - context.key_ == key_ && - context.auth_code_ == auth_code_ && + return context.user_id_ == user_id_ && context.gaia_id_ == gaia_id_ && + context.key_ == key_ && context.auth_code_ == auth_code_ && + context.refresh_token_ == refresh_token_ && + context.access_token_ == access_token_ && context.user_id_hash_ == user_id_hash_ && context.is_using_oauth_ == is_using_oauth_ && - context.auth_flow_ == auth_flow_ && - context.user_type_ == user_type_ && + context.auth_flow_ == auth_flow_ && context.user_type_ == user_type_ && context.public_session_locale_ == public_session_locale_ && context.public_session_input_method_ == public_session_input_method_; } @@ -89,6 +89,10 @@ const std::string& UserContext::GetRefreshToken() const { return refresh_token_; } +const std::string& UserContext::GetAccessToken() const { + return access_token_; +} + const std::string& UserContext::GetUserIDHash() const { return user_id_hash_; } @@ -142,6 +146,10 @@ void UserContext::SetRefreshToken(const std::string& refresh_token) { refresh_token_ = refresh_token; } +void UserContext::SetAccessToken(const std::string& access_token) { + access_token_ = access_token; +} + void UserContext::SetUserIDHash(const std::string& user_id_hash) { user_id_hash_ = user_id_hash; } diff --git a/chromeos/login/auth/user_context.h b/chromeos/login/auth/user_context.h index bac7f4f..727df7f 100644 --- a/chromeos/login/auth/user_context.h +++ b/chromeos/login/auth/user_context.h @@ -48,6 +48,7 @@ class CHROMEOS_EXPORT UserContext { Key* GetKey(); const std::string& GetAuthCode() const; const std::string& GetRefreshToken() const; + const std::string& GetAccessToken() const; const std::string& GetUserIDHash() const; bool IsUsingOAuth() const; AuthFlow GetAuthFlow() const; @@ -63,6 +64,7 @@ class CHROMEOS_EXPORT UserContext { void SetKey(const Key& key); void SetAuthCode(const std::string& auth_code); void SetRefreshToken(const std::string& refresh_token); + void SetAccessToken(const std::string& access_token); void SetUserIDHash(const std::string& user_id_hash); void SetIsUsingOAuth(bool is_using_oauth); void SetAuthFlow(AuthFlow auth_flow); @@ -79,6 +81,7 @@ class CHROMEOS_EXPORT UserContext { Key key_; std::string auth_code_; std::string refresh_token_; + std::string access_token_; // OAuthLogin scoped access token. std::string user_id_hash_; bool is_using_oauth_; AuthFlow auth_flow_; |