Elim cr-checkbox
[chromium-blink-merge.git] / chrome / browser / prefs / browser_prefs.cc
blobc8c7140c4ff5c4103dfdde560e651bffee466199
1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/prefs/browser_prefs.h"
7 #include <string>
9 #include "base/metrics/histogram_macros.h"
10 #include "base/prefs/pref_registry_simple.h"
11 #include "base/prefs/pref_service.h"
12 #include "base/trace_event/trace_event.h"
13 #include "chrome/browser/about_flags.h"
14 #include "chrome/browser/accessibility/invert_bubble_prefs.h"
15 #include "chrome/browser/browser_process_impl.h"
16 #include "chrome/browser/browser_shutdown.h"
17 #include "chrome/browser/chrome_content_browser_client.h"
18 #include "chrome/browser/component_updater/recovery_component_installer.h"
19 #include "chrome/browser/component_updater/supervised_user_whitelist_installer.h"
20 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
21 #include "chrome/browser/devtools/devtools_window.h"
22 #include "chrome/browser/download/download_prefs.h"
23 #include "chrome/browser/external_protocol/external_protocol_handler.h"
24 #include "chrome/browser/first_run/first_run.h"
25 #include "chrome/browser/geolocation/geolocation_prefs.h"
26 #include "chrome/browser/gpu/gl_string_manager.h"
27 #include "chrome/browser/gpu/gpu_mode_manager.h"
28 #include "chrome/browser/intranet_redirect_detector.h"
29 #include "chrome/browser/io_thread.h"
30 #include "chrome/browser/media/media_capture_devices_dispatcher.h"
31 #include "chrome/browser/media/media_device_id_salt.h"
32 #include "chrome/browser/media/media_stream_devices_controller.h"
33 #include "chrome/browser/metrics/chrome_metrics_service_client.h"
34 #include "chrome/browser/net/http_server_properties_manager_factory.h"
35 #include "chrome/browser/net/net_pref_observer.h"
36 #include "chrome/browser/net/prediction_options.h"
37 #include "chrome/browser/net/predictor.h"
38 #include "chrome/browser/net/ssl_config_service_manager.h"
39 #include "chrome/browser/notifications/extension_welcome_notification.h"
40 #include "chrome/browser/notifications/notifier_state_tracker.h"
41 #include "chrome/browser/pepper_flash_settings_manager.h"
42 #include "chrome/browser/plugins/plugin_finder.h"
43 #include "chrome/browser/prefs/chrome_pref_service_factory.h"
44 #include "chrome/browser/prefs/incognito_mode_prefs.h"
45 #include "chrome/browser/prefs/session_startup_pref.h"
46 #include "chrome/browser/profiles/chrome_version_service.h"
47 #include "chrome/browser/profiles/profile.h"
48 #include "chrome/browser/profiles/profile_impl.h"
49 #include "chrome/browser/profiles/profile_info_cache.h"
50 #include "chrome/browser/profiles/profiles_state.h"
51 #include "chrome/browser/push_messaging/push_messaging_service_impl.h"
52 #include "chrome/browser/renderer_host/pepper/device_id_fetcher.h"
53 #include "chrome/browser/search/search.h"
54 #include "chrome/browser/signin/signin_manager_factory.h"
55 #include "chrome/browser/task_manager/task_manager.h"
56 #include "chrome/browser/tracing/chrome_tracing_delegate.h"
57 #include "chrome/browser/ui/app_list/app_list_prefs.h"
58 #include "chrome/browser/ui/app_list/app_list_service.h"
59 #include "chrome/browser/ui/browser_ui_prefs.h"
60 #include "chrome/browser/ui/navigation_correction_tab_observer.h"
61 #include "chrome/browser/ui/network_profile_bubble.h"
62 #include "chrome/browser/ui/prefs/prefs_tab_helper.h"
63 #include "chrome/browser/ui/search_engines/keyword_editor_controller.h"
64 #include "chrome/browser/ui/startup/autolaunch_prompt.h"
65 #include "chrome/browser/ui/startup/default_browser_prompt.h"
66 #include "chrome/browser/ui/tabs/pinned_tab_codec.h"
67 #include "chrome/browser/ui/webui/flags_ui.h"
68 #include "chrome/browser/ui/webui/instant_ui.h"
69 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
70 #include "chrome/browser/ui/webui/plugins_ui.h"
71 #include "chrome/browser/ui/webui/print_preview/sticky_settings.h"
72 #include "chrome/browser/upgrade_detector.h"
73 #include "chrome/common/pref_names.h"
74 #include "components/autofill/core/browser/autofill_manager.h"
75 #include "components/content_settings/core/browser/host_content_settings_map.h"
76 #include "components/dom_distiller/core/distilled_page_prefs.h"
77 #include "components/enhanced_bookmarks/bookmark_server_cluster_service.h"
78 #include "components/gcm_driver/gcm_channel_status_syncer.h"
79 #include "components/network_time/network_time_tracker.h"
80 #include "components/omnibox/browser/zero_suggest_provider.h"
81 #include "components/password_manager/core/browser/password_bubble_experiment.h"
82 #include "components/password_manager/core/browser/password_manager.h"
83 #include "components/pref_registry/pref_registry_syncable.h"
84 #include "components/proxy_config/pref_proxy_config_tracker_impl.h"
85 #include "components/rappor/rappor_service.h"
86 #include "components/search_engines/template_url_prepopulate_data.h"
87 #include "components/sync_driver/sync_prefs.h"
88 #include "components/syncable_prefs/pref_service_syncable.h"
89 #include "components/translate/core/browser/translate_prefs.h"
90 #include "components/variations/service/variations_service.h"
91 #include "components/web_resource/promo_resource_service.h"
92 #include "content/public/browser/render_process_host.h"
93 #include "net/http/http_server_properties_manager.h"
95 #if defined(ENABLE_AUTOFILL_DIALOG)
96 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h"
97 #endif
99 #if defined(ENABLE_BACKGROUND)
100 #include "chrome/browser/background/background_mode_manager.h"
101 #endif
103 #if defined(ENABLE_CONFIGURATION_POLICY)
104 #include "components/policy/core/browser/browser_policy_connector.h"
105 #include "components/policy/core/browser/url_blacklist_manager.h"
106 #include "components/policy/core/common/policy_statistics_collector.h"
107 #endif
109 #if defined(ENABLE_EXTENSIONS)
110 #include "chrome/browser/accessibility/animation_policy_prefs.h"
111 #include "chrome/browser/apps/drive/drive_app_mapping.h"
112 #include "chrome/browser/apps/shortcut_manager.h"
113 #include "chrome/browser/extensions/activity_log/activity_log.h"
114 #include "chrome/browser/extensions/api/commands/command_service.h"
115 #include "chrome/browser/extensions/api/tabs/tabs_api.h"
116 #include "chrome/browser/extensions/extension_web_ui.h"
117 #include "chrome/browser/extensions/launch_util.h"
118 #include "chrome/browser/signin/easy_unlock_service.h"
119 #include "chrome/browser/ui/webui/extensions/extension_settings_handler.h"
120 #include "extensions/browser/extension_prefs.h"
121 #if !defined(OS_ANDROID) && !defined(OS_IOS)
122 #include "chrome/browser/extensions/api/copresence/copresence_api.h"
123 #include "chrome/browser/ui/toolbar/toolbar_actions_bar.h"
124 #endif
125 #endif // defined(ENABLE_EXTENSIONS)
127 #if defined(ENABLE_PLUGIN_INSTALLATION)
128 #include "chrome/browser/plugins/plugins_resource_service.h"
129 #endif
131 #if defined(ENABLE_SUPERVISED_USERS)
132 #include "chrome/browser/supervised_user/child_accounts/child_account_service.h"
133 #include "chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service.h"
134 #include "chrome/browser/supervised_user/legacy/supervised_user_sync_service.h"
135 #include "chrome/browser/supervised_user/supervised_user_service.h"
136 #include "chrome/browser/supervised_user/supervised_user_whitelist_service.h"
137 #endif
139 #if defined(ENABLE_SERVICE_DISCOVERY)
140 #include "chrome/browser/ui/webui/local_discovery/local_discovery_ui.h"
141 #endif
143 #if defined(OS_ANDROID)
144 #include "chrome/browser/android/bookmarks/partner_bookmarks_shim.h"
145 #include "chrome/browser/android/most_visited_sites.h"
146 #include "chrome/browser/android/new_tab_page_prefs.h"
147 #else
148 #include "chrome/browser/profile_resetter/automatic_profile_resetter_factory.h"
149 #include "chrome/browser/ui/startup/startup_browser_creator.h"
150 #endif
152 #if !defined(OS_ANDROID) && !defined(OS_IOS)
153 #include "chrome/browser/signin/signin_promo.h"
154 #include "chrome/browser/ui/webui/foreign_session_handler.h"
155 #endif
157 #if defined(OS_CHROMEOS)
158 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
159 #include "chrome/browser/chromeos/customization/customization_document.h"
160 #include "chrome/browser/chromeos/display/display_preferences.h"
161 #include "chrome/browser/chromeos/extensions/echo_private_api.h"
162 #include "chrome/browser/chromeos/file_system_provider/registry.h"
163 #include "chrome/browser/chromeos/first_run/first_run.h"
164 #include "chrome/browser/chromeos/login/saml/saml_offline_signin_limiter.h"
165 #include "chrome/browser/chromeos/login/session/user_session_manager.h"
166 #include "chrome/browser/chromeos/login/startup_utils.h"
167 #include "chrome/browser/chromeos/login/users/avatar/user_image_manager.h"
168 #include "chrome/browser/chromeos/login/users/avatar/user_image_sync_observer.h"
169 #include "chrome/browser/chromeos/login/users/chrome_user_manager_impl.h"
170 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h"
171 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h"
172 #include "chrome/browser/chromeos/net/proxy_config_handler.h"
173 #include "chrome/browser/chromeos/platform_keys/key_permissions.h"
174 #include "chrome/browser/chromeos/policy/auto_enrollment_client.h"
175 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
176 #include "chrome/browser/chromeos/policy/consumer_management_service.h"
177 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h"
178 #include "chrome/browser/chromeos/policy/device_status_collector.h"
179 #include "chrome/browser/chromeos/policy/policy_cert_service_factory.h"
180 #include "chrome/browser/chromeos/power/power_prefs.h"
181 #include "chrome/browser/chromeos/preferences.h"
182 #include "chrome/browser/chromeos/settings/device_oauth2_token_service.h"
183 #include "chrome/browser/chromeos/settings/device_settings_cache.h"
184 #include "chrome/browser/chromeos/status/data_promo_notification.h"
185 #include "chrome/browser/chromeos/system/automatic_reboot_manager.h"
186 #include "chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api.h"
187 #include "chrome/browser/extensions/extension_assets_manager_chromeos.h"
188 #include "chrome/browser/media/protected_media_identifier_permission_context.h"
189 #include "chrome/browser/metrics/chromeos_metrics_provider.h"
190 #include "chrome/browser/ui/webui/chromeos/login/demo_mode_detector.h"
191 #include "chrome/browser/ui/webui/chromeos/login/enable_debugging_screen_handler.h"
192 #include "chrome/browser/ui/webui/chromeos/login/hid_detection_screen_handler.h"
193 #include "chrome/browser/ui/webui/chromeos/login/reset_screen_handler.h"
194 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
195 #include "chromeos/audio/audio_devices_pref_handler_impl.h"
196 #include "chromeos/timezone/timezone_resolver.h"
197 #include "components/invalidation/impl/invalidator_storage.h"
198 #else
199 #include "chrome/browser/extensions/default_apps.h"
200 #endif
202 #if defined(OS_CHROMEOS) && defined(ENABLE_APP_LIST)
203 #include "chrome/browser/ui/app_list/google_now_extension.h"
204 #endif
206 #if defined(OS_MACOSX)
207 #include "chrome/browser/ui/cocoa/apps/quit_with_apps_controller_mac.h"
208 #include "chrome/browser/ui/cocoa/confirm_quit.h"
209 #endif
211 #if defined(OS_WIN)
212 #include "chrome/browser/apps/app_launch_for_metro_restart_win.h"
213 #include "chrome/browser/component_updater/sw_reporter_installer_win.h"
214 #endif
216 #if defined(TOOLKIT_VIEWS)
217 #include "chrome/browser/ui/browser_view_prefs.h"
218 #endif
220 #if defined(USE_ASH)
221 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h"
222 #endif
224 namespace {
226 #if !defined(OS_ANDROID)
227 // The AutomaticProfileResetter service used this preference to save that the
228 // profile reset prompt had already been shown, however, the preference has been
229 // renamed in Local State. We keep the name here for now so that we can clear
230 // out legacy values.
231 // TODO(engedy): Remove this and usages in M42 or later. See crbug.com/398813.
232 const char kLegacyProfileResetPromptMemento[] = "profile.reset_prompt_memento";
233 #endif
235 } // namespace
237 namespace chrome {
239 void RegisterLocalState(PrefRegistrySimple* registry) {
241 // Please keep this list alphabetized.
242 AppListService::RegisterPrefs(registry);
243 browser_shutdown::RegisterPrefs(registry);
244 BrowserProcessImpl::RegisterPrefs(registry);
245 ChromeMetricsServiceClient::RegisterPrefs(registry);
246 chrome_prefs::RegisterPrefs(registry);
247 variations::VariationsService::RegisterPrefs(registry);
248 component_updater::RegisterPrefsForRecoveryComponent(registry);
249 component_updater::SupervisedUserWhitelistInstaller::RegisterPrefs(registry);
250 ExternalProtocolHandler::RegisterPrefs(registry);
251 FlagsUI::RegisterPrefs(registry);
252 geolocation::RegisterPrefs(registry);
253 GLStringManager::RegisterPrefs(registry);
254 GpuModeManager::RegisterPrefs(registry);
255 IntranetRedirectDetector::RegisterPrefs(registry);
256 IOThread::RegisterPrefs(registry);
257 network_time::NetworkTimeTracker::RegisterPrefs(registry);
258 PrefProxyConfigTrackerImpl::RegisterPrefs(registry);
259 ProfileInfoCache::RegisterPrefs(registry);
260 profiles::RegisterPrefs(registry);
261 rappor::RapporService::RegisterPrefs(registry);
262 RegisterScreenshotPrefs(registry);
263 SigninManagerFactory::RegisterPrefs(registry);
264 SSLConfigServiceManager::RegisterPrefs(registry);
265 UpgradeDetector::RegisterPrefs(registry);
266 web_resource::PromoResourceService::RegisterPrefs(registry);
268 #if defined(ENABLE_AUTOFILL_DIALOG)
269 autofill::AutofillDialogController::RegisterPrefs(registry);
270 #endif
272 #if defined(ENABLE_CONFIGURATION_POLICY)
273 policy::BrowserPolicyConnector::RegisterPrefs(registry);
274 policy::PolicyStatisticsCollector::RegisterPrefs(registry);
275 #endif
277 #if defined(ENABLE_EXTENSIONS)
278 EasyUnlockService::RegisterPrefs(registry);
279 #endif
281 #if defined(ENABLE_PLUGINS)
282 PluginFinder::RegisterPrefs(registry);
283 #endif
285 #if defined(ENABLE_PLUGIN_INSTALLATION)
286 PluginsResourceService::RegisterPrefs(registry);
287 #endif
289 #if defined(ENABLE_TASK_MANAGER)
290 TaskManager::RegisterPrefs(registry);
291 #endif // defined(ENABLE_TASK_MANAGER)
293 #if !defined(OS_ANDROID)
294 AutomaticProfileResetterFactory::RegisterPrefs(registry);
295 BackgroundModeManager::RegisterPrefs(registry);
296 ChromeTracingDelegate::RegisterPrefs(registry);
297 RegisterBrowserPrefs(registry);
298 StartupBrowserCreator::RegisterLocalStatePrefs(registry);
299 // The native GCM is used on Android instead.
300 gcm::GCMChannelStatusSyncer::RegisterPrefs(registry);
301 #if !defined(OS_CHROMEOS)
302 RegisterDefaultBrowserPromptPrefs(registry);
303 #endif // !defined(OS_CHROMEOS)
304 #endif // !defined(OS_ANDROID)
306 #if defined(OS_CHROMEOS)
307 ChromeOSMetricsProvider::RegisterPrefs(registry);
308 chromeos::AudioDevicesPrefHandlerImpl::RegisterPrefs(registry);
309 chromeos::ChromeUserManagerImpl::RegisterPrefs(registry);
310 chromeos::DataPromoNotification::RegisterPrefs(registry);
311 chromeos::DeviceOAuth2TokenService::RegisterPrefs(registry);
312 chromeos::device_settings_cache::RegisterPrefs(registry);
313 chromeos::EnableDebuggingScreenHandler::RegisterPrefs(registry);
314 chromeos::language_prefs::RegisterPrefs(registry);
315 chromeos::KioskAppManager::RegisterPrefs(registry);
316 chromeos::MultiProfileUserController::RegisterPrefs(registry);
317 chromeos::HIDDetectionScreenHandler::RegisterPrefs(registry);
318 chromeos::DemoModeDetector::RegisterPrefs(registry);
319 chromeos::Preferences::RegisterPrefs(registry);
320 chromeos::proxy_config::RegisterPrefs(registry);
321 chromeos::RegisterDisplayLocalStatePrefs(registry);
322 chromeos::ResetScreenHandler::RegisterPrefs(registry);
323 chromeos::ServicesCustomizationDocument::RegisterPrefs(registry);
324 chromeos::SigninScreenHandler::RegisterPrefs(registry);
325 chromeos::StartupUtils::RegisterPrefs(registry);
326 chromeos::system::AutomaticRebootManager::RegisterPrefs(registry);
327 chromeos::UserImageManager::RegisterPrefs(registry);
328 chromeos::UserSessionManager::RegisterPrefs(registry);
329 chromeos::WallpaperManager::RegisterPrefs(registry);
330 chromeos::echo_offer::RegisterPrefs(registry);
331 extensions::ExtensionAssetsManagerChromeOS::RegisterPrefs(registry);
332 invalidation::InvalidatorStorage::RegisterPrefs(registry);
333 policy::AutoEnrollmentClient::RegisterPrefs(registry);
334 policy::BrowserPolicyConnectorChromeOS::RegisterPrefs(registry);
335 policy::ConsumerManagementService::RegisterPrefs(registry);
336 policy::DeviceCloudPolicyManagerChromeOS::RegisterPrefs(registry);
337 policy::DeviceStatusCollector::RegisterPrefs(registry);
338 policy::PolicyCertServiceFactory::RegisterPrefs(registry);
339 chromeos::TimeZoneResolver::RegisterPrefs(registry);
340 #endif
342 #if defined(OS_MACOSX)
343 confirm_quit::RegisterLocalState(registry);
344 QuitWithAppsController::RegisterPrefs(registry);
345 #endif
347 #if defined(OS_WIN)
348 app_metro_launch::RegisterPrefs(registry);
349 component_updater::RegisterPrefsForSwReporter(registry);
350 password_manager::PasswordManager::RegisterLocalPrefs(registry);
351 #endif
353 #if defined(TOOLKIT_VIEWS)
354 RegisterBrowserViewLocalPrefs(registry);
355 #endif
357 // Preferences registered only for migration (clearing or moving to a new key)
358 // go here.
359 #if !defined(OS_ANDROID)
360 registry->RegisterDictionaryPref(kLegacyProfileResetPromptMemento);
361 #endif // !defined(OS_ANDROID)
364 // Register prefs applicable to all profiles.
365 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
366 TRACE_EVENT0("browser", "chrome::RegisterProfilePrefs");
367 SCOPED_UMA_HISTOGRAM_TIMER("Settings.RegisterProfilePrefsTime");
368 // User prefs. Please keep this list alphabetized.
369 autofill::AutofillManager::RegisterProfilePrefs(registry);
370 sync_driver::SyncPrefs::RegisterProfilePrefs(registry);
371 ChromeContentBrowserClient::RegisterProfilePrefs(registry);
372 ChromeVersionService::RegisterProfilePrefs(registry);
373 chrome_browser_net::HttpServerPropertiesManagerFactory::RegisterProfilePrefs(
374 registry);
375 chrome_browser_net::Predictor::RegisterProfilePrefs(registry);
376 chrome_browser_net::RegisterPredictionOptionsProfilePrefs(registry);
377 chrome_prefs::RegisterProfilePrefs(registry);
378 dom_distiller::DistilledPagePrefs::RegisterProfilePrefs(registry);
379 DownloadPrefs::RegisterProfilePrefs(registry);
380 enhanced_bookmarks::BookmarkServerClusterService::RegisterPrefs(registry);
381 PushMessagingServiceImpl::RegisterProfilePrefs(registry);
382 HostContentSettingsMap::RegisterProfilePrefs(registry);
383 IncognitoModePrefs::RegisterProfilePrefs(registry);
384 InstantUI::RegisterProfilePrefs(registry);
385 NavigationCorrectionTabObserver::RegisterProfilePrefs(registry);
386 MediaCaptureDevicesDispatcher::RegisterProfilePrefs(registry);
387 MediaDeviceIDSalt::RegisterProfilePrefs(registry);
388 MediaStreamDevicesController::RegisterProfilePrefs(registry);
389 NetPrefObserver::RegisterProfilePrefs(registry);
390 password_bubble_experiment::RegisterPrefs(registry);
391 password_manager::PasswordManager::RegisterProfilePrefs(registry);
392 PrefProxyConfigTrackerImpl::RegisterProfilePrefs(registry);
393 PrefsTabHelper::RegisterProfilePrefs(registry);
394 Profile::RegisterProfilePrefs(registry);
395 ProfileImpl::RegisterProfilePrefs(registry);
396 ProtocolHandlerRegistry::RegisterProfilePrefs(registry);
397 RegisterBrowserUserPrefs(registry);
398 SessionStartupPref::RegisterProfilePrefs(registry);
399 TemplateURLPrepopulateData::RegisterProfilePrefs(registry);
400 translate::TranslatePrefs::RegisterProfilePrefs(registry);
401 web_resource::PromoResourceService::RegisterProfilePrefs(registry);
402 ZeroSuggestProvider::RegisterProfilePrefs(registry);
404 #if defined(ENABLE_APP_LIST)
405 app_list::AppListPrefs::RegisterProfilePrefs(registry);
406 #endif
408 #if defined(ENABLE_AUTOFILL_DIALOG)
409 autofill::AutofillDialogController::RegisterProfilePrefs(registry);
410 #endif
412 #if defined(ENABLE_CONFIGURATION_POLICY)
413 policy::URLBlacklistManager::RegisterProfilePrefs(registry);
414 #endif
416 #if defined(ENABLE_EXTENSIONS)
417 EasyUnlockService::RegisterProfilePrefs(registry);
418 extensions::ActivityLog::RegisterProfilePrefs(registry);
419 extensions::launch_util::RegisterProfilePrefs(registry);
420 ExtensionWebUI::RegisterProfilePrefs(registry);
421 extensions::ExtensionPrefs::RegisterProfilePrefs(registry);
422 #if !defined(OS_ANDROID) && !defined(OS_IOS)
423 ToolbarActionsBar::RegisterProfilePrefs(registry);
424 extensions::CopresenceService::RegisterProfilePrefs(registry);
425 #endif
426 RegisterAnimationPolicyPrefs(registry);
427 #endif // defined(ENABLE_EXTENSIONS)
429 #if defined(ENABLE_NOTIFICATIONS)
430 NotifierStateTracker::RegisterProfilePrefs(registry);
431 #endif
433 #if defined(ENABLE_NOTIFICATIONS) && defined(ENABLE_EXTENSIONS) && \
434 !defined(OS_ANDROID)
435 // The extension welcome notification requires a build that enables extensions
436 // and notifications, and uses the UI message center.
437 ExtensionWelcomeNotification::RegisterProfilePrefs(registry);
438 #endif
440 #if defined(ENABLE_PLUGINS)
441 PluginsUI::RegisterProfilePrefs(registry);
442 #endif
444 #if defined(ENABLE_PRINT_PREVIEW)
445 printing::StickySettings::RegisterProfilePrefs(registry);
446 #endif
448 #if defined(ENABLE_SERVICE_DISCOVERY)
449 LocalDiscoveryUI::RegisterProfilePrefs(registry);
450 #endif
452 #if defined(ENABLE_SUPERVISED_USERS)
453 #if !defined(OS_ANDROID) && !defined(OS_IOS)
454 SupervisedUserSharedSettingsService::RegisterProfilePrefs(registry);
455 SupervisedUserSyncService::RegisterProfilePrefs(registry);
456 #endif
457 ChildAccountService::RegisterProfilePrefs(registry);
458 SupervisedUserService::RegisterProfilePrefs(registry);
459 SupervisedUserWhitelistService::RegisterProfilePrefs(registry);
460 #endif
462 #if defined(OS_ANDROID)
463 variations::VariationsService::RegisterProfilePrefs(registry);
464 MostVisitedSites::RegisterProfilePrefs(registry);
465 NewTabPagePrefs::RegisterProfilePrefs(registry);
466 PartnerBookmarksShim::RegisterProfilePrefs(registry);
467 #else
468 AppShortcutManager::RegisterProfilePrefs(registry);
469 DeviceIDFetcher::RegisterProfilePrefs(registry);
470 DevToolsWindow::RegisterProfilePrefs(registry);
471 DriveAppMapping::RegisterProfilePrefs(registry);
472 extensions::CommandService::RegisterProfilePrefs(registry);
473 extensions::ExtensionSettingsHandler::RegisterProfilePrefs(registry);
474 extensions::TabsCaptureVisibleTabFunction::RegisterProfilePrefs(registry);
475 first_run::RegisterProfilePrefs(registry);
476 gcm::GCMChannelStatusSyncer::RegisterProfilePrefs(registry);
477 NewTabUI::RegisterProfilePrefs(registry);
478 PepperFlashSettingsManager::RegisterProfilePrefs(registry);
479 PinnedTabCodec::RegisterProfilePrefs(registry);
480 RegisterAutolaunchUserPrefs(registry);
481 signin::RegisterProfilePrefs(registry);
482 #endif
484 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
485 default_apps::RegisterProfilePrefs(registry);
486 #endif
488 #if defined(OS_CHROMEOS)
489 chromeos::first_run::RegisterProfilePrefs(registry);
490 chromeos::file_system_provider::RegisterProfilePrefs(registry);
491 chromeos::KeyPermissions::RegisterProfilePrefs(registry);
492 chromeos::MultiProfileUserController::RegisterProfilePrefs(registry);
493 chromeos::Preferences::RegisterProfilePrefs(registry);
494 chromeos::proxy_config::RegisterProfilePrefs(registry);
495 chromeos::SAMLOfflineSigninLimiter::RegisterProfilePrefs(registry);
496 chromeos::ServicesCustomizationDocument::RegisterProfilePrefs(registry);
497 chromeos::UserImageSyncObserver::RegisterProfilePrefs(registry);
498 extensions::EnterprisePlatformKeysPrivateChallengeUserKeyFunction::
499 RegisterProfilePrefs(registry);
500 FlagsUI::RegisterProfilePrefs(registry);
501 #endif
503 #if defined(OS_WIN)
504 component_updater::RegisterProfilePrefsForSwReporter(registry);
505 NetworkProfileBubble::RegisterProfilePrefs(registry);
506 #endif
508 #if defined(TOOLKIT_VIEWS)
509 RegisterBrowserViewProfilePrefs(registry);
510 RegisterInvertBubbleUserPrefs(registry);
511 #endif
513 #if defined(USE_ASH)
514 ash::RegisterChromeLauncherUserPrefs(registry);
515 #endif
517 #if !defined(OS_ANDROID) && !defined(OS_IOS)
518 browser_sync::ForeignSessionHandler::RegisterProfilePrefs(registry);
519 #endif
522 void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
523 RegisterProfilePrefs(registry);
525 #if defined(OS_CHROMEOS)
526 chromeos::PowerPrefs::RegisterUserProfilePrefs(registry);
527 #endif
530 void RegisterScreenshotPrefs(PrefRegistrySimple* registry) {
531 registry->RegisterBooleanPref(prefs::kDisableScreenshots, false);
534 #if defined(OS_CHROMEOS)
535 void RegisterLoginProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
536 RegisterProfilePrefs(registry);
538 chromeos::PowerPrefs::RegisterLoginProfilePrefs(registry);
540 #endif
542 // This method should be periodically pruned of year+ old migrations.
543 void MigrateObsoleteBrowserPrefs(Profile* profile, PrefService* local_state) {
544 #if defined(TOOLKIT_VIEWS)
545 // Added 05/2014.
546 MigrateBrowserTabStripPrefs(local_state);
547 #endif
549 #if !defined(OS_ANDROID)
550 // Added 08/2014.
551 local_state->ClearPref(kLegacyProfileResetPromptMemento);
552 #endif
555 // This method should be periodically pruned of year+ old migrations.
556 void MigrateObsoleteProfilePrefs(Profile* profile) {
557 PrefService* profile_prefs = profile->GetPrefs();
559 // Added 07/2014.
560 translate::TranslatePrefs::MigrateUserPrefs(profile_prefs,
561 prefs::kAcceptLanguages);
563 #if defined(OS_CHROMEOS) && defined(ENABLE_APP_LIST)
564 // Added 02/2015.
565 MigrateGoogleNowPrefs(profile);
566 #endif
569 } // namespace chrome