| 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 COMPONENTS_SIGNIN_CORE_BROWSER_REFRESH_TOKEN_ANNOTATION_REQUEST_H_ | 5 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_REFRESH_TOKEN_ANNOTATION_REQUEST_H_ |
| 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_REFRESH_TOKEN_ANNOTATION_REQUEST_H_ | 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_REFRESH_TOKEN_ANNOTATION_REQUEST_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 const std::string& access_token, | 52 const std::string& access_token, |
| 53 const base::Time& expiration_time) override; | 53 const base::Time& expiration_time) override; |
| 54 void OnGetTokenFailure(const OAuth2TokenService::Request* request, | 54 void OnGetTokenFailure(const OAuth2TokenService::Request* request, |
| 55 const GoogleServiceAuthError& error) override; | 55 const GoogleServiceAuthError& error) override; |
| 56 | 56 |
| 57 // OAuth2ApiCallFlow implementation. | 57 // OAuth2ApiCallFlow implementation. |
| 58 GURL CreateApiCallUrl() override; | 58 GURL CreateApiCallUrl() override; |
| 59 std::string CreateApiCallBody() override; | 59 std::string CreateApiCallBody() override; |
| 60 void ProcessApiCallSuccess(const net::URLFetcher* source) override; | 60 void ProcessApiCallSuccess(const net::URLFetcher* source) override; |
| 61 void ProcessApiCallFailure(const net::URLFetcher* source) override; | 61 void ProcessApiCallFailure(const net::URLFetcher* source) override; |
| 62 net::PartialNetworkTrafficAnnotationTag GetNetworkTrafficAnnotationTag() |
| 63 override; |
| 62 | 64 |
| 63 private: | 65 private: |
| 64 FRIEND_TEST_ALL_PREFIXES(RefreshTokenAnnotationRequestTest, ShouldSendNow); | 66 FRIEND_TEST_ALL_PREFIXES(RefreshTokenAnnotationRequestTest, ShouldSendNow); |
| 65 FRIEND_TEST_ALL_PREFIXES(RefreshTokenAnnotationRequestTest, | 67 FRIEND_TEST_ALL_PREFIXES(RefreshTokenAnnotationRequestTest, |
| 66 CreateApiCallBody); | 68 CreateApiCallBody); |
| 67 | 69 |
| 68 RefreshTokenAnnotationRequest( | 70 RefreshTokenAnnotationRequest( |
| 69 const scoped_refptr<net::URLRequestContextGetter>& request_context_getter, | 71 const scoped_refptr<net::URLRequestContextGetter>& request_context_getter, |
| 70 const std::string& product_version, | 72 const std::string& product_version, |
| 71 const std::string& device_id, | 73 const std::string& device_id, |
| 72 const std::string& client_id, | 74 const std::string& client_id, |
| 73 const base::Closure& request_callback); | 75 const base::Closure& request_callback); |
| 74 | 76 |
| 75 static bool ShouldSendNow(PrefService* pref_service); | 77 static bool ShouldSendNow(PrefService* pref_service); |
| 76 void RequestAccessToken(OAuth2TokenService* token_service, | 78 void RequestAccessToken(OAuth2TokenService* token_service, |
| 77 const std::string& account_id); | 79 const std::string& account_id); |
| 78 | 80 |
| 79 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; | 81 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; |
| 80 std::string product_version_; | 82 std::string product_version_; |
| 81 std::string device_id_; | 83 std::string device_id_; |
| 82 std::string client_id_; | 84 std::string client_id_; |
| 83 base::Closure request_callback_; | 85 base::Closure request_callback_; |
| 84 | 86 |
| 85 std::unique_ptr<OAuth2TokenService::Request> access_token_request_; | 87 std::unique_ptr<OAuth2TokenService::Request> access_token_request_; |
| 86 | 88 |
| 87 DISALLOW_COPY_AND_ASSIGN(RefreshTokenAnnotationRequest); | 89 DISALLOW_COPY_AND_ASSIGN(RefreshTokenAnnotationRequest); |
| 88 }; | 90 }; |
| 89 | 91 |
| 90 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_REFRESH_TOKEN_ANNOTATION_REQUEST_H_ | 92 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_REFRESH_TOKEN_ANNOTATION_REQUEST_H_ |
| OLD | NEW |