OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_ACCESS_TOKEN_FETCHER_IMPL_H_ | 5 #ifndef GOOGLE_APIS_GAIA_OAUTH2_ACCESS_TOKEN_FETCHER_IMPL_H_ |
6 #define GOOGLE_APIS_GAIA_OAUTH2_ACCESS_TOKEN_FETCHER_IMPL_H_ | 6 #define GOOGLE_APIS_GAIA_OAUTH2_ACCESS_TOKEN_FETCHER_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 public net::URLFetcherDelegate { | 49 public net::URLFetcherDelegate { |
50 public: | 50 public: |
51 OAuth2AccessTokenFetcherImpl(OAuth2AccessTokenConsumer* consumer, | 51 OAuth2AccessTokenFetcherImpl(OAuth2AccessTokenConsumer* consumer, |
52 net::URLRequestContextGetter* getter, | 52 net::URLRequestContextGetter* getter, |
53 const std::string& refresh_token); | 53 const std::string& refresh_token); |
54 virtual ~OAuth2AccessTokenFetcherImpl(); | 54 virtual ~OAuth2AccessTokenFetcherImpl(); |
55 | 55 |
56 // Implementation of OAuth2AccessTokenFetcher | 56 // Implementation of OAuth2AccessTokenFetcher |
57 virtual void Start(const std::string& client_id, | 57 virtual void Start(const std::string& client_id, |
58 const std::string& client_secret, | 58 const std::string& client_secret, |
59 const std::vector<std::string>& scopes) OVERRIDE; | 59 const std::vector<std::string>& scopes) override; |
60 | 60 |
61 virtual void CancelRequest() OVERRIDE; | 61 virtual void CancelRequest() override; |
62 | 62 |
63 // Implementation of net::URLFetcherDelegate | 63 // Implementation of net::URLFetcherDelegate |
64 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; | 64 virtual void OnURLFetchComplete(const net::URLFetcher* source) override; |
65 | 65 |
66 private: | 66 private: |
67 enum State { | 67 enum State { |
68 INITIAL, | 68 INITIAL, |
69 GET_ACCESS_TOKEN_STARTED, | 69 GET_ACCESS_TOKEN_STARTED, |
70 GET_ACCESS_TOKEN_DONE, | 70 GET_ACCESS_TOKEN_DONE, |
71 ERROR_STATE, | 71 ERROR_STATE, |
72 }; | 72 }; |
73 | 73 |
74 // Helper methods for the flow. | 74 // Helper methods for the flow. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 friend class OAuth2AccessTokenFetcherImplTest; | 109 friend class OAuth2AccessTokenFetcherImplTest; |
110 FRIEND_TEST_ALL_PREFIXES(OAuth2AccessTokenFetcherImplTest, | 110 FRIEND_TEST_ALL_PREFIXES(OAuth2AccessTokenFetcherImplTest, |
111 ParseGetAccessTokenResponse); | 111 ParseGetAccessTokenResponse); |
112 FRIEND_TEST_ALL_PREFIXES(OAuth2AccessTokenFetcherImplTest, | 112 FRIEND_TEST_ALL_PREFIXES(OAuth2AccessTokenFetcherImplTest, |
113 MakeGetAccessTokenBody); | 113 MakeGetAccessTokenBody); |
114 | 114 |
115 DISALLOW_COPY_AND_ASSIGN(OAuth2AccessTokenFetcherImpl); | 115 DISALLOW_COPY_AND_ASSIGN(OAuth2AccessTokenFetcherImpl); |
116 }; | 116 }; |
117 | 117 |
118 #endif // GOOGLE_APIS_GAIA_OAUTH2_ACCESS_TOKEN_FETCHER_IMPL_H_ | 118 #endif // GOOGLE_APIS_GAIA_OAUTH2_ACCESS_TOKEN_FETCHER_IMPL_H_ |
OLD | NEW |