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 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref
s.h" | 5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref
s.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_
names.h" | 9 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_
names.h" |
10 #include "components/pref_registry/pref_registry_syncable.h" | 10 #include "components/pref_registry/pref_registry_syncable.h" |
11 #include "components/prefs/pref_registry_simple.h" | 11 #include "components/prefs/pref_registry_simple.h" |
12 #include "components/prefs/pref_service.h" | 12 #include "components/prefs/pref_service.h" |
13 #include "components/prefs/scoped_user_pref_update.h" | 13 #include "components/prefs/scoped_user_pref_update.h" |
14 | 14 |
15 namespace data_reduction_proxy { | 15 namespace data_reduction_proxy { |
16 | 16 |
17 // Make sure any changes here that have the potential to impact android_webview | 17 // Make sure any changes here that have the potential to impact android_webview |
18 // are reflected in RegisterSimpleProfilePrefs. | 18 // are reflected in RegisterSimpleProfilePrefs. |
19 void RegisterSyncableProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { | 19 void RegisterSyncableProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { |
20 registry->RegisterBooleanPref(prefs::kDataReductionProxyWasEnabledBefore, | 20 registry->RegisterBooleanPref(prefs::kDataReductionProxyWasEnabledBefore, |
21 false); | 21 false); |
22 | 22 |
23 registry->RegisterInt64Pref(prefs::kDataReductionProxyLastEnabledTime, 0L); | 23 registry->RegisterInt64Pref(prefs::kDataReductionProxyLastEnabledTime, 0L); |
| 24 registry->RegisterInt64Pref( |
| 25 prefs::kDataReductionProxySavingsClearedNegativeSystemClock, 0); |
24 | 26 |
25 registry->RegisterBooleanPref(prefs::kDataUsageReportingEnabled, false); | 27 registry->RegisterBooleanPref(prefs::kDataUsageReportingEnabled, false); |
26 | 28 |
27 registry->RegisterInt64Pref(prefs::kHttpReceivedContentLength, 0); | 29 registry->RegisterInt64Pref(prefs::kHttpReceivedContentLength, 0); |
28 registry->RegisterInt64Pref(prefs::kHttpOriginalContentLength, 0); | 30 registry->RegisterInt64Pref(prefs::kHttpOriginalContentLength, 0); |
29 | 31 |
30 registry->RegisterListPref(prefs::kDailyHttpOriginalContentLength); | 32 registry->RegisterListPref(prefs::kDailyHttpOriginalContentLength); |
31 registry->RegisterInt64Pref(prefs::kDailyHttpOriginalContentLengthApplication, | 33 registry->RegisterInt64Pref(prefs::kDailyHttpOriginalContentLengthApplication, |
32 0L); | 34 0L); |
33 registry->RegisterInt64Pref(prefs::kDailyHttpOriginalContentLengthVideo, 0L); | 35 registry->RegisterInt64Pref(prefs::kDailyHttpOriginalContentLengthVideo, 0L); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 registry->RegisterBooleanPref(prefs::kDataUsageReportingEnabled, false); | 103 registry->RegisterBooleanPref(prefs::kDataUsageReportingEnabled, false); |
102 RegisterPrefs(registry); | 104 RegisterPrefs(registry); |
103 } | 105 } |
104 | 106 |
105 // Add any new data reduction proxy prefs to the |pref_map_| or the | 107 // Add any new data reduction proxy prefs to the |pref_map_| or the |
106 // |list_pref_map_| in Init() of DataReductionProxyCompressionStats. | 108 // |list_pref_map_| in Init() of DataReductionProxyCompressionStats. |
107 void RegisterPrefs(PrefRegistrySimple* registry) { | 109 void RegisterPrefs(PrefRegistrySimple* registry) { |
108 registry->RegisterStringPref(prefs::kDataReductionProxy, std::string()); | 110 registry->RegisterStringPref(prefs::kDataReductionProxy, std::string()); |
109 registry->RegisterInt64Pref(prefs::kDataReductionProxyLastEnabledTime, 0L); | 111 registry->RegisterInt64Pref(prefs::kDataReductionProxyLastEnabledTime, 0L); |
110 registry->RegisterInt64Pref( | 112 registry->RegisterInt64Pref( |
111 prefs::kHttpReceivedContentLength, 0); | 113 prefs::kDataReductionProxySavingsClearedNegativeSystemClock, 0); |
| 114 registry->RegisterInt64Pref(prefs::kHttpReceivedContentLength, 0); |
112 registry->RegisterInt64Pref( | 115 registry->RegisterInt64Pref( |
113 prefs::kHttpOriginalContentLength, 0); | 116 prefs::kHttpOriginalContentLength, 0); |
114 registry->RegisterListPref( | 117 registry->RegisterListPref( |
115 prefs::kDailyHttpOriginalContentLength); | 118 prefs::kDailyHttpOriginalContentLength); |
116 registry->RegisterInt64Pref(prefs::kDailyHttpOriginalContentLengthApplication, | 119 registry->RegisterInt64Pref(prefs::kDailyHttpOriginalContentLengthApplication, |
117 0L); | 120 0L); |
118 registry->RegisterInt64Pref(prefs::kDailyHttpOriginalContentLengthVideo, 0L); | 121 registry->RegisterInt64Pref(prefs::kDailyHttpOriginalContentLengthVideo, 0L); |
119 registry->RegisterInt64Pref(prefs::kDailyHttpOriginalContentLengthUnknown, | 122 registry->RegisterInt64Pref(prefs::kDailyHttpOriginalContentLengthUnknown, |
120 0L); | 123 0L); |
121 registry->RegisterListPref(prefs::kDailyHttpReceivedContentLength); | 124 registry->RegisterListPref(prefs::kDailyHttpReceivedContentLength); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 registry->RegisterIntegerPref(prefs::kLoFiImplicitOptOutEpoch, 0); | 174 registry->RegisterIntegerPref(prefs::kLoFiImplicitOptOutEpoch, 0); |
172 registry->RegisterIntegerPref(prefs::kLoFiUIShownPerSession, 0); | 175 registry->RegisterIntegerPref(prefs::kLoFiUIShownPerSession, 0); |
173 registry->RegisterIntegerPref(prefs::kLoFiLoadImagesPerSession, 0); | 176 registry->RegisterIntegerPref(prefs::kLoFiLoadImagesPerSession, 0); |
174 registry->RegisterIntegerPref(prefs::kLoFiConsecutiveSessionDisables, 0); | 177 registry->RegisterIntegerPref(prefs::kLoFiConsecutiveSessionDisables, 0); |
175 registry->RegisterBooleanPref(prefs::kLoFiWasUsedThisSession, false); | 178 registry->RegisterBooleanPref(prefs::kLoFiWasUsedThisSession, false); |
176 registry->RegisterInt64Pref(prefs::kSimulatedConfigRetrieveTime, 0L); | 179 registry->RegisterInt64Pref(prefs::kSimulatedConfigRetrieveTime, 0L); |
177 registry->RegisterStringPref(prefs::kDataReductionProxyConfig, std::string()); | 180 registry->RegisterStringPref(prefs::kDataReductionProxyConfig, std::string()); |
178 } | 181 } |
179 | 182 |
180 } // namespace data_reduction_proxy | 183 } // namespace data_reduction_proxy |
OLD | NEW |