| 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_OAUTH2_API_CALL_FLOW_H_ | 5 #ifndef CHROME_COMMON_NET_GAIA_OAUTH2_API_CALL_FLOW_H_ |
| 6 #define CHROME_COMMON_NET_GAIA_OAUTH2_API_CALL_FLOW_H_ | 6 #define CHROME_COMMON_NET_GAIA_OAUTH2_API_CALL_FLOW_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // the first step (of trying an existing access token). | 43 // the first step (of trying an existing access token). |
| 44 OAuth2ApiCallFlow( | 44 OAuth2ApiCallFlow( |
| 45 net::URLRequestContextGetter* context, | 45 net::URLRequestContextGetter* context, |
| 46 const std::string& refresh_token, | 46 const std::string& refresh_token, |
| 47 const std::string& access_token, | 47 const std::string& access_token, |
| 48 const std::vector<std::string>& scopes); | 48 const std::vector<std::string>& scopes); |
| 49 | 49 |
| 50 virtual ~OAuth2ApiCallFlow(); | 50 virtual ~OAuth2ApiCallFlow(); |
| 51 | 51 |
| 52 // Start the flow. | 52 // Start the flow. |
| 53 void Start(); | 53 virtual void Start(); |
| 54 | 54 |
| 55 // OAuth2AccessTokenFetcher implementation. | 55 // OAuth2AccessTokenFetcher implementation. |
| 56 virtual void OnGetTokenSuccess(const std::string& access_token) OVERRIDE; | 56 virtual void OnGetTokenSuccess(const std::string& access_token) OVERRIDE; |
| 57 virtual void OnGetTokenFailure(const GoogleServiceAuthError& error) OVERRIDE; | 57 virtual void OnGetTokenFailure(const GoogleServiceAuthError& error) OVERRIDE; |
| 58 | 58 |
| 59 // content::URLFetcherDelegate implementation. | 59 // content::URLFetcherDelegate implementation. |
| 60 virtual void OnURLFetchComplete(const content::URLFetcher* source) OVERRIDE; | 60 virtual void OnURLFetchComplete(const content::URLFetcher* source) OVERRIDE; |
| 61 | 61 |
| 62 protected: | 62 protected: |
| 63 // Template methods for sub-classes. | 63 // Template methods for sub-classes. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // Whether we have already tried minting an access token once. | 117 // Whether we have already tried minting an access token once. |
| 118 bool tried_mint_access_token_; | 118 bool tried_mint_access_token_; |
| 119 | 119 |
| 120 scoped_ptr<content::URLFetcher> url_fetcher_; | 120 scoped_ptr<content::URLFetcher> url_fetcher_; |
| 121 scoped_ptr<OAuth2AccessTokenFetcher> oauth2_access_token_fetcher_; | 121 scoped_ptr<OAuth2AccessTokenFetcher> oauth2_access_token_fetcher_; |
| 122 | 122 |
| 123 DISALLOW_COPY_AND_ASSIGN(OAuth2ApiCallFlow); | 123 DISALLOW_COPY_AND_ASSIGN(OAuth2ApiCallFlow); |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 #endif // CHROME_COMMON_NET_GAIA_OAUTH2_API_CALL_FLOW_H_ | 126 #endif // CHROME_COMMON_NET_GAIA_OAUTH2_API_CALL_FLOW_H_ |
| OLD | NEW |