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/data_reduction_proxy/core/browser/data_reduction_proxy_pref
s.h" | 10 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref
s.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "components/sync_driver/sync_prefs.h" | 22 #include "components/sync_driver/sync_prefs.h" |
23 #include "components/translate/core/browser/translate_prefs.h" | 23 #include "components/translate/core/browser/translate_prefs.h" |
24 #include "components/translate/core/common/translate_pref_names.h" | 24 #include "components/translate/core/common/translate_pref_names.h" |
25 #include "components/variations/service/variations_service.h" | 25 #include "components/variations/service/variations_service.h" |
26 #include "components/web_resource/promo_resource_service.h" | 26 #include "components/web_resource/promo_resource_service.h" |
27 #include "ios/chrome/browser/application_context_impl.h" | 27 #include "ios/chrome/browser/application_context_impl.h" |
28 #include "ios/chrome/browser/browser_state/browser_state_info_cache.h" | 28 #include "ios/chrome/browser/browser_state/browser_state_info_cache.h" |
29 #include "ios/chrome/browser/first_run/first_run.h" | 29 #include "ios/chrome/browser/first_run/first_run.h" |
30 #import "ios/chrome/browser/geolocation/omnibox_geolocation_local_state.h" | 30 #import "ios/chrome/browser/geolocation/omnibox_geolocation_local_state.h" |
31 #import "ios/chrome/browser/memory/memory_debugger_manager.h" | 31 #import "ios/chrome/browser/memory/memory_debugger_manager.h" |
| 32 #import "ios/chrome/browser/metrics/ios_chrome_metrics_service_client.h" |
32 #include "ios/chrome/browser/net/http_server_properties_manager_factory.h" | 33 #include "ios/chrome/browser/net/http_server_properties_manager_factory.h" |
33 #include "ios/chrome/browser/pref_names.h" | 34 #include "ios/chrome/browser/pref_names.h" |
34 #include "ios/chrome/browser/signin/signin_manager_factory.h" | 35 #include "ios/chrome/browser/signin/signin_manager_factory.h" |
35 #include "ios/chrome/grit/ios_locale_settings.h" | 36 #include "ios/chrome/grit/ios_locale_settings.h" |
36 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" | 37 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" |
37 #include "ui/base/l10n/l10n_util.h" | 38 #include "ui/base/l10n/l10n_util.h" |
38 | 39 |
39 namespace { | 40 namespace { |
40 | 41 |
41 // TODO(crbug.com/525079): those preferences are not used on iOS but are | 42 // TODO(crbug.com/525079): those preferences are not used on iOS but are |
42 // required to be able to run unit_tests until componentization of | 43 // required to be able to run unit_tests until componentization of |
43 // chrome/browser/prefs is complete. | 44 // chrome/browser/prefs is complete. |
44 const char kURLsToRestoreOnStartup[] = "session.startup_urls"; | 45 const char kURLsToRestoreOnStartup[] = "session.startup_urls"; |
45 const char kURLsToRestoreOnStartupOld[] = "session.urls_to_restore_on_startup"; | 46 const char kURLsToRestoreOnStartupOld[] = "session.urls_to_restore_on_startup"; |
46 | 47 |
47 } // namespace | 48 } // namespace |
48 | 49 |
49 void RegisterLocalStatePrefs(PrefRegistrySimple* registry) { | 50 void RegisterLocalStatePrefs(PrefRegistrySimple* registry) { |
50 BrowserStateInfoCache::RegisterPrefs(registry); | 51 BrowserStateInfoCache::RegisterPrefs(registry); |
51 gcm::GCMChannelStatusSyncer::RegisterPrefs(registry); | 52 gcm::GCMChannelStatusSyncer::RegisterPrefs(registry); |
52 ios::SigninManagerFactory::RegisterPrefs(registry); | 53 ios::SigninManagerFactory::RegisterPrefs(registry); |
| 54 IOSChromeMetricsServiceClient::RegisterPrefs(registry); |
53 network_time::NetworkTimeTracker::RegisterPrefs(registry); | 55 network_time::NetworkTimeTracker::RegisterPrefs(registry); |
54 PrefProxyConfigTrackerImpl::RegisterPrefs(registry); | 56 PrefProxyConfigTrackerImpl::RegisterPrefs(registry); |
55 rappor::RapporService::RegisterPrefs(registry); | 57 rappor::RapporService::RegisterPrefs(registry); |
56 variations::VariationsService::RegisterPrefs(registry); | 58 variations::VariationsService::RegisterPrefs(registry); |
57 web_resource::PromoResourceService::RegisterPrefs(registry); | 59 web_resource::PromoResourceService::RegisterPrefs(registry); |
58 | 60 |
59 // Preferences related to the browser state manager. | 61 // Preferences related to the browser state manager. |
60 registry->RegisterStringPref(ios::prefs::kBrowserStateLastUsed, | 62 registry->RegisterStringPref(ios::prefs::kBrowserStateLastUsed, |
61 std::string()); | 63 std::string()); |
62 registry->RegisterIntegerPref(ios::prefs::kBrowserStatesNumCreated, 1); | 64 registry->RegisterIntegerPref(ios::prefs::kBrowserStatesNumCreated, 1); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 140 |
139 // This method should be periodically pruned of year+ old migrations. | 141 // This method should be periodically pruned of year+ old migrations. |
140 void MigrateObsoleteBrowserStatePrefs(PrefService* prefs) { | 142 void MigrateObsoleteBrowserStatePrefs(PrefService* prefs) { |
141 // Added 07/2014. | 143 // Added 07/2014. |
142 translate::TranslatePrefs::MigrateUserPrefs(prefs, | 144 translate::TranslatePrefs::MigrateUserPrefs(prefs, |
143 ios::prefs::kAcceptLanguages); | 145 ios::prefs::kAcceptLanguages); |
144 | 146 |
145 // Added 08/2015. | 147 // Added 08/2015. |
146 prefs->ClearPref(::prefs::kSigninSharedAuthenticationUserId); | 148 prefs->ClearPref(::prefs::kSigninSharedAuthenticationUserId); |
147 } | 149 } |
OLD | NEW |