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_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_AUTH_REQUES
T_HANDLER_H_ | 5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_AUTH_REQUES
T_HANDLER_H_ |
6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_AUTH_REQUES
T_HANDLER_H_ | 6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_AUTH_REQUES
T_HANDLER_H_ |
7 | 7 |
8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
12 #include "url/gurl.h" | 12 #include "url/gurl.h" |
13 | 13 |
14 namespace net { | 14 namespace net { |
15 class HttpRequestHeaders; | 15 class HttpRequestHeaders; |
16 class HttpResponseHeaders; | 16 class HttpResponseHeaders; |
17 class ProxyServer; | 17 class ProxyServer; |
18 class URLRequest; | 18 class URLRequest; |
19 } | 19 } |
20 | 20 |
21 namespace data_reduction_proxy { | 21 namespace data_reduction_proxy { |
22 | 22 |
23 extern const char kProtocolVersion[]; | |
24 | |
25 extern const char kClientAndroidWebview[]; | 23 extern const char kClientAndroidWebview[]; |
26 extern const char kClientChromeAndroid[]; | 24 extern const char kClientChromeAndroid[]; |
27 extern const char kClientChromeIOS[]; | 25 extern const char kClientChromeIOS[]; |
28 | 26 |
29 class DataReductionProxyParams; | 27 class DataReductionProxyParams; |
30 | 28 |
31 class DataReductionProxyAuthRequestHandler { | 29 class DataReductionProxyAuthRequestHandler { |
32 public: | 30 public: |
33 static bool IsKeySetOnCommandLine(); | 31 static bool IsKeySetOnCommandLine(); |
34 | 32 |
35 // Constructs an authentication request handler. | 33 // Constructs an authentication request handler. |
36 explicit DataReductionProxyAuthRequestHandler( | 34 explicit DataReductionProxyAuthRequestHandler( |
37 DataReductionProxyParams* params); | 35 DataReductionProxyParams* params, |
| 36 const std::string& version); |
38 | 37 |
39 virtual ~DataReductionProxyAuthRequestHandler(); | 38 virtual ~DataReductionProxyAuthRequestHandler(); |
40 | 39 |
41 // Adds a 'Chrome-Proxy' header to |request_headers| with the data reduction | 40 // Adds a 'Chrome-Proxy' header to |request_headers| with the data reduction |
42 // proxy authentication credentials. Only adds this header if the provided | 41 // proxy authentication credentials. Only adds this header if the provided |
43 // |proxy_server| is a data reduction proxy. | 42 // |proxy_server| is a data reduction proxy. |
44 void MaybeAddRequestHeader(net::URLRequest* request, | 43 void MaybeAddRequestHeader(net::URLRequest* request, |
45 const net::ProxyServer& proxy_server, | 44 const net::ProxyServer& proxy_server, |
46 net::HttpRequestHeaders* request_headers); | 45 net::HttpRequestHeaders* request_headers); |
47 | 46 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 std::string client_; | 88 std::string client_; |
90 std::string version_; | 89 std::string version_; |
91 | 90 |
92 DataReductionProxyParams* data_reduction_proxy_params_; | 91 DataReductionProxyParams* data_reduction_proxy_params_; |
93 | 92 |
94 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyAuthRequestHandler); | 93 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyAuthRequestHandler); |
95 }; | 94 }; |
96 | 95 |
97 } // namespace data_reduction_proxy | 96 } // namespace data_reduction_proxy |
98 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_AUTH_REQ
UEST_HANDLER_H_ | 97 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_AUTH_REQ
UEST_HANDLER_H_ |
OLD | NEW |