From a8e7c94b1b79a0948d05a1fcfff53391d22ce37a Mon Sep 17 00:00:00 2001 From: rogerta Date: Wed, 22 Oct 2014 13:45:39 -0700 Subject: Inline login handler extracts gaia id from HTTP header and seeds account tracker service during sign in. BUG=341408 Review URL: https://codereview.chromium.org/473153002 Cr-Commit-Position: refs/heads/master@{#300750} --- chromeos/login/auth/user_context.cc | 10 ++++++++++ chromeos/login/auth/user_context.h | 3 +++ 2 files changed, 13 insertions(+) (limited to 'chromeos/login/auth') diff --git a/chromeos/login/auth/user_context.cc b/chromeos/login/auth/user_context.cc index 31113f1..edeb24e 100644 --- a/chromeos/login/auth/user_context.cc +++ b/chromeos/login/auth/user_context.cc @@ -15,6 +15,7 @@ UserContext::UserContext() UserContext::UserContext(const UserContext& other) : user_id_(other.user_id_), + gaia_id_(other.gaia_id_), key_(other.key_), auth_code_(other.auth_code_), user_id_hash_(other.user_id_hash_), @@ -48,6 +49,7 @@ 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_ && context.user_id_hash_ == user_id_hash_ && @@ -66,6 +68,10 @@ const std::string& UserContext::GetUserID() const { return user_id_; } +const std::string& UserContext::GetGaiaID() const { + return gaia_id_; +} + const Key* UserContext::GetKey() const { return &key_; } @@ -111,6 +117,10 @@ void UserContext::SetUserID(const std::string& user_id) { user_id_ = login::CanonicalizeUserID(user_id); } +void UserContext::SetGaiaID(const std::string& gaia_id) { + gaia_id_ = gaia_id; +} + void UserContext::SetKey(const Key& key) { key_ = key; } diff --git a/chromeos/login/auth/user_context.h b/chromeos/login/auth/user_context.h index ff28c96..879e59a 100644 --- a/chromeos/login/auth/user_context.h +++ b/chromeos/login/auth/user_context.h @@ -41,6 +41,7 @@ class CHROMEOS_EXPORT UserContext { bool operator!=(const UserContext& context) const; const std::string& GetUserID() const; + const std::string& GetGaiaID() const; const Key* GetKey() const; Key* GetKey(); const std::string& GetAuthCode() const; @@ -54,6 +55,7 @@ class CHROMEOS_EXPORT UserContext { bool HasCredentials() const; void SetUserID(const std::string& user_id); + void SetGaiaID(const std::string& gaia_id); void SetKey(const Key& key); void SetAuthCode(const std::string& auth_code); void SetUserIDHash(const std::string& user_id_hash); @@ -67,6 +69,7 @@ class CHROMEOS_EXPORT UserContext { private: std::string user_id_; + std::string gaia_id_; Key key_; std::string auth_code_; std::string user_id_hash_; -- cgit v1.1