OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_COMMON_NET_GAIA_GAIA_AUTH_FETCHER_H_ | 5 #ifndef CHROME_COMMON_NET_GAIA_GAIA_AUTH_FETCHER_H_ |
6 #define CHROME_COMMON_NET_GAIA_GAIA_AUTH_FETCHER_H_ | 6 #define CHROME_COMMON_NET_GAIA_GAIA_AUTH_FETCHER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // The format of said POST body when CAPTCHA token & answer are specified. | 98 // The format of said POST body when CAPTCHA token & answer are specified. |
99 static const char kClientLoginCaptchaFormat[]; | 99 static const char kClientLoginCaptchaFormat[]; |
100 // The format of the POST body for IssueAuthToken. | 100 // The format of the POST body for IssueAuthToken. |
101 static const char kIssueAuthTokenFormat[]; | 101 static const char kIssueAuthTokenFormat[]; |
102 // The format of the POSt body for GetUserInfo. | 102 // The format of the POSt body for GetUserInfo. |
103 static const char kGetUserInfoFormat[]; | 103 static const char kGetUserInfoFormat[]; |
104 | 104 |
105 // Constants for parsing ClientLogin errors. | 105 // Constants for parsing ClientLogin errors. |
106 static const char kAccountDeletedError[]; | 106 static const char kAccountDeletedError[]; |
107 static const char kAccountDisabledError[]; | 107 static const char kAccountDisabledError[]; |
| 108 static const char kBadAuthenticationError[]; |
108 static const char kCaptchaError[]; | 109 static const char kCaptchaError[]; |
109 static const char kServiceUnavailableError[]; | 110 static const char kServiceUnavailableError[]; |
110 static const char kErrorParam[]; | 111 static const char kErrorParam[]; |
111 static const char kErrorUrlParam[]; | 112 static const char kErrorUrlParam[]; |
112 static const char kCaptchaUrlParam[]; | 113 static const char kCaptchaUrlParam[]; |
113 static const char kCaptchaTokenParam[]; | 114 static const char kCaptchaTokenParam[]; |
114 static const char kCaptchaUrlPrefix[]; | 115 static const char kCaptchaUrlPrefix[]; |
115 | 116 |
116 // Process the results of a ClientLogin fetch. | 117 // Process the results of a ClientLogin fetch. |
117 void OnClientLoginFetched(const std::string& data, | 118 void OnClientLoginFetched(const std::string& data, |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 scoped_ptr<URLFetcher> fetcher_; | 186 scoped_ptr<URLFetcher> fetcher_; |
186 std::string request_body_; | 187 std::string request_body_; |
187 std::string requested_service_; // Currently tracked for IssueAuthToken only | 188 std::string requested_service_; // Currently tracked for IssueAuthToken only |
188 std::string requested_info_key_; // Currently tracked for GetUserInfo only | 189 std::string requested_info_key_; // Currently tracked for GetUserInfo only |
189 bool fetch_pending_; | 190 bool fetch_pending_; |
190 | 191 |
191 friend class GaiaAuthFetcherTest; | 192 friend class GaiaAuthFetcherTest; |
192 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, CaptchaParse); | 193 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, CaptchaParse); |
193 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, AccountDeletedError); | 194 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, AccountDeletedError); |
194 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, AccountDisabledError); | 195 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, AccountDisabledError); |
| 196 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, BadAuthenticationError); |
| 197 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, IncomprehensibleError); |
195 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ServiceUnavailableError); | 198 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ServiceUnavailableError); |
196 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, CheckNormalErrorCode); | 199 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, CheckNormalErrorCode); |
197 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, CheckTwoFactorResponse); | 200 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, CheckTwoFactorResponse); |
198 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, LoginNetFailure); | 201 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, LoginNetFailure); |
199 | 202 |
200 DISALLOW_COPY_AND_ASSIGN(GaiaAuthFetcher); | 203 DISALLOW_COPY_AND_ASSIGN(GaiaAuthFetcher); |
201 }; | 204 }; |
202 | 205 |
203 #endif // CHROME_COMMON_NET_GAIA_GAIA_AUTH_FETCHER_H_ | 206 #endif // CHROME_COMMON_NET_GAIA_GAIA_AUTH_FETCHER_H_ |
OLD | NEW |