OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/prefs/browser_prefs.h" | 5 #include "ios/chrome/browser/prefs/browser_prefs.h" |
6 | 6 |
7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "components/autofill/core/browser/autofill_manager.h" | 8 #include "components/autofill/core/browser/autofill_manager.h" |
9 #include "components/content_settings/core/browser/host_content_settings_map.h" | 9 #include "components/content_settings/core/browser/host_content_settings_map.h" |
10 #include "components/dom_distiller/core/distilled_page_prefs.h" | 10 #include "components/dom_distiller/core/distilled_page_prefs.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "ios/chrome/browser/first_run/first_run.h" | 27 #include "ios/chrome/browser/first_run/first_run.h" |
28 #import "ios/chrome/browser/geolocation/omnibox_geolocation_local_state.h" | 28 #import "ios/chrome/browser/geolocation/omnibox_geolocation_local_state.h" |
29 #import "ios/chrome/browser/memory/memory_debugger_manager.h" | 29 #import "ios/chrome/browser/memory/memory_debugger_manager.h" |
30 #include "ios/chrome/browser/net/http_server_properties_manager_factory.h" | 30 #include "ios/chrome/browser/net/http_server_properties_manager_factory.h" |
31 #include "ios/chrome/browser/pref_names.h" | 31 #include "ios/chrome/browser/pref_names.h" |
32 #include "ios/chrome/browser/signin/signin_manager_factory.h" | 32 #include "ios/chrome/browser/signin/signin_manager_factory.h" |
33 #include "ios/chrome/grit/ios_locale_settings.h" | 33 #include "ios/chrome/grit/ios_locale_settings.h" |
34 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" | 34 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" |
35 #include "ui/base/l10n/l10n_util.h" | 35 #include "ui/base/l10n/l10n_util.h" |
36 | 36 |
37 #if defined(ENABLE_CONFIGURATION_POLICY) | |
38 #include "components/policy/core/browser/browser_policy_connector.h" | |
39 #include "components/policy/core/browser/url_blacklist_manager.h" | |
40 #include "components/policy/core/common/policy_statistics_collector.h" | |
41 #endif // defined(ENABLE_CONFIGURATION_POLICY) | |
42 | |
43 namespace { | 37 namespace { |
44 | 38 |
45 // TODO(crbug.com/525079): those preferences are not used on iOS but are | 39 // TODO(crbug.com/525079): those preferences are not used on iOS but are |
46 // required to be able to run unit_tests until componentization of | 40 // required to be able to run unit_tests until componentization of |
47 // chrome/browser/prefs is complete. | 41 // chrome/browser/prefs is complete. |
48 const char kURLsToRestoreOnStartup[] = "session.startup_urls"; | 42 const char kURLsToRestoreOnStartup[] = "session.startup_urls"; |
49 const char kURLsToRestoreOnStartupOld[] = "session.urls_to_restore_on_startup"; | 43 const char kURLsToRestoreOnStartupOld[] = "session.urls_to_restore_on_startup"; |
50 | 44 |
51 } // namespace | 45 } // namespace |
52 | 46 |
53 void RegisterLocalStatePrefs(PrefRegistrySimple* registry) { | 47 void RegisterLocalStatePrefs(PrefRegistrySimple* registry) { |
54 BrowserStateInfoCache::RegisterPrefs(registry); | 48 BrowserStateInfoCache::RegisterPrefs(registry); |
55 gcm::GCMChannelStatusSyncer::RegisterPrefs(registry); | 49 gcm::GCMChannelStatusSyncer::RegisterPrefs(registry); |
56 ios::SigninManagerFactory::RegisterPrefs(registry); | 50 ios::SigninManagerFactory::RegisterPrefs(registry); |
57 network_time::NetworkTimeTracker::RegisterPrefs(registry); | 51 network_time::NetworkTimeTracker::RegisterPrefs(registry); |
58 PrefProxyConfigTrackerImpl::RegisterPrefs(registry); | 52 PrefProxyConfigTrackerImpl::RegisterPrefs(registry); |
59 rappor::RapporService::RegisterPrefs(registry); | 53 rappor::RapporService::RegisterPrefs(registry); |
60 variations::VariationsService::RegisterPrefs(registry); | 54 variations::VariationsService::RegisterPrefs(registry); |
61 web_resource::PromoResourceService::RegisterPrefs(registry); | 55 web_resource::PromoResourceService::RegisterPrefs(registry); |
62 | 56 |
63 #if defined(ENABLE_CONFIGURATION_POLICY) | |
64 policy::BrowserPolicyConnector::RegisterPrefs(registry); | |
65 policy::PolicyStatisticsCollector::RegisterPrefs(registry); | |
66 #endif | |
67 | |
68 // Preferences related to the browser state manager. | 57 // Preferences related to the browser state manager. |
69 registry->RegisterStringPref(ios::prefs::kBrowserStateLastUsed, | 58 registry->RegisterStringPref(ios::prefs::kBrowserStateLastUsed, |
70 std::string()); | 59 std::string()); |
71 registry->RegisterIntegerPref(ios::prefs::kBrowserStatesNumCreated, 1); | 60 registry->RegisterIntegerPref(ios::prefs::kBrowserStatesNumCreated, 1); |
72 registry->RegisterListPref(ios::prefs::kBrowserStatesLastActive); | 61 registry->RegisterListPref(ios::prefs::kBrowserStatesLastActive); |
73 | 62 |
74 [OmniboxGeolocationLocalState registerLocalState:registry]; | 63 [OmniboxGeolocationLocalState registerLocalState:registry]; |
75 [MemoryDebuggerManager registerLocalState:registry]; | 64 [MemoryDebuggerManager registerLocalState:registry]; |
76 | 65 |
77 // TODO(shreyasv): Remove this in M49 as almost all users would have the | 66 // TODO(shreyasv): Remove this in M49 as almost all users would have the |
(...skipping 18 matching lines...) Expand all Loading... |
96 HttpServerPropertiesManagerFactory::RegisterProfilePrefs(registry); | 85 HttpServerPropertiesManagerFactory::RegisterProfilePrefs(registry); |
97 password_manager::PasswordManager::RegisterProfilePrefs(registry); | 86 password_manager::PasswordManager::RegisterProfilePrefs(registry); |
98 PrefProxyConfigTrackerImpl::RegisterProfilePrefs(registry); | 87 PrefProxyConfigTrackerImpl::RegisterProfilePrefs(registry); |
99 sync_driver::SyncPrefs::RegisterProfilePrefs(registry); | 88 sync_driver::SyncPrefs::RegisterProfilePrefs(registry); |
100 TemplateURLPrepopulateData::RegisterProfilePrefs(registry); | 89 TemplateURLPrepopulateData::RegisterProfilePrefs(registry); |
101 translate::TranslatePrefs::RegisterProfilePrefs(registry); | 90 translate::TranslatePrefs::RegisterProfilePrefs(registry); |
102 variations::VariationsService::RegisterProfilePrefs(registry); | 91 variations::VariationsService::RegisterProfilePrefs(registry); |
103 web_resource::PromoResourceService::RegisterProfilePrefs(registry); | 92 web_resource::PromoResourceService::RegisterProfilePrefs(registry); |
104 ZeroSuggestProvider::RegisterProfilePrefs(registry); | 93 ZeroSuggestProvider::RegisterProfilePrefs(registry); |
105 | 94 |
106 #if defined(ENABLE_CONFIGURATION_POLICY) | |
107 policy::URLBlacklistManager::RegisterProfilePrefs(registry); | |
108 #endif | |
109 | |
110 registry->RegisterBooleanPref( | 95 registry->RegisterBooleanPref( |
111 ios::prefs::kEnableDoNotTrack, false, | 96 ios::prefs::kEnableDoNotTrack, false, |
112 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 97 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
113 registry->RegisterBooleanPref( | 98 registry->RegisterBooleanPref( |
114 prefs::kEnableTranslate, true, | 99 prefs::kEnableTranslate, true, |
115 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 100 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
116 registry->RegisterStringPref( | 101 registry->RegisterStringPref( |
117 ios::prefs::kAcceptLanguages, | 102 ios::prefs::kAcceptLanguages, |
118 l10n_util::GetStringUTF8(IDS_IOS_ACCEPT_LANGUAGES)); | 103 l10n_util::GetStringUTF8(IDS_IOS_ACCEPT_LANGUAGES)); |
119 registry->RegisterStringPref( | 104 registry->RegisterStringPref( |
(...skipping 24 matching lines...) Expand all Loading... |
144 | 129 |
145 // This method should be periodically pruned of year+ old migrations. | 130 // This method should be periodically pruned of year+ old migrations. |
146 void MigrateObsoleteBrowserStatePrefs(PrefService* prefs) { | 131 void MigrateObsoleteBrowserStatePrefs(PrefService* prefs) { |
147 // Added 07/2014. | 132 // Added 07/2014. |
148 translate::TranslatePrefs::MigrateUserPrefs(prefs, | 133 translate::TranslatePrefs::MigrateUserPrefs(prefs, |
149 ios::prefs::kAcceptLanguages); | 134 ios::prefs::kAcceptLanguages); |
150 | 135 |
151 // Added 08/2015. | 136 // Added 08/2015. |
152 prefs->ClearPref(::prefs::kSigninSharedAuthenticationUserId); | 137 prefs->ClearPref(::prefs::kSigninSharedAuthenticationUserId); |
153 } | 138 } |
OLD | NEW |