| 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_SETTINGS_H_ | 5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_SETTINGS_H_ |
| 6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_SETTINGS_H_ | 6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_SETTINGS_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 | 108 |
| 109 // Initializes the data reduction proxy with profile and local state prefs, | 109 // Initializes the data reduction proxy with profile and local state prefs, |
| 110 // a |UrlRequestContextGetter| for canary probes, and a proxy configurator. | 110 // a |UrlRequestContextGetter| for canary probes, and a proxy configurator. |
| 111 // The caller must ensure that all parameters remain alive for the lifetime of | 111 // The caller must ensure that all parameters remain alive for the lifetime of |
| 112 // the |DataReductionProxySettings| instance. | 112 // the |DataReductionProxySettings| instance. |
| 113 // TODO(marq): Remove when iOS supports the new interface above. | 113 // TODO(marq): Remove when iOS supports the new interface above. |
| 114 void InitDataReductionProxySettings( | 114 void InitDataReductionProxySettings( |
| 115 PrefService* prefs, | 115 PrefService* prefs, |
| 116 PrefService* local_state_prefs, | 116 PrefService* local_state_prefs, |
| 117 net::URLRequestContextGetter* url_request_context_getter, | 117 net::URLRequestContextGetter* url_request_context_getter, |
| 118 scoped_ptr<DataReductionProxyConfigurator> configurator); | 118 DataReductionProxyConfigurator* configurator); |
| 119 | 119 |
| 120 // Sets the |on_data_reduction_proxy_enabled_| callback and runs to register | 120 // Sets the |on_data_reduction_proxy_enabled_| callback and runs to register |
| 121 // the DataReductionProxyEnabled synthetic field trial. | 121 // the DataReductionProxyEnabled synthetic field trial. |
| 122 void SetOnDataReductionEnabledCallback( | 122 void SetOnDataReductionEnabledCallback( |
| 123 const base::Callback<void(bool)>& on_data_reduction_proxy_enabled); | 123 const base::Callback<void(bool)>& on_data_reduction_proxy_enabled); |
| 124 | 124 |
| 125 // Sets the logic the embedder uses to set the networking configuration that | 125 // Sets the logic the embedder uses to set the networking configuration that |
| 126 // causes traffic to be proxied. | 126 // causes traffic to be proxied. |
| 127 void SetProxyConfigurator( | 127 void SetProxyConfigurator( |
| 128 scoped_ptr<DataReductionProxyConfigurator> configurator); | 128 DataReductionProxyConfigurator* configurator); |
| 129 | 129 |
| 130 // Returns true if the proxy is enabled. | 130 // Returns true if the proxy is enabled. |
| 131 bool IsDataReductionProxyEnabled(); | 131 bool IsDataReductionProxyEnabled(); |
| 132 | 132 |
| 133 // Returns true if the alternative proxy is enabled. | 133 // Returns true if the alternative proxy is enabled. |
| 134 bool IsDataReductionProxyAlternativeEnabled() const; | 134 bool IsDataReductionProxyAlternativeEnabled() const; |
| 135 | 135 |
| 136 // Returns true if the proxy is managed by an adminstrator's policy. | 136 // Returns true if the proxy is managed by an adminstrator's policy. |
| 137 bool IsDataReductionProxyManaged(); | 137 bool IsDataReductionProxyManaged(); |
| 138 | 138 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 // Virtualized for mocking. Records UMA specifying whether the proxy was | 220 // Virtualized for mocking. Records UMA specifying whether the proxy was |
| 221 // enabled or disabled at startup. | 221 // enabled or disabled at startup. |
| 222 virtual void RecordStartupState( | 222 virtual void RecordStartupState( |
| 223 data_reduction_proxy::ProxyStartupState state); | 223 data_reduction_proxy::ProxyStartupState state); |
| 224 | 224 |
| 225 // Virtualized for mocking. Returns the list of network interfaces in use. | 225 // Virtualized for mocking. Returns the list of network interfaces in use. |
| 226 virtual void GetNetworkList(net::NetworkInterfaceList* interfaces, | 226 virtual void GetNetworkList(net::NetworkInterfaceList* interfaces, |
| 227 int policy); | 227 int policy); |
| 228 | 228 |
| 229 DataReductionProxyConfigurator* configurator() { | 229 DataReductionProxyConfigurator* configurator() { |
| 230 return configurator_.get(); | 230 return configurator_; |
| 231 } | 231 } |
| 232 | 232 |
| 233 // Reset params for tests. | 233 // Reset params for tests. |
| 234 void ResetParamsForTest(DataReductionProxyParams* params); | 234 void ResetParamsForTest(DataReductionProxyParams* params); |
| 235 | 235 |
| 236 private: | 236 private: |
| 237 friend class DataReductionProxySettingsTestBase; | 237 friend class DataReductionProxySettingsTestBase; |
| 238 friend class DataReductionProxySettingsTest; | 238 friend class DataReductionProxySettingsTest; |
| 239 FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest, | 239 FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest, |
| 240 TestAuthenticationInit); | 240 TestAuthenticationInit); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 BooleanPrefMember spdy_proxy_auth_enabled_; | 306 BooleanPrefMember spdy_proxy_auth_enabled_; |
| 307 BooleanPrefMember data_reduction_proxy_alternative_enabled_; | 307 BooleanPrefMember data_reduction_proxy_alternative_enabled_; |
| 308 | 308 |
| 309 PrefService* prefs_; | 309 PrefService* prefs_; |
| 310 PrefService* local_state_prefs_; | 310 PrefService* local_state_prefs_; |
| 311 | 311 |
| 312 net::URLRequestContextGetter* url_request_context_getter_; | 312 net::URLRequestContextGetter* url_request_context_getter_; |
| 313 | 313 |
| 314 base::Callback<void(bool)> on_data_reduction_proxy_enabled_; | 314 base::Callback<void(bool)> on_data_reduction_proxy_enabled_; |
| 315 | 315 |
| 316 scoped_ptr<DataReductionProxyConfigurator> configurator_; | 316 DataReductionProxyConfigurator* configurator_; |
| 317 | 317 |
| 318 base::ThreadChecker thread_checker_; | 318 base::ThreadChecker thread_checker_; |
| 319 | 319 |
| 320 scoped_ptr<DataReductionProxyParams> params_; | 320 scoped_ptr<DataReductionProxyParams> params_; |
| 321 | 321 |
| 322 DISALLOW_COPY_AND_ASSIGN(DataReductionProxySettings); | 322 DISALLOW_COPY_AND_ASSIGN(DataReductionProxySettings); |
| 323 }; | 323 }; |
| 324 | 324 |
| 325 } // namespace data_reduction_proxy | 325 } // namespace data_reduction_proxy |
| 326 | 326 |
| 327 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_SETTINGS
_H_ | 327 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_SETTINGS
_H_ |
| OLD | NEW |