| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_BROWSER_CHROMEOS_LOGIN_OAUTH2_LOGIN_VERIFIER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_OAUTH2_LOGIN_VERIFIER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_OAUTH2_LOGIN_VERIFIER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_OAUTH2_LOGIN_VERIFIER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 17 #include "google_apis/gaia/gaia_auth_consumer.h" | 17 #include "google_apis/gaia/gaia_auth_consumer.h" |
| 18 #include "google_apis/gaia/gaia_auth_fetcher.h" | 18 #include "google_apis/gaia/gaia_auth_fetcher.h" |
| 19 #include "google_apis/gaia/oauth2_access_token_fetcher.h" | |
| 20 #include "google_apis/gaia/oauth2_token_service.h" | 19 #include "google_apis/gaia/oauth2_token_service.h" |
| 21 #include "net/url_request/url_request_context_getter.h" | 20 #include "net/url_request/url_request_context_getter.h" |
| 22 | 21 |
| 23 namespace chromeos { | 22 namespace chromeos { |
| 24 | 23 |
| 25 // Given the OAuth2 refresh token, this class will try to exchange it for GAIA | 24 // Given the OAuth2 refresh token, this class will try to exchange it for GAIA |
| 26 // credentials (SID+LSID) and populate current session's cookie jar. | 25 // credentials (SID+LSID) and populate current session's cookie jar. |
| 27 class OAuth2LoginVerifier : public base::SupportsWeakPtr<OAuth2LoginVerifier>, | 26 class OAuth2LoginVerifier : public base::SupportsWeakPtr<OAuth2LoginVerifier>, |
| 28 public GaiaAuthConsumer, | 27 public GaiaAuthConsumer, |
| 29 public OAuth2TokenService::Consumer { | 28 public OAuth2TokenService::Consumer { |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 scoped_ptr<OAuth2TokenService::Request> login_token_request_; | 119 scoped_ptr<OAuth2TokenService::Request> login_token_request_; |
| 121 // The retry counter. Increment this only when failure happened. | 120 // The retry counter. Increment this only when failure happened. |
| 122 int retry_count_; | 121 int retry_count_; |
| 123 | 122 |
| 124 DISALLOW_COPY_AND_ASSIGN(OAuth2LoginVerifier); | 123 DISALLOW_COPY_AND_ASSIGN(OAuth2LoginVerifier); |
| 125 }; | 124 }; |
| 126 | 125 |
| 127 } // namespace chromeos | 126 } // namespace chromeos |
| 128 | 127 |
| 129 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_OAUTH2_LOGIN_VERIFIER_H_ | 128 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_OAUTH2_LOGIN_VERIFIER_H_ |
| OLD | NEW |