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 3 // found in the LICENSE file. 4 5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_DELEGATE_H_ 6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_DELEGATE_H_ 7 8 #include "components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.h" 9 #include "net/base/proxy_delegate.h" 10 #include "url/gurl.h" 11 12 namespace net { 13 class HostPortPair; 14 class HttpRequestHeaders; 15 class HttpResponseHeaders; 16 class ProxyInfo; 17 class ProxyServer; 18 class ProxyService; 19 class URLRequest; 20 } 21 22 namespace data_reduction_proxy { 23 24 class DataReductionProxyAuthRequestHandler; 25 26 class DataReductionProxyDelegate : public net::ProxyDelegate { 27 public: 28 explicit DataReductionProxyDelegate( 29 DataReductionProxyAuthRequestHandler* auth_handler); 30 31 virtual ~DataReductionProxyDelegate(); 32 33 virtual void OnResolveProxy(const GURL& url, 34 int load_flags, 35 const net::ProxyService& proxy_service, 36 net::ProxyInfo* result) OVERRIDE; 37 38 virtual void OnFallback(const net::ProxyServer& bad_proxy, 39 int net_error) OVERRIDE; 40 41 virtual void OnBeforeSendHeaders(net::URLRequest* request, 42 const net::ProxyInfo& proxy_info, 43 net::HttpRequestHeaders* headers) OVERRIDE; 44 45 virtual void OnBeforeTunnelRequest( 46 const net::HostPortPair& proxy_server, 47 net::HttpRequestHeaders* extra_headers) OVERRIDE; 48 49 virtual void OnTunnelHeadersReceived( 50 const net::HostPortPair& origin, 51 const net::HostPortPair& proxy_server, 52 const net::HttpResponseHeaders& response_headers) OVERRIDE; 53 54 private: 55 DataReductionProxyAuthRequestHandler* auth_handler_; 56 57 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyDelegate); 58 }; 59 60 } // namespace data_reduction_proxy 61 62 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_DELEGATE_H_ 63