1010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved.
2010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
3010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)// found in the LICENSE file.
4010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)
5010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)#include "components/data_reduction_proxy/browser/data_reduction_proxy_prefs.h"
6010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)
7010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)#include "base/prefs/pref_registry_simple.h"
8010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)#include "components/data_reduction_proxy/common/data_reduction_proxy_pref_names.h"
9cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)#include "components/pref_registry/pref_registry_syncable.h"
10010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)
11010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)namespace data_reduction_proxy {
12010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)
1346d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)// Make sure any changes here that have the potential to impact android_webview
1446d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)// are reflected in RegisterSimpleProfilePrefs.
15010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)void RegisterSyncableProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
16010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)  registry->RegisterBooleanPref(
17010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)      data_reduction_proxy::prefs::kDataReductionProxyEnabled,
18010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)      false,
19010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)      user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
20010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)  registry->RegisterBooleanPref(
2146d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)      data_reduction_proxy::prefs::kDataReductionProxyAltEnabled,
2246d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)      false,
2346d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)      user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
2446d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)  registry->RegisterBooleanPref(
25010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)      data_reduction_proxy::prefs::kDataReductionProxyWasEnabledBefore,
26010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)      false,
27010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)      user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
28010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)}
29010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)
30010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)void RegisterSimpleProfilePrefs(PrefRegistrySimple* registry) {
31010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)  registry->RegisterBooleanPref(
3246d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)      data_reduction_proxy::prefs::kDataReductionProxyEnabled, false);
33010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)  registry->RegisterBooleanPref(
3446d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)      data_reduction_proxy::prefs::kDataReductionProxyAltEnabled, false);
3546d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)  registry->RegisterBooleanPref(
3646d4c2bc3267f3f028f39e7e311b0f89aba2e4fdTorne (Richard Coles)      data_reduction_proxy::prefs::kDataReductionProxyWasEnabledBefore, false);
37010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)}
38010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)
391320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci// Add any new data reduction proxy prefs to the |pref_map_| or the
401320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci// |list_pref_map_| in Init() of DataReductionProxyStatisticsPrefs.
41010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)void RegisterPrefs(PrefRegistrySimple* registry) {
42010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)  registry->RegisterInt64Pref(
43010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)      prefs::kHttpReceivedContentLength, 0);
44010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)  registry->RegisterInt64Pref(
45010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)      prefs::kHttpOriginalContentLength, 0);
46010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)  registry->RegisterListPref(
47010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)      prefs::kDailyHttpOriginalContentLength);
48010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)  registry->RegisterListPref(
49010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)      prefs::kDailyHttpReceivedContentLength);
50010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)  registry->RegisterListPref(
51010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)      prefs::kDailyOriginalContentLengthWithDataReductionProxyEnabled);
52010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)  registry->RegisterListPref(
53010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)      prefs::kDailyContentLengthWithDataReductionProxyEnabled);
54010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)  registry->RegisterListPref(
55010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)      prefs::kDailyContentLengthHttpsWithDataReductionProxyEnabled);
56010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)  registry->RegisterListPref(
57010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)      prefs::kDailyContentLengthShortBypassWithDataReductionProxyEnabled);
58010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)  registry->RegisterListPref(
59010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)      prefs::kDailyContentLengthLongBypassWithDataReductionProxyEnabled);
60010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)  registry->RegisterListPref(
61010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)      prefs::kDailyContentLengthUnknownWithDataReductionProxyEnabled);
62010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)  registry->RegisterListPref(
63010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)      prefs::kDailyOriginalContentLengthViaDataReductionProxy);
64010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)  registry->RegisterListPref(
65010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)      prefs::kDailyContentLengthViaDataReductionProxy);
66010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)  registry->RegisterInt64Pref(
67010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)      prefs::kDailyHttpContentLengthLastUpdateDate, 0L);
68010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)}
69010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)
70010d83a9304c5a91596085d917d248abff47903aTorne (Richard Coles)}  // namespace data_reduction_proxy
71