Chromium Code Reviews| 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/browser/data_reduction_proxy_prefs.h" | 5 #include "components/data_reduction_proxy/browser/data_reduction_proxy_prefs.h" |
| 6 | 6 |
| 7 #include "base/prefs/pref_registry_simple.h" | 7 #include "base/prefs/pref_registry_simple.h" |
| 8 #include "components/data_reduction_proxy/common/data_reduction_proxy_pref_names .h" | 8 #include "components/data_reduction_proxy/common/data_reduction_proxy_pref_names .h" |
| 9 #include "components/pref_registry/pref_registry_syncable.h" | 9 #include "components/pref_registry/pref_registry_syncable.h" |
| 10 | 10 |
| 11 namespace data_reduction_proxy { | 11 namespace data_reduction_proxy { |
| 12 | 12 |
| 13 // Make sure any changes here that have the potential to impact android_webview | 13 // Make sure any changes here that have the potential to impact android_webview |
| 14 // are reflected in RegisterSimpleProfilePrefs. | 14 // are reflected in RegisterSimpleProfilePrefs. |
| 15 void RegisterSyncableProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { | 15 void RegisterSyncableProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { |
| 16 registry->RegisterBooleanPref( | 16 registry->RegisterBooleanPref( |
| 17 data_reduction_proxy::prefs::kDataReductionProxyEnabled, | 17 data_reduction_proxy::prefs::kDataReductionProxyEnabled, |
| 18 false, | 18 false, |
| 19 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 19 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 20 registry->RegisterBooleanPref( | 20 registry->RegisterBooleanPref( |
| 21 data_reduction_proxy::prefs::kDataReductionProxyAltEnabled, | 21 data_reduction_proxy::prefs::kDataReductionProxyAltEnabled, |
| 22 false, | 22 false, |
| 23 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 23 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 24 registry->RegisterBooleanPref( | 24 registry->RegisterBooleanPref( |
| 25 data_reduction_proxy::prefs::kDataReductionProxyWasEnabledBefore, | 25 data_reduction_proxy::prefs::kDataReductionProxyWasEnabledBefore, |
| 26 false, | 26 false, |
| 27 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 27 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 28 } | 28 } |
| 29 | 29 |
| 30 // Add any new data reduction proxy prefs to the |pref_map_| in Init() of | |
|
bengr
2014/08/28 21:38:35
This comment is wrong. You only need the comment a
megjablon
2014/08/30 01:10:04
Done.
| |
| 31 // DataReductionProxyStatisticsPrefs. | |
| 30 void RegisterSimpleProfilePrefs(PrefRegistrySimple* registry) { | 32 void RegisterSimpleProfilePrefs(PrefRegistrySimple* registry) { |
| 31 registry->RegisterBooleanPref( | 33 registry->RegisterBooleanPref( |
| 32 data_reduction_proxy::prefs::kDataReductionProxyEnabled, false); | 34 data_reduction_proxy::prefs::kDataReductionProxyEnabled, false); |
| 33 registry->RegisterBooleanPref( | 35 registry->RegisterBooleanPref( |
| 34 data_reduction_proxy::prefs::kDataReductionProxyAltEnabled, false); | 36 data_reduction_proxy::prefs::kDataReductionProxyAltEnabled, false); |
| 35 registry->RegisterBooleanPref( | 37 registry->RegisterBooleanPref( |
| 36 data_reduction_proxy::prefs::kDataReductionProxyWasEnabledBefore, false); | 38 data_reduction_proxy::prefs::kDataReductionProxyWasEnabledBefore, false); |
| 37 } | 39 } |
| 38 | 40 |
| 41 // Add any new data reduction proxy prefs to the |list_pref_map_| in Init() of | |
| 42 // DataReductionProxyStatisticsPrefs. | |
| 39 void RegisterPrefs(PrefRegistrySimple* registry) { | 43 void RegisterPrefs(PrefRegistrySimple* registry) { |
| 40 registry->RegisterInt64Pref( | 44 registry->RegisterInt64Pref( |
| 41 prefs::kHttpReceivedContentLength, 0); | 45 prefs::kHttpReceivedContentLength, 0); |
| 42 registry->RegisterInt64Pref( | 46 registry->RegisterInt64Pref( |
| 43 prefs::kHttpOriginalContentLength, 0); | 47 prefs::kHttpOriginalContentLength, 0); |
| 44 registry->RegisterListPref( | 48 registry->RegisterListPref( |
| 45 prefs::kDailyHttpOriginalContentLength); | 49 prefs::kDailyHttpOriginalContentLength); |
| 46 registry->RegisterListPref( | 50 registry->RegisterListPref( |
| 47 prefs::kDailyHttpReceivedContentLength); | 51 prefs::kDailyHttpReceivedContentLength); |
| 48 registry->RegisterListPref( | 52 registry->RegisterListPref( |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 59 prefs::kDailyContentLengthUnknownWithDataReductionProxyEnabled); | 63 prefs::kDailyContentLengthUnknownWithDataReductionProxyEnabled); |
| 60 registry->RegisterListPref( | 64 registry->RegisterListPref( |
| 61 prefs::kDailyOriginalContentLengthViaDataReductionProxy); | 65 prefs::kDailyOriginalContentLengthViaDataReductionProxy); |
| 62 registry->RegisterListPref( | 66 registry->RegisterListPref( |
| 63 prefs::kDailyContentLengthViaDataReductionProxy); | 67 prefs::kDailyContentLengthViaDataReductionProxy); |
| 64 registry->RegisterInt64Pref( | 68 registry->RegisterInt64Pref( |
| 65 prefs::kDailyHttpContentLengthLastUpdateDate, 0L); | 69 prefs::kDailyHttpContentLengthLastUpdateDate, 0L); |
| 66 } | 70 } |
| 67 | 71 |
| 68 } // namespace data_reduction_proxy | 72 } // namespace data_reduction_proxy |
| OLD | NEW |