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 #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 #include <vector> | 10 #include <vector> |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 // ClientLogin-style service tokens. The response to this request is the | 163 // ClientLogin-style service tokens. The response to this request is the |
164 // same as the response to a ClientLogin request, except that captcha | 164 // same as the response to a ClientLogin request, except that captcha |
165 // challenges are never issued. | 165 // challenges are never issued. |
166 // | 166 // |
167 // Either OnClientLoginSuccess or OnClientLoginFailure will be | 167 // Either OnClientLoginSuccess or OnClientLoginFailure will be |
168 // called on the consumer on the original thread. | 168 // called on the consumer on the original thread. |
169 void StartOAuthLogin(const std::string& access_token, | 169 void StartOAuthLogin(const std::string& access_token, |
170 const std::string& service); | 170 const std::string& service); |
171 | 171 |
172 // Implementation of content::URLFetcherDelegate | 172 // Implementation of content::URLFetcherDelegate |
173 virtual void OnURLFetchComplete(const content::URLFetcher* source) OVERRIDE; | 173 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; |
174 | 174 |
175 // StartClientLogin been called && results not back yet? | 175 // StartClientLogin been called && results not back yet? |
176 bool HasPendingFetch(); | 176 bool HasPendingFetch(); |
177 | 177 |
178 // Stop any URL fetches in progress. | 178 // Stop any URL fetches in progress. |
179 void CancelRequest(); | 179 void CancelRequest(); |
180 | 180 |
181 // From a URLFetcher result, generate an appropriate error. | 181 // From a URLFetcher result, generate an appropriate error. |
182 // From the API documentation, both IssueAuthToken and ClientLogin have | 182 // From the API documentation, both IssueAuthToken and ClientLogin have |
183 // the same error returns. | 183 // the same error returns. |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, | 421 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, |
422 ParseClientLoginToOAuth2Response); | 422 ParseClientLoginToOAuth2Response); |
423 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ParseOAuth2TokenPairResponse); | 423 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ParseOAuth2TokenPairResponse); |
424 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ClientOAuthSuccess); | 424 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ClientOAuthSuccess); |
425 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ClientOAuthChallengeSuccess); | 425 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ClientOAuthChallengeSuccess); |
426 | 426 |
427 DISALLOW_COPY_AND_ASSIGN(GaiaAuthFetcher); | 427 DISALLOW_COPY_AND_ASSIGN(GaiaAuthFetcher); |
428 }; | 428 }; |
429 | 429 |
430 #endif // CHROME_COMMON_NET_GAIA_GAIA_AUTH_FETCHER_H_ | 430 #endif // CHROME_COMMON_NET_GAIA_GAIA_AUTH_FETCHER_H_ |
OLD | NEW |