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.
5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_DELEGATE_H_
6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_DELEGATE_H_
8 #include "components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.h"
9 #include "net/base/proxy_delegate.h"
14 class HttpRequestHeaders
;
15 class HttpResponseHeaders
;
22 namespace data_reduction_proxy
{
24 class DataReductionProxyAuthRequestHandler
;
26 class DataReductionProxyDelegate
: public net::ProxyDelegate
{
28 explicit DataReductionProxyDelegate(
29 DataReductionProxyAuthRequestHandler
* auth_handler
);
31 virtual ~DataReductionProxyDelegate();
33 virtual void OnResolveProxy(const GURL
& url
,
35 const net::ProxyService
& proxy_service
,
36 net::ProxyInfo
* result
) override
;
38 virtual void OnFallback(const net::ProxyServer
& bad_proxy
,
39 int net_error
) override
;
41 virtual void OnBeforeSendHeaders(net::URLRequest
* request
,
42 const net::ProxyInfo
& proxy_info
,
43 net::HttpRequestHeaders
* headers
) override
;
45 virtual void OnBeforeTunnelRequest(
46 const net::HostPortPair
& proxy_server
,
47 net::HttpRequestHeaders
* extra_headers
) override
;
49 virtual void OnTunnelHeadersReceived(
50 const net::HostPortPair
& origin
,
51 const net::HostPortPair
& proxy_server
,
52 const net::HttpResponseHeaders
& response_headers
) override
;
55 DataReductionProxyAuthRequestHandler
* auth_handler_
;
57 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyDelegate
);
60 } // namespace data_reduction_proxy
62 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_DELEGATE_H_