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_UBERTOKEN_FETCHER_H_ | 5 #ifndef GOOGLE_APIS_GAIA_UBERTOKEN_FETCHER_H_ |
6 #define GOOGLE_APIS_GAIA_UBERTOKEN_FETCHER_H_ | 6 #define GOOGLE_APIS_GAIA_UBERTOKEN_FETCHER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 // | 21 // |
22 // This class can handle one request at a time. | 22 // This class can handle one request at a time. |
23 | 23 |
24 class GaiaAuthFetcher; | 24 class GaiaAuthFetcher; |
25 class GoogleServiceAuthError; | 25 class GoogleServiceAuthError; |
26 | 26 |
27 namespace net { | 27 namespace net { |
28 class URLRequestContextGetter; | 28 class URLRequestContextGetter; |
29 } | 29 } |
30 | 30 |
31 typedef base::Callback<GaiaAuthFetcher*(GaiaAuthConsumer*, | 31 using GaiaAuthFetcherFactory = base::Callback<std::unique_ptr<GaiaAuthFetcher>( |
32 const std::string&, | 32 GaiaAuthConsumer*, |
33 net::URLRequestContextGetter*)> | 33 const std::string&, |
34 GaiaAuthFetcherFactory; | 34 net::URLRequestContextGetter*)>; |
35 | 35 |
36 // Callback for the |UbertokenFetcher| class. | 36 // Callback for the |UbertokenFetcher| class. |
37 class UbertokenConsumer { | 37 class UbertokenConsumer { |
38 public: | 38 public: |
39 UbertokenConsumer() {} | 39 UbertokenConsumer() {} |
40 virtual ~UbertokenConsumer() {} | 40 virtual ~UbertokenConsumer() {} |
41 virtual void OnUbertokenSuccess(const std::string& token) {} | 41 virtual void OnUbertokenSuccess(const std::string& token) {} |
42 virtual void OnUbertokenFailure(const GoogleServiceAuthError& error) {} | 42 virtual void OnUbertokenFailure(const GoogleServiceAuthError& error) {} |
43 }; | 43 }; |
44 | 44 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 std::string account_id_; | 93 std::string account_id_; |
94 std::string access_token_; | 94 std::string access_token_; |
95 int retry_number_; | 95 int retry_number_; |
96 base::OneShotTimer retry_timer_; | 96 base::OneShotTimer retry_timer_; |
97 bool second_access_token_request_; | 97 bool second_access_token_request_; |
98 | 98 |
99 DISALLOW_COPY_AND_ASSIGN(UbertokenFetcher); | 99 DISALLOW_COPY_AND_ASSIGN(UbertokenFetcher); |
100 }; | 100 }; |
101 | 101 |
102 #endif // GOOGLE_APIS_GAIA_UBERTOKEN_FETCHER_H_ | 102 #endif // GOOGLE_APIS_GAIA_UBERTOKEN_FETCHER_H_ |
OLD | NEW |