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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 return usage_stats_; | 102 return usage_stats_; |
102 } | 103 } |
103 | 104 |
104 // Initializes the data reduction proxy with profile and local state prefs, | 105 // Initializes the data reduction proxy with profile and local state prefs, |
105 // and a |UrlRequestContextGetter| for canary probes. The caller must ensure | 106 // and a |UrlRequestContextGetter| for canary probes. The caller must ensure |
106 // that all parameters remain alive for the lifetime of the | 107 // that all parameters remain alive for the lifetime of the |
107 // |DataReductionProxySettings| instance. | 108 // |DataReductionProxySettings| instance. |
108 void InitDataReductionProxySettings( | 109 void InitDataReductionProxySettings( |
109 PrefService* prefs, | 110 PrefService* prefs, |
110 PrefService* local_state_prefs, | 111 PrefService* local_state_prefs, |
111 net::URLRequestContextGetter* url_request_context_getter); | 112 net::URLRequestContextGetter* url_request_context_getter, |
| 113 const base::Callback<void(bool)>& on_data_reduction_proxy_enabled); |
112 | 114 |
113 // Initializes the data reduction proxy with profile and local state prefs, | 115 // Initializes the data reduction proxy with profile and local state prefs, |
114 // a |UrlRequestContextGetter| for canary probes, and a proxy configurator. | 116 // a |UrlRequestContextGetter| for canary probes, and a proxy configurator. |
115 // The caller must ensure that all parameters remain alive for the lifetime of | 117 // The caller must ensure that all parameters remain alive for the lifetime of |
116 // the |DataReductionProxySettings| instance. | 118 // the |DataReductionProxySettings| instance. |
117 // TODO(marq): Remove when iOS supports the new interface above. | 119 // TODO(marq): Remove when iOS supports the new interface above. |
118 void InitDataReductionProxySettings( | 120 void InitDataReductionProxySettings( |
119 PrefService* prefs, | 121 PrefService* prefs, |
120 PrefService* local_state_prefs, | 122 PrefService* local_state_prefs, |
121 net::URLRequestContextGetter* url_request_context_getter, | 123 net::URLRequestContextGetter* url_request_context_getter, |
122 scoped_ptr<DataReductionProxyConfigurator> configurator); | 124 scoped_ptr<DataReductionProxyConfigurator> configurator, |
| 125 const base::Callback<void(bool)>& on_data_reduction_proxy_enabled); |
123 | 126 |
124 // Sets the logic the embedder uses to set the networking configuration that | 127 // Sets the logic the embedder uses to set the networking configuration that |
125 // causes traffic to be proxied. | 128 // causes traffic to be proxied. |
126 void SetProxyConfigurator( | 129 void SetProxyConfigurator( |
127 scoped_ptr<DataReductionProxyConfigurator> configurator); | 130 scoped_ptr<DataReductionProxyConfigurator> configurator); |
128 | 131 |
129 // Returns true if the proxy is enabled. | 132 // Returns true if the proxy is enabled. |
130 bool IsDataReductionProxyEnabled(); | 133 bool IsDataReductionProxyEnabled(); |
131 | 134 |
132 // Returns true if the alternative proxy is enabled. | 135 // Returns true if the alternative proxy is enabled. |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 scoped_ptr<net::URLFetcher> warmup_fetcher_; | 306 scoped_ptr<net::URLFetcher> warmup_fetcher_; |
304 | 307 |
305 BooleanPrefMember spdy_proxy_auth_enabled_; | 308 BooleanPrefMember spdy_proxy_auth_enabled_; |
306 BooleanPrefMember data_reduction_proxy_alternative_enabled_; | 309 BooleanPrefMember data_reduction_proxy_alternative_enabled_; |
307 | 310 |
308 PrefService* prefs_; | 311 PrefService* prefs_; |
309 PrefService* local_state_prefs_; | 312 PrefService* local_state_prefs_; |
310 | 313 |
311 net::URLRequestContextGetter* url_request_context_getter_; | 314 net::URLRequestContextGetter* url_request_context_getter_; |
312 | 315 |
| 316 base::Callback<void(bool)> on_data_reduction_proxy_enabled_; |
| 317 |
313 scoped_ptr<DataReductionProxyConfigurator> configurator_; | 318 scoped_ptr<DataReductionProxyConfigurator> configurator_; |
314 | 319 |
315 base::ThreadChecker thread_checker_; | 320 base::ThreadChecker thread_checker_; |
316 | 321 |
317 scoped_ptr<DataReductionProxyParams> params_; | 322 scoped_ptr<DataReductionProxyParams> params_; |
318 DataReductionProxyUsageStats* usage_stats_; | 323 DataReductionProxyUsageStats* usage_stats_; |
319 | 324 |
320 DISALLOW_COPY_AND_ASSIGN(DataReductionProxySettings); | 325 DISALLOW_COPY_AND_ASSIGN(DataReductionProxySettings); |
321 }; | 326 }; |
322 | 327 |
323 } // namespace data_reduction_proxy | 328 } // namespace data_reduction_proxy |
324 | 329 |
325 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_SETTINGS
_H_ | 330 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_SETTINGS
_H_ |
OLD | NEW |