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 12namespace net { 13class HostPortPair; 14class HttpRequestHeaders; 15class HttpResponseHeaders; 16class ProxyInfo; 17class ProxyServer; 18class ProxyService; 19class URLRequest; 20} 21 22namespace data_reduction_proxy { 23 24class DataReductionProxyAuthRequestHandler; 25 26class 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