| 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 SERVICES_AUTHENTICATING_URL_LOADER_AUTHENTICATING_URL_LOADER_IMPL_H_ | 5 #ifndef SERVICES_AUTHENTICATING_URL_LOADER_AUTHENTICATING_URL_LOADER_IMPL_H_ |
| 6 #define SERVICES_AUTHENTICATING_URL_LOADER_AUTHENTICATING_URL_LOADER_IMPL_H_ | 6 #define SERVICES_AUTHENTICATING_URL_LOADER_AUTHENTICATING_URL_LOADER_IMPL_H_ |
| 7 | 7 |
| 8 #include "mojo/public/cpp/bindings/binding.h" | 8 #include "mojo/public/cpp/bindings/binding.h" |
| 9 #include "mojo/public/cpp/bindings/error_handler.h" | 9 #include "mojo/public/cpp/bindings/error_handler.h" |
| 10 #include "mojo/services/authenticating_url_loader/public/interfaces/authenticati
ng_url_loader.mojom.h" | 10 #include "mojo/services/authenticating_url_loader/public/interfaces/authenticati
ng_url_loader.mojom.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 connection_error_callback); | 32 connection_error_callback); |
| 33 ~AuthenticatingURLLoaderImpl() override; | 33 ~AuthenticatingURLLoaderImpl() override; |
| 34 | 34 |
| 35 void SetAuthenticationService( | 35 void SetAuthenticationService( |
| 36 authentication::AuthenticationService* authentication_service); | 36 authentication::AuthenticationService* authentication_service); |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 // AuthenticatingURLLoader methods: | 39 // AuthenticatingURLLoader methods: |
| 40 void Start(URLRequestPtr request, | 40 void Start(URLRequestPtr request, |
| 41 const Callback<void(URLResponsePtr)>& callback) override; | 41 const Callback<void(URLResponsePtr)>& callback) override; |
| 42 void FollowRedirect(const Callback<void(URLResponsePtr)>& callback) override; |
| 42 | 43 |
| 43 // ErrorHandler methods: | 44 // ErrorHandler methods: |
| 44 void OnConnectionError() override; | 45 void OnConnectionError() override; |
| 45 | 46 |
| 46 void StartNetworkRequest(URLRequestPtr request); | 47 void StartNetworkRequest(URLRequestPtr request); |
| 47 | 48 |
| 48 void OnLoadComplete(URLResponsePtr response); | 49 void OnLoadComplete(URLResponsePtr response); |
| 49 | 50 |
| 51 void FollowRedirectInternal(); |
| 52 |
| 50 void OnAccountSelected(String username, String error); | 53 void OnAccountSelected(String username, String error); |
| 51 | 54 |
| 52 void OnOAuth2TokenReceived(String token, String error); | 55 void OnOAuth2TokenReceived(String token, String error); |
| 53 | 56 |
| 54 Binding<AuthenticatingURLLoader> binding_; | 57 Binding<AuthenticatingURLLoader> binding_; |
| 55 authentication::AuthenticationService* authentication_service_; | 58 authentication::AuthenticationService* authentication_service_; |
| 56 NetworkService* network_service_; | 59 NetworkService* network_service_; |
| 57 Callback<void(AuthenticatingURLLoaderImpl*)> connection_error_callback_; | 60 Callback<void(AuthenticatingURLLoaderImpl*)> connection_error_callback_; |
| 58 URLLoaderPtr url_loader_; | 61 URLLoaderPtr url_loader_; |
| 59 URLResponsePtr pending_response_; | 62 URLResponsePtr pending_response_; |
| 60 RequestAuthorizationState request_authorization_state_; | 63 RequestAuthorizationState request_authorization_state_; |
| 61 String url_; | 64 String url_; |
| 62 bool auto_follow_redirects_; | 65 bool auto_follow_redirects_; |
| 63 bool bypass_cache_; | 66 bool bypass_cache_; |
| 64 Array<String> headers_; | 67 Array<String> headers_; |
| 65 String username_; | 68 String username_; |
| 66 String token_; | 69 String token_; |
| 67 Callback<void(URLResponsePtr)> pending_start_callback_; | 70 Callback<void(URLResponsePtr)> pending_request_callback_; |
| 68 }; | 71 }; |
| 69 | 72 |
| 70 } // namespace mojo | 73 } // namespace mojo |
| 71 | 74 |
| 72 #endif // SERVICES_AUTHENTICATING_URL_LOADER_AUTHENTICATING_URL_LOADER_IMPL_H_ | 75 #endif // SERVICES_AUTHENTICATING_URL_LOADER_AUTHENTICATING_URL_LOADER_IMPL_H_ |
| OLD | NEW |