| 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 "components/autofill/core/browser/autofill_manager.h" | 7 #include "components/autofill/core/browser/autofill_manager.h" |
| 8 #include "components/browsing_data/core/pref_names.h" | 8 #include "components/browsing_data/core/pref_names.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" |
| 11 #include "components/flags_ui/pref_service_flags_storage.h" | 11 #include "components/flags_ui/pref_service_flags_storage.h" |
| 12 #include "components/gcm_driver/gcm_channel_status_syncer.h" | 12 #include "components/gcm_driver/gcm_channel_status_syncer.h" |
| 13 #import "components/handoff/handoff_manager.h" |
| 13 #include "components/metrics/metrics_pref_names.h" | 14 #include "components/metrics/metrics_pref_names.h" |
| 14 #include "components/network_time/network_time_tracker.h" | 15 #include "components/network_time/network_time_tracker.h" |
| 15 #include "components/ntp_snippets/bookmarks/bookmark_suggestions_provider.h" | 16 #include "components/ntp_snippets/bookmarks/bookmark_suggestions_provider.h" |
| 16 #include "components/ntp_snippets/content_suggestions_service.h" | 17 #include "components/ntp_snippets/content_suggestions_service.h" |
| 17 #include "components/ntp_snippets/remote/remote_suggestions_provider.h" | 18 #include "components/ntp_snippets/remote/remote_suggestions_provider.h" |
| 18 #include "components/ntp_tiles/most_visited_sites.h" | 19 #include "components/ntp_tiles/most_visited_sites.h" |
| 19 #include "components/ntp_tiles/popular_sites_impl.h" | 20 #include "components/ntp_tiles/popular_sites_impl.h" |
| 20 #include "components/omnibox/browser/zero_suggest_provider.h" | 21 #include "components/omnibox/browser/zero_suggest_provider.h" |
| 21 #include "components/password_manager/core/browser/password_manager.h" | 22 #include "components/password_manager/core/browser/password_manager.h" |
| 22 #include "components/pref_registry/pref_registry_syncable.h" | 23 #include "components/pref_registry/pref_registry_syncable.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 36 #include "ios/chrome/browser/browser_state/browser_state_info_cache.h" | 37 #include "ios/chrome/browser/browser_state/browser_state_info_cache.h" |
| 37 #include "ios/chrome/browser/first_run/first_run.h" | 38 #include "ios/chrome/browser/first_run/first_run.h" |
| 38 #import "ios/chrome/browser/geolocation/omnibox_geolocation_local_state.h" | 39 #import "ios/chrome/browser/geolocation/omnibox_geolocation_local_state.h" |
| 39 #import "ios/chrome/browser/memory/memory_debugger_manager.h" | 40 #import "ios/chrome/browser/memory/memory_debugger_manager.h" |
| 40 #import "ios/chrome/browser/metrics/ios_chrome_metrics_service_client.h" | 41 #import "ios/chrome/browser/metrics/ios_chrome_metrics_service_client.h" |
| 41 #include "ios/chrome/browser/net/http_server_properties_manager_factory.h" | 42 #include "ios/chrome/browser/net/http_server_properties_manager_factory.h" |
| 42 #include "ios/chrome/browser/notification_promo.h" | 43 #include "ios/chrome/browser/notification_promo.h" |
| 43 #include "ios/chrome/browser/physical_web/physical_web_prefs_registration.h" | 44 #include "ios/chrome/browser/physical_web/physical_web_prefs_registration.h" |
| 44 #include "ios/chrome/browser/pref_names.h" | 45 #include "ios/chrome/browser/pref_names.h" |
| 45 #include "ios/chrome/browser/signin/signin_manager_factory.h" | 46 #include "ios/chrome/browser/signin/signin_manager_factory.h" |
| 47 #import "ios/chrome/browser/ui/bookmarks/bookmark_interaction_controller.h" |
| 48 #import "ios/chrome/browser/ui/bookmarks/bookmark_promo_controller.h" |
| 46 #include "ios/chrome/browser/voice/voice_search_prefs_registration.h" | 49 #include "ios/chrome/browser/voice/voice_search_prefs_registration.h" |
| 47 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" | 50 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" |
| 48 #include "ui/base/l10n/l10n_util.h" | 51 #include "ui/base/l10n/l10n_util.h" |
| 49 | 52 |
| 50 void RegisterLocalStatePrefs(PrefRegistrySimple* registry) { | 53 void RegisterLocalStatePrefs(PrefRegistrySimple* registry) { |
| 51 BrowserStateInfoCache::RegisterPrefs(registry); | 54 BrowserStateInfoCache::RegisterPrefs(registry); |
| 52 flags_ui::PrefServiceFlagsStorage::RegisterPrefs(registry); | 55 flags_ui::PrefServiceFlagsStorage::RegisterPrefs(registry); |
| 53 gcm::GCMChannelStatusSyncer::RegisterPrefs(registry); | 56 gcm::GCMChannelStatusSyncer::RegisterPrefs(registry); |
| 54 ios::SigninManagerFactory::RegisterPrefs(registry); | 57 ios::SigninManagerFactory::RegisterPrefs(registry); |
| 55 IOSChromeMetricsServiceClient::RegisterPrefs(registry); | 58 IOSChromeMetricsServiceClient::RegisterPrefs(registry); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 ios::NotificationPromo::RegisterProfilePrefs(registry); | 100 ios::NotificationPromo::RegisterProfilePrefs(registry); |
| 98 password_manager::PasswordManager::RegisterProfilePrefs(registry); | 101 password_manager::PasswordManager::RegisterProfilePrefs(registry); |
| 99 PrefProxyConfigTrackerImpl::RegisterProfilePrefs(registry); | 102 PrefProxyConfigTrackerImpl::RegisterProfilePrefs(registry); |
| 100 syncer::SyncPrefs::RegisterProfilePrefs(registry); | 103 syncer::SyncPrefs::RegisterProfilePrefs(registry); |
| 101 TemplateURLPrepopulateData::RegisterProfilePrefs(registry); | 104 TemplateURLPrepopulateData::RegisterProfilePrefs(registry); |
| 102 translate::TranslatePrefs::RegisterProfilePrefs(registry); | 105 translate::TranslatePrefs::RegisterProfilePrefs(registry); |
| 103 variations::VariationsService::RegisterProfilePrefs(registry); | 106 variations::VariationsService::RegisterProfilePrefs(registry); |
| 104 ZeroSuggestProvider::RegisterProfilePrefs(registry); | 107 ZeroSuggestProvider::RegisterProfilePrefs(registry); |
| 105 RegisterVoiceSearchBrowserStatePrefs(registry); | 108 RegisterVoiceSearchBrowserStatePrefs(registry); |
| 106 | 109 |
| 110 [BookmarkInteractionController registerBrowserStatePrefs:registry]; |
| 111 [BookmarkPromoController registerBrowserStatePrefs:registry]; |
| 112 [HandoffManager registerBrowserStatePrefs:registry]; |
| 113 |
| 107 registry->RegisterBooleanPref(prefs::kDataSaverEnabled, false); | 114 registry->RegisterBooleanPref(prefs::kDataSaverEnabled, false); |
| 108 registry->RegisterBooleanPref( | 115 registry->RegisterBooleanPref( |
| 109 prefs::kEnableDoNotTrack, false, | 116 prefs::kEnableDoNotTrack, false, |
| 110 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 117 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
| 111 registry->RegisterBooleanPref( | 118 registry->RegisterBooleanPref( |
| 112 prefs::kEnableTranslate, true, | 119 prefs::kEnableTranslate, true, |
| 113 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 120 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
| 114 registry->RegisterStringPref(prefs::kAcceptLanguages, | 121 registry->RegisterStringPref(prefs::kAcceptLanguages, |
| 115 l10n_util::GetStringUTF8(IDS_ACCEPT_LANGUAGES)); | 122 l10n_util::GetStringUTF8(IDS_ACCEPT_LANGUAGES)); |
| 116 registry->RegisterStringPref(prefs::kDefaultCharset, | 123 registry->RegisterStringPref(prefs::kDefaultCharset, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 131 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 138 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
| 132 registry->RegisterBooleanPref(prefs::kSavingBrowserHistoryDisabled, false); | 139 registry->RegisterBooleanPref(prefs::kSavingBrowserHistoryDisabled, false); |
| 133 registry->RegisterIntegerPref(prefs::kNtpShownPage, 1 << 10); | 140 registry->RegisterIntegerPref(prefs::kNtpShownPage, 1 << 10); |
| 134 | 141 |
| 135 // This comes from components/bookmarks/core/browser/bookmark_model.h | 142 // This comes from components/bookmarks/core/browser/bookmark_model.h |
| 136 // Defaults to 3, which is the id of bookmarkModel_->mobile_node() | 143 // Defaults to 3, which is the id of bookmarkModel_->mobile_node() |
| 137 registry->RegisterInt64Pref(prefs::kNtpShownBookmarksFolder, 3); | 144 registry->RegisterInt64Pref(prefs::kNtpShownBookmarksFolder, 3); |
| 138 | 145 |
| 139 // Register prefs used by Clear Browsing Data UI. | 146 // Register prefs used by Clear Browsing Data UI. |
| 140 browsing_data::prefs::RegisterBrowserUserPrefs(registry); | 147 browsing_data::prefs::RegisterBrowserUserPrefs(registry); |
| 141 | |
| 142 ios::GetChromeBrowserProvider()->RegisterProfilePrefs(registry); | |
| 143 } | 148 } |
| 144 | 149 |
| 145 // This method should be periodically pruned of year+ old migrations. | 150 // This method should be periodically pruned of year+ old migrations. |
| 146 void MigrateObsoleteLocalStatePrefs(PrefService* prefs) { | 151 void MigrateObsoleteLocalStatePrefs(PrefService* prefs) { |
| 147 } | 152 } |
| 148 | 153 |
| 149 // This method should be periodically pruned of year+ old migrations. | 154 // This method should be periodically pruned of year+ old migrations. |
| 150 void MigrateObsoleteBrowserStatePrefs(PrefService* prefs) { | 155 void MigrateObsoleteBrowserStatePrefs(PrefService* prefs) { |
| 151 // Added 07/2014. | 156 // Added 07/2014. |
| 152 translate::TranslatePrefs::MigrateUserPrefs(prefs, prefs::kAcceptLanguages); | 157 translate::TranslatePrefs::MigrateUserPrefs(prefs, prefs::kAcceptLanguages); |
| 153 | 158 |
| 154 // Added 08/2015. | 159 // Added 08/2015. |
| 155 prefs->ClearPref(::prefs::kSigninSharedAuthenticationUserId); | 160 prefs->ClearPref(::prefs::kSigninSharedAuthenticationUserId); |
| 156 } | 161 } |
| OLD | NEW |