OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/common/net/gaia/gaia_authenticator.h" | 5 #include "chrome/common/net/gaia/gaia_authenticator.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/port.h" | 12 #include "base/port.h" |
13 #include "base/string_split.h" | 13 #include "base/string_split.h" |
14 #include "googleurl/src/gurl.h" | 14 #include "googleurl/src/gurl.h" |
15 #include "net/base/escape.h" | 15 #include "net/base/escape.h" |
16 #include "net/http/http_status_code.h" | 16 #include "net/http/http_status_code.h" |
17 | 17 |
18 using std::pair; | 18 using std::pair; |
19 using std::string; | 19 using std::string; |
20 using std::vector; | 20 using std::vector; |
21 | 21 |
22 namespace gaia { | 22 namespace gaia { |
23 | 23 |
24 static const char kGaiaV1IssueAuthTokenPath[] = "/accounts/IssueAuthToken"; | 24 static const char kGaiaV1IssueAuthTokenPath[] = "/accounts/IssueAuthToken"; |
25 | 25 |
26 static const char kGetUserInfoPath[] = "/accounts/GetUserInfo"; | 26 static const char kGetUserInfoPath[] = "/accounts/GetUserInfo"; |
27 | 27 |
28 GaiaAuthenticator::AuthResults::AuthResults() : auth_error(None) {} | 28 GaiaAuthenticator::AuthResults::AuthResults() : auth_error(None) {} |
29 | 29 |
| 30 GaiaAuthenticator::AuthResults::AuthResults(const AuthResults& other) |
| 31 : email(other.email), |
| 32 password(other.password), |
| 33 sid(other.sid), |
| 34 lsid(other.lsid), |
| 35 auth_token(other.auth_token), |
| 36 primary_email(other.primary_email), |
| 37 error_msg(other.error_msg), |
| 38 auth_error(other.auth_error), |
| 39 auth_error_url(other.auth_error_url), |
| 40 captcha_token(other.captcha_token), |
| 41 captcha_url(other.captcha_url) { |
| 42 } |
| 43 |
30 GaiaAuthenticator::AuthResults::~AuthResults() {} | 44 GaiaAuthenticator::AuthResults::~AuthResults() {} |
31 | 45 |
32 GaiaAuthenticator::AuthParams::AuthParams() : authenticator(NULL), | 46 GaiaAuthenticator::AuthParams::AuthParams() : authenticator(NULL), |
33 request_id(0) {} | 47 request_id(0) {} |
34 | 48 |
35 GaiaAuthenticator::AuthParams::~AuthParams() {} | 49 GaiaAuthenticator::AuthParams::~AuthParams() {} |
36 | 50 |
37 // Sole constructor with initializers for all fields. | 51 // Sole constructor with initializers for all fields. |
38 GaiaAuthenticator::GaiaAuthenticator(const string& user_agent, | 52 GaiaAuthenticator::GaiaAuthenticator(const string& user_agent, |
39 const string& service_id, | 53 const string& service_id, |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 | 391 |
378 bool GaiaAuthenticator::Authenticate(const string& user_name, | 392 bool GaiaAuthenticator::Authenticate(const string& user_name, |
379 const string& password) { | 393 const string& password) { |
380 DCHECK_EQ(MessageLoop::current(), message_loop_); | 394 DCHECK_EQ(MessageLoop::current(), message_loop_); |
381 const string empty; | 395 const string empty; |
382 return Authenticate(user_name, password, empty, | 396 return Authenticate(user_name, password, empty, |
383 empty); | 397 empty); |
384 } | 398 } |
385 | 399 |
386 } // namespace gaia | 400 } // namespace gaia |
OLD | NEW |