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

Side by Side Diff: chromeos/login/auth/user_context.cc

Issue 671183002: Revert of Inline sign in extracts gaia id from HTTP header and seeds account tracker (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 1 month 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 #include "chromeos/login/auth/user_context.h" 5 #include "chromeos/login/auth/user_context.h"
6 #include "chromeos/login/user_names.h" 6 #include "chromeos/login/user_names.h"
7 7
8 namespace chromeos { 8 namespace chromeos {
9 9
10 UserContext::UserContext() 10 UserContext::UserContext()
11 : is_using_oauth_(true), 11 : is_using_oauth_(true),
12 auth_flow_(AUTH_FLOW_OFFLINE), 12 auth_flow_(AUTH_FLOW_OFFLINE),
13 user_type_(user_manager::USER_TYPE_REGULAR) { 13 user_type_(user_manager::USER_TYPE_REGULAR) {
14 } 14 }
15 15
16 UserContext::UserContext(const UserContext& other) 16 UserContext::UserContext(const UserContext& other)
17 : user_id_(other.user_id_), 17 : user_id_(other.user_id_),
18 gaia_id_(other.gaia_id_),
19 key_(other.key_), 18 key_(other.key_),
20 auth_code_(other.auth_code_), 19 auth_code_(other.auth_code_),
21 user_id_hash_(other.user_id_hash_), 20 user_id_hash_(other.user_id_hash_),
22 is_using_oauth_(other.is_using_oauth_), 21 is_using_oauth_(other.is_using_oauth_),
23 auth_flow_(other.auth_flow_), 22 auth_flow_(other.auth_flow_),
24 user_type_(other.user_type_), 23 user_type_(other.user_type_),
25 public_session_locale_(other.public_session_locale_), 24 public_session_locale_(other.public_session_locale_),
26 public_session_input_method_(other.public_session_input_method_) { 25 public_session_input_method_(other.public_session_input_method_) {
27 } 26 }
28 27
(...skipping 13 matching lines...) Expand all
42 user_id_ = login::CanonicalizeUserID(user_id); 41 user_id_ = login::CanonicalizeUserID(user_id);
43 else 42 else
44 user_id_ = user_id; 43 user_id_ = user_id;
45 } 44 }
46 45
47 UserContext::~UserContext() { 46 UserContext::~UserContext() {
48 } 47 }
49 48
50 bool UserContext::operator==(const UserContext& context) const { 49 bool UserContext::operator==(const UserContext& context) const {
51 return context.user_id_ == user_id_ && 50 return context.user_id_ == user_id_ &&
52 context.gaia_id_ == gaia_id_ &&
53 context.key_ == key_ && 51 context.key_ == key_ &&
54 context.auth_code_ == auth_code_ && 52 context.auth_code_ == auth_code_ &&
55 context.user_id_hash_ == user_id_hash_ && 53 context.user_id_hash_ == user_id_hash_ &&
56 context.is_using_oauth_ == is_using_oauth_ && 54 context.is_using_oauth_ == is_using_oauth_ &&
57 context.auth_flow_ == auth_flow_ && 55 context.auth_flow_ == auth_flow_ &&
58 context.user_type_ == user_type_ && 56 context.user_type_ == user_type_ &&
59 context.public_session_locale_ == public_session_locale_ && 57 context.public_session_locale_ == public_session_locale_ &&
60 context.public_session_input_method_ == public_session_input_method_; 58 context.public_session_input_method_ == public_session_input_method_;
61 } 59 }
62 60
63 bool UserContext::operator!=(const UserContext& context) const { 61 bool UserContext::operator!=(const UserContext& context) const {
64 return !(*this == context); 62 return !(*this == context);
65 } 63 }
66 64
67 const std::string& UserContext::GetUserID() const { 65 const std::string& UserContext::GetUserID() const {
68 return user_id_; 66 return user_id_;
69 } 67 }
70 68
71 const std::string& UserContext::GetGaiaID() const {
72 return gaia_id_;
73 }
74
75 const Key* UserContext::GetKey() const { 69 const Key* UserContext::GetKey() const {
76 return &key_; 70 return &key_;
77 } 71 }
78 72
79 Key* UserContext::GetKey() { 73 Key* UserContext::GetKey() {
80 return &key_; 74 return &key_;
81 } 75 }
82 76
83 const std::string& UserContext::GetAuthCode() const { 77 const std::string& UserContext::GetAuthCode() const {
84 return auth_code_; 78 return auth_code_;
(...skipping 25 matching lines...) Expand all
110 104
111 bool UserContext::HasCredentials() const { 105 bool UserContext::HasCredentials() const {
112 return (!user_id_.empty() && !key_.GetSecret().empty()) || 106 return (!user_id_.empty() && !key_.GetSecret().empty()) ||
113 !auth_code_.empty(); 107 !auth_code_.empty();
114 } 108 }
115 109
116 void UserContext::SetUserID(const std::string& user_id) { 110 void UserContext::SetUserID(const std::string& user_id) {
117 user_id_ = login::CanonicalizeUserID(user_id); 111 user_id_ = login::CanonicalizeUserID(user_id);
118 } 112 }
119 113
120 void UserContext::SetGaiaID(const std::string& gaia_id) {
121 gaia_id_ = gaia_id;
122 }
123
124 void UserContext::SetKey(const Key& key) { 114 void UserContext::SetKey(const Key& key) {
125 key_ = key; 115 key_ = key;
126 } 116 }
127 117
128 void UserContext::SetAuthCode(const std::string& auth_code) { 118 void UserContext::SetAuthCode(const std::string& auth_code) {
129 auth_code_ = auth_code; 119 auth_code_ = auth_code;
130 } 120 }
131 121
132 void UserContext::SetUserIDHash(const std::string& user_id_hash) { 122 void UserContext::SetUserIDHash(const std::string& user_id_hash) {
133 user_id_hash_ = user_id_hash; 123 user_id_hash_ = user_id_hash;
(...skipping 18 matching lines...) Expand all
152 void UserContext::SetPublicSessionInputMethod(const std::string& input_method) { 142 void UserContext::SetPublicSessionInputMethod(const std::string& input_method) {
153 public_session_input_method_ = input_method; 143 public_session_input_method_ = input_method;
154 } 144 }
155 145
156 void UserContext::ClearSecrets() { 146 void UserContext::ClearSecrets() {
157 key_.ClearSecret(); 147 key_.ClearSecret();
158 auth_code_.clear(); 148 auth_code_.clear();
159 } 149 }
160 150
161 } // namespace chromeos 151 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/login/auth/user_context.h ('k') | components/signin/core/browser/account_tracker_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698