| 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 GOOGLE_APIS_GAIA_GAIA_AUTH_FETCHER_H_ | 5 #ifndef GOOGLE_APIS_GAIA_GAIA_AUTH_FETCHER_H_ |
| 6 #define GOOGLE_APIS_GAIA_GAIA_AUTH_FETCHER_H_ | 6 #define GOOGLE_APIS_GAIA_GAIA_AUTH_FETCHER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 static std::string MakeGetTokenResponseBody(const std::string& scopes, | 404 static std::string MakeGetTokenResponseBody(const std::string& scopes, |
| 405 const std::string& domain, | 405 const std::string& domain, |
| 406 const std::string& login_hint); | 406 const std::string& login_hint); |
| 407 | 407 |
| 408 // Create a fetcher usable for making any Gaia request. |body| is used | 408 // Create a fetcher usable for making any Gaia request. |body| is used |
| 409 // as the body of the POST request sent to GAIA. Any strings listed in | 409 // as the body of the POST request sent to GAIA. Any strings listed in |
| 410 // |headers| are added as extra HTTP headers in the request. | 410 // |headers| are added as extra HTTP headers in the request. |
| 411 // | 411 // |
| 412 // |load_flags| are passed to directly to net::URLFetcher::Create() when | 412 // |load_flags| are passed to directly to net::URLFetcher::Create() when |
| 413 // creating the URL fetcher. | 413 // creating the URL fetcher. |
| 414 static net::URLFetcher* CreateGaiaFetcher( | 414 static scoped_ptr<net::URLFetcher> CreateGaiaFetcher( |
| 415 net::URLRequestContextGetter* getter, | 415 net::URLRequestContextGetter* getter, |
| 416 const std::string& body, | 416 const std::string& body, |
| 417 const std::string& headers, | 417 const std::string& headers, |
| 418 const GURL& gaia_gurl, | 418 const GURL& gaia_gurl, |
| 419 int load_flags, | 419 int load_flags, |
| 420 net::URLFetcherDelegate* delegate); | 420 net::URLFetcherDelegate* delegate); |
| 421 | 421 |
| 422 // From a URLFetcher result, generate an appropriate error. | 422 // From a URLFetcher result, generate an appropriate error. |
| 423 // From the API documentation, both IssueAuthToken and ClientLogin have | 423 // From the API documentation, both IssueAuthToken and ClientLogin have |
| 424 // the same error returns. | 424 // the same error returns. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ParseOAuth2TokenPairResponse); | 464 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ParseOAuth2TokenPairResponse); |
| 465 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ClientOAuthSuccess); | 465 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ClientOAuthSuccess); |
| 466 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ClientOAuthWithQuote); | 466 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ClientOAuthWithQuote); |
| 467 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ClientOAuthChallengeSuccess); | 467 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ClientOAuthChallengeSuccess); |
| 468 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ClientOAuthChallengeQuote); | 468 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ClientOAuthChallengeQuote); |
| 469 | 469 |
| 470 DISALLOW_COPY_AND_ASSIGN(GaiaAuthFetcher); | 470 DISALLOW_COPY_AND_ASSIGN(GaiaAuthFetcher); |
| 471 }; | 471 }; |
| 472 | 472 |
| 473 #endif // GOOGLE_APIS_GAIA_GAIA_AUTH_FETCHER_H_ | 473 #endif // GOOGLE_APIS_GAIA_GAIA_AUTH_FETCHER_H_ |
| OLD | NEW |