| 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 12 matching lines...) Expand all Loading... |
| 23 src->ClearPref(pref_path); | 23 src->ClearPref(pref_path); |
| 24 } | 24 } |
| 25 | 25 |
| 26 } // namespace | 26 } // namespace |
| 27 | 27 |
| 28 namespace data_reduction_proxy { | 28 namespace data_reduction_proxy { |
| 29 | 29 |
| 30 // Make sure any changes here that have the potential to impact android_webview | 30 // Make sure any changes here that have the potential to impact android_webview |
| 31 // are reflected in RegisterSimpleProfilePrefs. | 31 // are reflected in RegisterSimpleProfilePrefs. |
| 32 void RegisterSyncableProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { | 32 void RegisterSyncableProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { |
| 33 registry->RegisterBooleanPref( | 33 registry->RegisterBooleanPref(prefs::kDataReductionProxyEnabled, false); |
| 34 prefs::kDataReductionProxyEnabled, | 34 registry->RegisterBooleanPref(prefs::kDataReductionProxyAltEnabled, false); |
| 35 false, | 35 registry->RegisterBooleanPref(prefs::kDataReductionProxyWasEnabledBefore, |
| 36 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 36 false); |
| 37 registry->RegisterBooleanPref( | |
| 38 prefs::kDataReductionProxyAltEnabled, | |
| 39 false, | |
| 40 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 41 registry->RegisterBooleanPref( | |
| 42 prefs::kDataReductionProxyWasEnabledBefore, | |
| 43 false, | |
| 44 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 45 | 37 |
| 46 registry->RegisterInt64Pref( | 38 registry->RegisterInt64Pref(prefs::kHttpReceivedContentLength, 0); |
| 47 prefs::kHttpReceivedContentLength, | 39 registry->RegisterInt64Pref(prefs::kHttpOriginalContentLength, 0); |
| 48 0, | |
| 49 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 50 registry->RegisterInt64Pref( | |
| 51 prefs::kHttpOriginalContentLength, | |
| 52 0, | |
| 53 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 54 | 40 |
| 55 registry->RegisterBooleanPref( | 41 registry->RegisterBooleanPref(prefs::kStatisticsPrefsMigrated, false); |
| 56 prefs::kStatisticsPrefsMigrated, | |
| 57 false, | |
| 58 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 59 registry->RegisterBooleanPref(prefs::kUpdateDailyReceivedContentLengths, | 42 registry->RegisterBooleanPref(prefs::kUpdateDailyReceivedContentLengths, |
| 60 false, | 43 false); |
| 61 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 44 registry->RegisterListPref(prefs::kDailyHttpOriginalContentLength); |
| 45 registry->RegisterListPref(prefs::kDailyHttpReceivedContentLength); |
| 62 registry->RegisterListPref( | 46 registry->RegisterListPref( |
| 63 prefs::kDailyHttpOriginalContentLength, | 47 prefs::kDailyOriginalContentLengthWithDataReductionProxyEnabled); |
| 64 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 65 registry->RegisterListPref( | 48 registry->RegisterListPref( |
| 66 prefs::kDailyHttpReceivedContentLength, | 49 prefs::kDailyContentLengthWithDataReductionProxyEnabled); |
| 67 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 68 registry->RegisterListPref( | 50 registry->RegisterListPref( |
| 69 prefs::kDailyOriginalContentLengthWithDataReductionProxyEnabled, | 51 prefs::kDailyContentLengthHttpsWithDataReductionProxyEnabled); |
| 70 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 71 registry->RegisterListPref( | 52 registry->RegisterListPref( |
| 72 prefs::kDailyContentLengthWithDataReductionProxyEnabled, | 53 prefs::kDailyContentLengthShortBypassWithDataReductionProxyEnabled); |
| 73 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 74 registry->RegisterListPref( | 54 registry->RegisterListPref( |
| 75 prefs::kDailyContentLengthHttpsWithDataReductionProxyEnabled, | 55 prefs::kDailyContentLengthLongBypassWithDataReductionProxyEnabled); |
| 76 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 77 registry->RegisterListPref( | 56 registry->RegisterListPref( |
| 78 prefs::kDailyContentLengthShortBypassWithDataReductionProxyEnabled, | 57 prefs::kDailyContentLengthUnknownWithDataReductionProxyEnabled); |
| 79 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 80 registry->RegisterListPref( | 58 registry->RegisterListPref( |
| 81 prefs::kDailyContentLengthLongBypassWithDataReductionProxyEnabled, | 59 prefs::kDailyOriginalContentLengthViaDataReductionProxy); |
| 82 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 60 registry->RegisterListPref(prefs::kDailyContentLengthViaDataReductionProxy); |
| 83 registry->RegisterListPref( | 61 registry->RegisterInt64Pref(prefs::kDailyHttpContentLengthLastUpdateDate, 0L); |
| 84 prefs::kDailyContentLengthUnknownWithDataReductionProxyEnabled, | |
| 85 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 86 registry->RegisterListPref( | |
| 87 prefs::kDailyOriginalContentLengthViaDataReductionProxy, | |
| 88 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 89 registry->RegisterListPref( | |
| 90 prefs::kDailyContentLengthViaDataReductionProxy, | |
| 91 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 92 registry->RegisterInt64Pref( | |
| 93 prefs::kDailyHttpContentLengthLastUpdateDate, | |
| 94 0L, | |
| 95 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 96 } | 62 } |
| 97 | 63 |
| 98 void RegisterSimpleProfilePrefs(PrefRegistrySimple* registry) { | 64 void RegisterSimpleProfilePrefs(PrefRegistrySimple* registry) { |
| 99 registry->RegisterBooleanPref( | 65 registry->RegisterBooleanPref( |
| 100 prefs::kDataReductionProxyEnabled, false); | 66 prefs::kDataReductionProxyEnabled, false); |
| 101 registry->RegisterBooleanPref( | 67 registry->RegisterBooleanPref( |
| 102 prefs::kDataReductionProxyAltEnabled, false); | 68 prefs::kDataReductionProxyAltEnabled, false); |
| 103 registry->RegisterBooleanPref( | 69 registry->RegisterBooleanPref( |
| 104 prefs::kDataReductionProxyWasEnabledBefore, false); | 70 prefs::kDataReductionProxyWasEnabledBefore, false); |
| 105 | 71 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 profile_prefs); | 161 profile_prefs); |
| 196 profile_prefs->SetInt64( | 162 profile_prefs->SetInt64( |
| 197 prefs::kDailyHttpContentLengthLastUpdateDate, | 163 prefs::kDailyHttpContentLengthLastUpdateDate, |
| 198 local_state_prefs->GetInt64( | 164 local_state_prefs->GetInt64( |
| 199 prefs::kDailyHttpContentLengthLastUpdateDate)); | 165 prefs::kDailyHttpContentLengthLastUpdateDate)); |
| 200 local_state_prefs->ClearPref(prefs::kDailyHttpContentLengthLastUpdateDate); | 166 local_state_prefs->ClearPref(prefs::kDailyHttpContentLengthLastUpdateDate); |
| 201 profile_prefs->SetBoolean(prefs::kStatisticsPrefsMigrated, true); | 167 profile_prefs->SetBoolean(prefs::kStatisticsPrefsMigrated, true); |
| 202 } | 168 } |
| 203 | 169 |
| 204 } // namespace data_reduction_proxy | 170 } // namespace data_reduction_proxy |
| OLD | NEW |