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_CORE_BROWSER_DATA_REDUCTION_PROXY_SETTIN GS_H_ | 5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_SETTIN GS_H_ |
6 #define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_SETTIN GS_H_ | 6 #define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_SETTIN GS_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
15 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
16 #include "base/macros.h" | 16 #include "base/macros.h" |
17 #include "base/threading/thread_checker.h" | 17 #include "base/threading/thread_checker.h" |
18 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_metr ics.h" | 18 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_metr ics.h" |
19 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_serv ice_observer.h" | 19 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_serv ice_observer.h" |
20 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h" | |
20 #include "components/prefs/pref_member.h" | 21 #include "components/prefs/pref_member.h" |
21 #include "url/gurl.h" | 22 #include "url/gurl.h" |
22 | 23 |
23 class PrefService; | 24 class PrefService; |
24 | 25 |
25 namespace base { | 26 namespace base { |
26 class Clock; | 27 class Clock; |
27 } | 28 } |
28 | 29 |
29 namespace data_reduction_proxy { | 30 namespace data_reduction_proxy { |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
164 // Configures data reduction proxy. |at_startup| is true when this method is | 165 // Configures data reduction proxy. |at_startup| is true when this method is |
165 // called in response to creating or loading a new profile. | 166 // called in response to creating or loading a new profile. |
166 void MaybeActivateDataReductionProxy(bool at_startup); | 167 void MaybeActivateDataReductionProxy(bool at_startup); |
167 | 168 |
168 // Returns the event store being used. May be null if | 169 // Returns the event store being used. May be null if |
169 // InitDataReductionProxySettings has not been called. | 170 // InitDataReductionProxySettings has not been called. |
170 DataReductionProxyEventStore* GetEventStore() const; | 171 DataReductionProxyEventStore* GetEventStore() const; |
171 | 172 |
172 // Returns true if the data reduction proxy promo may be shown. | 173 // Returns true if the data reduction proxy promo may be shown. |
173 // This is independent of whether the data reduction proxy is allowed. | 174 // This is independent of whether the data reduction proxy is allowed. |
174 bool PromoAllowed() const { | 175 bool PromoAllowed() const { |
megjablon
2017/06/02 23:01:50
It doesn't look like this called from anywhere oth
tbansal1
2017/06/05 13:48:24
Done.
| |
175 return promo_allowed_; | 176 return data_reduction_proxy::params::IsIncludedInPromoFieldTrial(); |
176 } | 177 } |
177 | 178 |
178 DataReductionProxyService* data_reduction_proxy_service() { | 179 DataReductionProxyService* data_reduction_proxy_service() { |
179 return data_reduction_proxy_service_.get(); | 180 return data_reduction_proxy_service_.get(); |
180 } | 181 } |
181 | 182 |
182 // Returns the |DataReductionProxyConfig| being used. May be null if | 183 // Returns the |DataReductionProxyConfig| being used. May be null if |
183 // InitDataReductionProxySettings has not been called. | 184 // InitDataReductionProxySettings has not been called. |
184 DataReductionProxyConfig* Config() const { | 185 DataReductionProxyConfig* Config() const { |
185 return config_; | 186 return config_; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
274 bool unreachable_; | 275 bool unreachable_; |
275 | 276 |
276 // A call to MaybeActivateDataReductionProxy may take place before the | 277 // A call to MaybeActivateDataReductionProxy may take place before the |
277 // |data_reduction_proxy_service_| has received a DataReductionProxyIOData | 278 // |data_reduction_proxy_service_| has received a DataReductionProxyIOData |
278 // pointer. In that case, the operation against the IO objects will not | 279 // pointer. In that case, the operation against the IO objects will not |
279 // succeed and |deferred_initialization_| will be set to true. When | 280 // succeed and |deferred_initialization_| will be set to true. When |
280 // OnServiceInitialized is called, if |deferred_initialization_| is true, | 281 // OnServiceInitialized is called, if |deferred_initialization_| is true, |
281 // IO object calls will be performed at that time. | 282 // IO object calls will be performed at that time. |
282 bool deferred_initialization_; | 283 bool deferred_initialization_; |
283 | 284 |
284 // The following values are cached in order to access the values on the | |
285 // correct thread. | |
286 bool allowed_; | |
287 bool promo_allowed_; | |
288 | |
289 // The number of requests to reload the page with images from the Lo-Fi | 285 // The number of requests to reload the page with images from the Lo-Fi |
290 // UI until Lo-Fi is disabled for the remainder of the session. | 286 // UI until Lo-Fi is disabled for the remainder of the session. |
291 int lo_fi_user_requests_for_images_per_session_; | 287 int lo_fi_user_requests_for_images_per_session_; |
292 | 288 |
293 // The number of consecutive sessions where Lo-Fi was disabled for | 289 // The number of consecutive sessions where Lo-Fi was disabled for |
294 // Lo-Fi to be disabled until the next implicit opt out epoch, which may be in | 290 // Lo-Fi to be disabled until the next implicit opt out epoch, which may be in |
295 // a later session, or never. | 291 // a later session, or never. |
296 int lo_fi_consecutive_session_disables_; | 292 int lo_fi_consecutive_session_disables_; |
297 | 293 |
298 BooleanPrefMember spdy_proxy_auth_enabled_; | 294 BooleanPrefMember spdy_proxy_auth_enabled_; |
(...skipping 15 matching lines...) Expand all Loading... | |
314 std::unique_ptr<base::Clock> clock_; | 310 std::unique_ptr<base::Clock> clock_; |
315 | 311 |
316 base::ThreadChecker thread_checker_; | 312 base::ThreadChecker thread_checker_; |
317 | 313 |
318 DISALLOW_COPY_AND_ASSIGN(DataReductionProxySettings); | 314 DISALLOW_COPY_AND_ASSIGN(DataReductionProxySettings); |
319 }; | 315 }; |
320 | 316 |
321 } // namespace data_reduction_proxy | 317 } // namespace data_reduction_proxy |
322 | 318 |
323 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_SET TINGS_H_ | 319 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_SET TINGS_H_ |
OLD | NEW |