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 <memory> |
8 #include <string> | 9 #include <string> |
9 #include <vector> | 10 #include <vector> |
10 | 11 |
11 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
12 #include "base/macros.h" | 13 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | |
14 #include "google_apis/gaia/gaia_auth_consumer.h" | 14 #include "google_apis/gaia/gaia_auth_consumer.h" |
15 #include "google_apis/gaia/google_service_auth_error.h" | 15 #include "google_apis/gaia/google_service_auth_error.h" |
16 #include "net/url_request/url_fetcher_delegate.h" | 16 #include "net/url_request/url_fetcher_delegate.h" |
17 #include "url/gurl.h" | 17 #include "url/gurl.h" |
18 | 18 |
19 // Authenticate a user against the Google Accounts ClientLogin API | 19 // Authenticate a user against the Google Accounts ClientLogin API |
20 // with various capabilities and return results to a GaiaAuthConsumer. | 20 // with various capabilities and return results to a GaiaAuthConsumer. |
21 // | 21 // |
22 // In the future, we will also issue auth tokens from this class. | 22 // In the future, we will also issue auth tokens from this class. |
23 // This class should be used on a single thread, but it can be whichever thread | 23 // This class should be used on a single thread, but it can be whichever thread |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 const GURL get_user_info_gurl_; | 439 const GURL get_user_info_gurl_; |
440 const GURL merge_session_gurl_; | 440 const GURL merge_session_gurl_; |
441 const GURL uberauth_token_gurl_; | 441 const GURL uberauth_token_gurl_; |
442 const GURL oauth_login_gurl_; | 442 const GURL oauth_login_gurl_; |
443 const GURL list_accounts_gurl_; | 443 const GURL list_accounts_gurl_; |
444 const GURL logout_gurl_; | 444 const GURL logout_gurl_; |
445 const GURL get_check_connection_info_url_; | 445 const GURL get_check_connection_info_url_; |
446 const GURL oauth2_iframe_url_; | 446 const GURL oauth2_iframe_url_; |
447 | 447 |
448 // While a fetch is going on: | 448 // While a fetch is going on: |
449 scoped_ptr<net::URLFetcher> fetcher_; | 449 std::unique_ptr<net::URLFetcher> fetcher_; |
450 GURL client_login_to_oauth2_gurl_; | 450 GURL client_login_to_oauth2_gurl_; |
451 std::string request_body_; | 451 std::string request_body_; |
452 std::string requested_service_; | 452 std::string requested_service_; |
453 bool fetch_pending_ = false; | 453 bool fetch_pending_ = false; |
454 bool fetch_token_from_auth_code_ = false; | 454 bool fetch_token_from_auth_code_ = false; |
455 | 455 |
456 // Headers used during the Logout call. | 456 // Headers used during the Logout call. |
457 std::string logout_headers_; | 457 std::string logout_headers_; |
458 | 458 |
459 friend class GaiaAuthFetcherTest; | 459 friend class GaiaAuthFetcherTest; |
(...skipping 11 matching lines...) Expand all Loading... |
471 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ParseOAuth2TokenPairResponse); | 471 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ParseOAuth2TokenPairResponse); |
472 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ClientOAuthSuccess); | 472 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ClientOAuthSuccess); |
473 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ClientOAuthWithQuote); | 473 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ClientOAuthWithQuote); |
474 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ClientOAuthChallengeSuccess); | 474 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ClientOAuthChallengeSuccess); |
475 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ClientOAuthChallengeQuote); | 475 FRIEND_TEST_ALL_PREFIXES(GaiaAuthFetcherTest, ClientOAuthChallengeQuote); |
476 | 476 |
477 DISALLOW_COPY_AND_ASSIGN(GaiaAuthFetcher); | 477 DISALLOW_COPY_AND_ASSIGN(GaiaAuthFetcher); |
478 }; | 478 }; |
479 | 479 |
480 #endif // GOOGLE_APIS_GAIA_GAIA_AUTH_FETCHER_H_ | 480 #endif // GOOGLE_APIS_GAIA_GAIA_AUTH_FETCHER_H_ |
OLD | NEW |