| 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" |
| 11 #include "base/callback.h" |
| 11 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 12 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
| 13 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/prefs/pref_member.h" | 15 #include "base/prefs/pref_member.h" |
| 15 #include "base/threading/thread_checker.h" | 16 #include "base/threading/thread_checker.h" |
| 16 #include "components/data_reduction_proxy/browser/data_reduction_proxy_configura
tor.h" | 17 #include "components/data_reduction_proxy/browser/data_reduction_proxy_configura
tor.h" |
| 17 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h" | 18 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h" |
| 18 #include "components/data_reduction_proxy/browser/data_reduction_proxy_usage_sta
ts.h" | 19 #include "components/data_reduction_proxy/browser/data_reduction_proxy_usage_sta
ts.h" |
| 19 #include "net/base/net_util.h" | 20 #include "net/base/net_util.h" |
| 20 #include "net/base/network_change_notifier.h" | 21 #include "net/base/network_change_notifier.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // a |UrlRequestContextGetter| for canary probes, and a proxy configurator. | 115 // a |UrlRequestContextGetter| for canary probes, and a proxy configurator. |
| 115 // The caller must ensure that all parameters remain alive for the lifetime of | 116 // The caller must ensure that all parameters remain alive for the lifetime of |
| 116 // the |DataReductionProxySettings| instance. | 117 // the |DataReductionProxySettings| instance. |
| 117 // TODO(marq): Remove when iOS supports the new interface above. | 118 // TODO(marq): Remove when iOS supports the new interface above. |
| 118 void InitDataReductionProxySettings( | 119 void InitDataReductionProxySettings( |
| 119 PrefService* prefs, | 120 PrefService* prefs, |
| 120 PrefService* local_state_prefs, | 121 PrefService* local_state_prefs, |
| 121 net::URLRequestContextGetter* url_request_context_getter, | 122 net::URLRequestContextGetter* url_request_context_getter, |
| 122 scoped_ptr<DataReductionProxyConfigurator> configurator); | 123 scoped_ptr<DataReductionProxyConfigurator> configurator); |
| 123 | 124 |
| 125 // Sets the |on_data_reduction_proxy_enabled_| callback and runs to register |
| 126 // the DataReductionProxyEnabled synthetic field trial. |
| 127 void SetOnDataReductionEnabledCallback( |
| 128 const base::Callback<void(bool)>& on_data_reduction_proxy_enabled); |
| 129 |
| 124 // Sets the logic the embedder uses to set the networking configuration that | 130 // Sets the logic the embedder uses to set the networking configuration that |
| 125 // causes traffic to be proxied. | 131 // causes traffic to be proxied. |
| 126 void SetProxyConfigurator( | 132 void SetProxyConfigurator( |
| 127 scoped_ptr<DataReductionProxyConfigurator> configurator); | 133 scoped_ptr<DataReductionProxyConfigurator> configurator); |
| 128 | 134 |
| 129 // Returns true if the proxy is enabled. | 135 // Returns true if the proxy is enabled. |
| 130 bool IsDataReductionProxyEnabled(); | 136 bool IsDataReductionProxyEnabled(); |
| 131 | 137 |
| 132 // Returns true if the alternative proxy is enabled. | 138 // Returns true if the alternative proxy is enabled. |
| 133 bool IsDataReductionProxyAlternativeEnabled() const; | 139 bool IsDataReductionProxyAlternativeEnabled() const; |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 scoped_ptr<net::URLFetcher> warmup_fetcher_; | 309 scoped_ptr<net::URLFetcher> warmup_fetcher_; |
| 304 | 310 |
| 305 BooleanPrefMember spdy_proxy_auth_enabled_; | 311 BooleanPrefMember spdy_proxy_auth_enabled_; |
| 306 BooleanPrefMember data_reduction_proxy_alternative_enabled_; | 312 BooleanPrefMember data_reduction_proxy_alternative_enabled_; |
| 307 | 313 |
| 308 PrefService* prefs_; | 314 PrefService* prefs_; |
| 309 PrefService* local_state_prefs_; | 315 PrefService* local_state_prefs_; |
| 310 | 316 |
| 311 net::URLRequestContextGetter* url_request_context_getter_; | 317 net::URLRequestContextGetter* url_request_context_getter_; |
| 312 | 318 |
| 319 base::Callback<void(bool)> on_data_reduction_proxy_enabled_; |
| 320 |
| 313 scoped_ptr<DataReductionProxyConfigurator> configurator_; | 321 scoped_ptr<DataReductionProxyConfigurator> configurator_; |
| 314 | 322 |
| 315 base::ThreadChecker thread_checker_; | 323 base::ThreadChecker thread_checker_; |
| 316 | 324 |
| 317 scoped_ptr<DataReductionProxyParams> params_; | 325 scoped_ptr<DataReductionProxyParams> params_; |
| 318 DataReductionProxyUsageStats* usage_stats_; | 326 DataReductionProxyUsageStats* usage_stats_; |
| 319 | 327 |
| 320 DISALLOW_COPY_AND_ASSIGN(DataReductionProxySettings); | 328 DISALLOW_COPY_AND_ASSIGN(DataReductionProxySettings); |
| 321 }; | 329 }; |
| 322 | 330 |
| 323 } // namespace data_reduction_proxy | 331 } // namespace data_reduction_proxy |
| 324 | 332 |
| 325 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_SETTINGS
_H_ | 333 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_SETTINGS
_H_ |
| OLD | NEW |