| 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 CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_CONFIGURATOR_H_ | 5 #ifndef CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_CONFIGURATOR_H_ |
| 6 #define CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_CONFIGURATOR_H_ | 6 #define CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_CONFIGURATOR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
| 12 #include "components/data_reduction_proxy/browser/data_reduction_proxy_configura
tor.h" | 12 #include "components/data_reduction_proxy/browser/data_reduction_proxy_configura
tor.h" |
| 13 | 13 |
| 14 class PrefService; | 14 class PrefService; |
| 15 | 15 |
| 16 class DataReductionProxyChromeConfigurator | 16 class DataReductionProxyChromeConfigurator |
| 17 : public data_reduction_proxy::DataReductionProxyConfigurator { | 17 : public data_reduction_proxy::DataReductionProxyConfigurator { |
| 18 public: | 18 public: |
| 19 explicit DataReductionProxyChromeConfigurator(PrefService* prefs); | 19 explicit DataReductionProxyChromeConfigurator(PrefService* prefs); |
| 20 virtual ~DataReductionProxyChromeConfigurator(); | 20 virtual ~DataReductionProxyChromeConfigurator(); |
| 21 | 21 |
| 22 virtual void Enable(bool primary_restricted, | 22 virtual void Enable(bool primary_restricted, |
| 23 bool fallback_restricted, | 23 bool fallback_restricted, |
| 24 const std::string& primary_origin, | 24 const std::string& primary_origin, |
| 25 const std::string& fallback_origin) OVERRIDE; | 25 const std::string& fallback_origin, |
| 26 const std::string& ssl_origin) OVERRIDE; |
| 26 virtual void Disable() OVERRIDE; | 27 virtual void Disable() OVERRIDE; |
| 27 | 28 |
| 28 // Add a host pattern to bypass. This should follow the same syntax used | 29 // Add a host pattern to bypass. This should follow the same syntax used |
| 29 // in net::ProxyBypassRules; that is, a hostname pattern, a hostname suffix | 30 // in net::ProxyBypassRules; that is, a hostname pattern, a hostname suffix |
| 30 // pattern, an IP literal, a CIDR block, or the magic string '<local>'. | 31 // pattern, an IP literal, a CIDR block, or the magic string '<local>'. |
| 31 // Bypass settings persist for the life of this object and are applied | 32 // Bypass settings persist for the life of this object and are applied |
| 32 // each time the proxy is enabled, but are not updated while it is enabled. | 33 // each time the proxy is enabled, but are not updated while it is enabled. |
| 33 virtual void AddHostPatternToBypass(const std::string& pattern) OVERRIDE; | 34 virtual void AddHostPatternToBypass(const std::string& pattern) OVERRIDE; |
| 34 | 35 |
| 35 // Add a URL pattern to bypass the proxy. The base implementation strips | 36 // Add a URL pattern to bypass the proxy. The base implementation strips |
| 36 // everything in |pattern| after the first single slash and then treats it | 37 // everything in |pattern| after the first single slash and then treats it |
| 37 // as a hostname pattern. Subclasses may implement other semantics. | 38 // as a hostname pattern. Subclasses may implement other semantics. |
| 38 virtual void AddURLPatternToBypass(const std::string& pattern) OVERRIDE; | 39 virtual void AddURLPatternToBypass(const std::string& pattern) OVERRIDE; |
| 39 | 40 |
| 40 private: | 41 private: |
| 41 FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, TestBypassList); | 42 FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, TestBypassList); |
| 42 | 43 |
| 43 PrefService* prefs_; | 44 PrefService* prefs_; |
| 44 std::vector<std::string> bypass_rules_; | 45 std::vector<std::string> bypass_rules_; |
| 45 | 46 |
| 46 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyChromeConfigurator); | 47 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyChromeConfigurator); |
| 47 }; | 48 }; |
| 48 | 49 |
| 49 #endif // CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_CONFIGURATOR
_H_ | 50 #endif // CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_CONFIGURATOR
_H_ |
| OLD | NEW |