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_OAUTH2_API_CALL_FLOW_H_ | 5 #ifndef GOOGLE_APIS_GAIA_OAUTH2_API_CALL_FLOW_H_ |
6 #define GOOGLE_APIS_GAIA_OAUTH2_API_CALL_FLOW_H_ | 6 #define GOOGLE_APIS_GAIA_OAUTH2_API_CALL_FLOW_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "net/url_request/url_fetcher.h" | 12 #include "net/url_request/url_fetcher.h" |
13 #include "net/url_request/url_fetcher_delegate.h" | 13 #include "net/url_request/url_fetcher_delegate.h" |
14 #include "url/gurl.h" | 14 #include "url/gurl.h" |
15 | 15 |
16 class GoogleServiceAuthError; | |
17 class OAuth2MintTokenFlowTest; | |
18 | |
19 namespace net { | 16 namespace net { |
20 class URLFetcher; | 17 class URLFetcher; |
21 class URLRequestContextGetter; | 18 class URLRequestContextGetter; |
22 } | 19 } |
23 | 20 |
24 // Base class for all classes that implement a flow to call OAuth2 enabled APIs, | 21 // Base class for all classes that implement a flow to call OAuth2 enabled APIs, |
25 // given an access token to the service. This class abstracts the basic steps | 22 // given an access token to the service. This class abstracts the basic steps |
26 // and exposes template methods for sub-classes to implement for API specific | 23 // and exposes template methods for sub-classes to implement for API specific |
27 // details. | 24 // details. |
28 class OAuth2ApiCallFlow : public net::URLFetcherDelegate { | 25 class OAuth2ApiCallFlow : public net::URLFetcherDelegate { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 void BeginApiCall(); | 75 void BeginApiCall(); |
79 void EndApiCall(const net::URLFetcher* source); | 76 void EndApiCall(const net::URLFetcher* source); |
80 | 77 |
81 State state_; | 78 State state_; |
82 std::unique_ptr<net::URLFetcher> url_fetcher_; | 79 std::unique_ptr<net::URLFetcher> url_fetcher_; |
83 | 80 |
84 DISALLOW_COPY_AND_ASSIGN(OAuth2ApiCallFlow); | 81 DISALLOW_COPY_AND_ASSIGN(OAuth2ApiCallFlow); |
85 }; | 82 }; |
86 | 83 |
87 #endif // GOOGLE_APIS_GAIA_OAUTH2_API_CALL_FLOW_H_ | 84 #endif // GOOGLE_APIS_GAIA_OAUTH2_API_CALL_FLOW_H_ |
OLD | NEW |