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 "base/prefs/pref_registry_simple.h" | 7 #include "base/prefs/pref_registry_simple.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/prefs/scoped_user_pref_update.h" | 9 #include "base/prefs/scoped_user_pref_update.h" |
10 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_
names.h" | 10 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_
names.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 prefs::kDataReductionProxyAltEnabled, false); | 102 prefs::kDataReductionProxyAltEnabled, false); |
103 registry->RegisterBooleanPref( | 103 registry->RegisterBooleanPref( |
104 prefs::kDataReductionProxyWasEnabledBefore, false); | 104 prefs::kDataReductionProxyWasEnabledBefore, false); |
105 | 105 |
106 registry->RegisterBooleanPref( | 106 registry->RegisterBooleanPref( |
107 prefs::kStatisticsPrefsMigrated, false); | 107 prefs::kStatisticsPrefsMigrated, false); |
108 RegisterPrefs(registry); | 108 RegisterPrefs(registry); |
109 } | 109 } |
110 | 110 |
111 // Add any new data reduction proxy prefs to the |pref_map_| or the | 111 // Add any new data reduction proxy prefs to the |pref_map_| or the |
112 // |list_pref_map_| in Init() of DataReductionProxyStatisticsPrefs. | 112 // |list_pref_map_| in Init() of DataReductionProxyCompressionStats. |
113 void RegisterPrefs(PrefRegistrySimple* registry) { | 113 void RegisterPrefs(PrefRegistrySimple* registry) { |
114 registry->RegisterInt64Pref( | 114 registry->RegisterInt64Pref( |
115 prefs::kHttpReceivedContentLength, 0); | 115 prefs::kHttpReceivedContentLength, 0); |
116 registry->RegisterInt64Pref( | 116 registry->RegisterInt64Pref( |
117 prefs::kHttpOriginalContentLength, 0); | 117 prefs::kHttpOriginalContentLength, 0); |
118 registry->RegisterListPref( | 118 registry->RegisterListPref( |
119 prefs::kDailyHttpOriginalContentLength); | 119 prefs::kDailyHttpOriginalContentLength); |
120 registry->RegisterListPref( | 120 registry->RegisterListPref( |
121 prefs::kDailyHttpReceivedContentLength); | 121 prefs::kDailyHttpReceivedContentLength); |
122 registry->RegisterBooleanPref(prefs::kUpdateDailyReceivedContentLengths, | 122 registry->RegisterBooleanPref(prefs::kUpdateDailyReceivedContentLengths, |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 profile_prefs); | 195 profile_prefs); |
196 profile_prefs->SetInt64( | 196 profile_prefs->SetInt64( |
197 prefs::kDailyHttpContentLengthLastUpdateDate, | 197 prefs::kDailyHttpContentLengthLastUpdateDate, |
198 local_state_prefs->GetInt64( | 198 local_state_prefs->GetInt64( |
199 prefs::kDailyHttpContentLengthLastUpdateDate)); | 199 prefs::kDailyHttpContentLengthLastUpdateDate)); |
200 local_state_prefs->ClearPref(prefs::kDailyHttpContentLengthLastUpdateDate); | 200 local_state_prefs->ClearPref(prefs::kDailyHttpContentLengthLastUpdateDate); |
201 profile_prefs->SetBoolean(prefs::kStatisticsPrefsMigrated, true); | 201 profile_prefs->SetBoolean(prefs::kStatisticsPrefsMigrated, true); |
202 } | 202 } |
203 | 203 |
204 } // namespace data_reduction_proxy | 204 } // namespace data_reduction_proxy |
OLD | NEW |