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 "apps/prefs.h"
8 #include "base/debug/trace_event.h"
9 #include "base/prefs/pref_registry_simple.h"
10 #include "base/prefs/pref_service.h"
11 #include "chrome/browser/about_flags.h"
12 #include "chrome/browser/accessibility/invert_bubble_prefs.h"
13 #include "chrome/browser/background/background_mode_manager.h"
14 #include "chrome/browser/bookmarks/bookmark_prompt_prefs.h"
15 #include "chrome/browser/bookmarks/bookmark_utils.h"
16 #include "chrome/browser/browser_process_impl.h"
17 #include "chrome/browser/browser_shutdown.h"
18 #include "chrome/browser/chrome_content_browser_client.h"
19 #include "chrome/browser/component_updater/recovery_component_installer.h"
20 #include "chrome/browser/content_settings/host_content_settings_map.h"
21 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
22 #include "chrome/browser/devtools/devtools_window.h"
23 #include "chrome/browser/download/download_prefs.h"
24 #include "chrome/browser/extensions/activity_log/activity_log.h"
25 #include "chrome/browser/extensions/api/commands/command_service.h"
26 #include "chrome/browser/extensions/api/tabs/tabs_api.h"
27 #include "chrome/browser/extensions/extension_prefs.h"
28 #include "chrome/browser/extensions/extension_web_ui.h"
29 #include "chrome/browser/external_protocol/external_protocol_handler.h"
30 #include "chrome/browser/first_run/first_run.h"
31 #include "chrome/browser/geolocation/geolocation_prefs.h"
32 #include "chrome/browser/google/google_url_tracker.h"
33 #include "chrome/browser/google/google_url_tracker_factory.h"
34 #include "chrome/browser/gpu/gl_string_manager.h"
35 #include "chrome/browser/gpu/gpu_mode_manager.h"
36 #include "chrome/browser/intranet_redirect_detector.h"
37 #include "chrome/browser/io_thread.h"
38 #include "chrome/browser/media/media_capture_devices_dispatcher.h"
39 #include "chrome/browser/media/media_stream_devices_controller.h"
40 #include "chrome/browser/metrics/metrics_log.h"
41 #include "chrome/browser/metrics/metrics_service.h"
42 #include "chrome/browser/metrics/variations/variations_service.h"
43 #include "chrome/browser/net/http_server_properties_manager.h"
44 #include "chrome/browser/net/net_pref_observer.h"
45 #include "chrome/browser/net/predictor.h"
46 #include "chrome/browser/net/pref_proxy_config_tracker_impl.h"
47 #include "chrome/browser/net/ssl_config_service_manager.h"
48 #include "chrome/browser/notifications/desktop_notification_service.h"
49 #include "chrome/browser/notifications/notification_prefs_manager.h"
50 #include "chrome/browser/password_manager/password_generation_manager.h"
51 #include "chrome/browser/password_manager/password_manager.h"
52 #include "chrome/browser/pepper_flash_settings_manager.h"
53 #include "chrome/browser/plugins/plugin_finder.h"
54 #include "chrome/browser/prefs/incognito_mode_prefs.h"
55 #include "chrome/browser/prefs/pref_service_syncable.h"
56 #include "chrome/browser/prefs/session_startup_pref.h"
57 #include "chrome/browser/printing/cloud_print/cloud_print_url.h"
58 #include "chrome/browser/printing/print_dialog_cloud.h"
59 #include "chrome/browser/profiles/chrome_version_service.h"
60 #include "chrome/browser/profiles/profile.h"
61 #include "chrome/browser/profiles/profile_impl.h"
62 #include "chrome/browser/profiles/profile_info_cache.h"
63 #include "chrome/browser/profiles/profiles_state.h"
64 #include "chrome/browser/renderer_host/pepper/device_id_fetcher.h"
65 #include "chrome/browser/renderer_host/web_cache_manager.h"
66 #include "chrome/browser/search/search.h"
67 #include "chrome/browser/search_engines/template_url_prepopulate_data.h"
68 #include "chrome/browser/signin/signin_manager_factory.h"
69 #include "chrome/browser/signin/signin_promo.h"
70 #include "chrome/browser/sync/sync_prefs.h"
71 #include "chrome/browser/task_manager/task_manager.h"
72 #include "chrome/browser/translate/translate_prefs.h"
73 #include "chrome/browser/ui/alternate_error_tab_observer.h"
74 #include "chrome/browser/ui/app_list/app_list_service.h"
75 #include "chrome/browser/ui/browser_ui_prefs.h"
76 #include "chrome/browser/ui/network_profile_bubble.h"
77 #include "chrome/browser/ui/prefs/prefs_tab_helper.h"
78 #include "chrome/browser/ui/search_engines/keyword_editor_controller.h"
79 #include "chrome/browser/ui/startup/autolaunch_prompt.h"
80 #include "chrome/browser/ui/startup/default_browser_prompt.h"
81 #include "chrome/browser/ui/tabs/pinned_tab_codec.h"
82 #include "chrome/browser/ui/webui/extensions/extension_settings_handler.h"
83 #include "chrome/browser/ui/webui/flags_ui.h"
84 #include "chrome/browser/ui/webui/instant_ui.h"
85 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
86 #include "chrome/browser/ui/webui/plugins_ui.h"
87 #include "chrome/browser/ui/webui/print_preview/sticky_settings.h"
88 #include "chrome/browser/ui/window_snapshot/window_snapshot.h"
89 #include "chrome/browser/upgrade_detector.h"
90 #include "chrome/browser/web_resource/promo_resource_service.h"
91 #include "chrome/common/metrics/caching_permuted_entropy_provider.h"
92 #include "chrome/common/pref_names.h"
93 #include "components/autofill/core/browser/autofill_manager.h"
94 #include "components/user_prefs/pref_registry_syncable.h"
95 #include "content/public/browser/render_process_host.h"
97 #if defined(ENABLE_AUTOFILL_DIALOG)
98 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h"
101 #if defined(ENABLE_CONFIGURATION_POLICY)
102 #include "chrome/browser/policy/browser_policy_connector.h"
103 #include "chrome/browser/policy/policy_statistics_collector.h"
104 #include "chrome/browser/policy/url_blacklist_manager.h"
107 #if defined(ENABLE_MANAGED_USERS)
108 #include "chrome/browser/managed_mode/managed_user_service.h"
109 #include "chrome/browser/managed_mode/managed_user_sync_service.h"
112 #if defined(OS_MACOSX)
113 #include "chrome/browser/ui/cocoa/confirm_quit.h"
114 #include "chrome/browser/ui/cocoa/extensions/browser_actions_controller_prefs.h"
117 #if defined(TOOLKIT_VIEWS)
118 #include "chrome/browser/ui/browser_view_prefs.h"
119 #include "chrome/browser/ui/tabs/tab_strip_layout_type_prefs.h"
122 #if defined(TOOLKIT_GTK)
123 #include "chrome/browser/ui/gtk/browser_window_gtk.h"
126 #if defined(OS_CHROMEOS)
127 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
128 #include "chrome/browser/chromeos/audio/audio_devices_pref_handler_impl.h"
129 #include "chrome/browser/chromeos/customization_document.h"
130 #include "chrome/browser/chromeos/display/display_preferences.h"
131 #include "chrome/browser/chromeos/extensions/echo_private_api.h"
132 #include "chrome/browser/chromeos/login/default_pinned_apps_field_trial.h"
133 #include "chrome/browser/chromeos/login/login_utils.h"
134 #include "chrome/browser/chromeos/login/startup_utils.h"
135 #include "chrome/browser/chromeos/login/user_image_manager.h"
136 #include "chrome/browser/chromeos/login/user_image_sync_observer.h"
137 #include "chrome/browser/chromeos/login/user_manager.h"
138 #include "chrome/browser/chromeos/login/wallpaper_manager.h"
139 #include "chrome/browser/chromeos/net/proxy_config_handler.h"
140 #include "chrome/browser/chromeos/policy/auto_enrollment_client.h"
141 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h"
142 #include "chrome/browser/chromeos/policy/device_status_collector.h"
143 #include "chrome/browser/chromeos/power/power_prefs.h"
144 #include "chrome/browser/chromeos/preferences.h"
145 #include "chrome/browser/chromeos/settings/device_oauth2_token_service.h"
146 #include "chrome/browser/chromeos/settings/device_settings_cache.h"
147 #include "chrome/browser/chromeos/status/data_promo_notification.h"
148 #include "chrome/browser/chromeos/system/automatic_reboot_manager.h"
149 #include "chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api.h"
150 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
152 #include "chrome/browser/extensions/default_apps.h"
156 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h"
159 #if defined(OS_ANDROID)
160 #include "chrome/browser/ui/webui/ntp/android/promo_handler.h"
162 #include "chrome/browser/ui/autofill/generated_credit_card_bubble_controller.h"
165 #if defined(ENABLE_PLUGIN_INSTALLATION)
166 #include "chrome/browser/plugins/plugins_resource_service.h"
171 enum MigratedPreferences
{
174 WINDOWS_PREFS
= 1 << 1,
175 GOOGLE_URL_TRACKER_PREFS
= 1 << 2,
178 // A previous feature (see
179 // chrome/browser/protector/protected_prefs_watcher.cc in source
180 // control history) used this string as a prefix for various prefs it
181 // registered. We keep it here for now to clear out those old prefs in
183 const char kBackupPref
[] = "backup";
185 // Chrome To Mobile has been removed; this pref will be cleared from user data.
186 const char kChromeToMobilePref
[] = "chrome_to_mobile.device_list";
188 #if !defined(OS_ANDROID)
189 // The sync promo error message preference has been removed; this pref will
190 // be cleared from user data.
191 const char kSyncPromoErrorMessage
[] = "sync_promo.error_message";
198 void RegisterLocalState(PrefRegistrySimple
* registry
) {
199 // Prefs in Local State.
200 registry
->RegisterIntegerPref(prefs::kMultipleProfilePrefMigration
, 0);
202 // Please keep this list alphabetized.
203 AppListService::RegisterPrefs(registry
);
204 apps::RegisterPrefs(registry
);
205 browser_shutdown::RegisterPrefs(registry
);
206 BrowserProcessImpl::RegisterPrefs(registry
);
207 RegisterScreenshotPrefs(registry
);
208 ExternalProtocolHandler::RegisterPrefs(registry
);
209 FlagsUI::RegisterPrefs(registry
);
210 geolocation::RegisterPrefs(registry
);
211 GLStringManager::RegisterPrefs(registry
);
212 GpuModeManager::RegisterPrefs(registry
);
213 IntranetRedirectDetector::RegisterPrefs(registry
);
214 IOThread::RegisterPrefs(registry
);
215 KeywordEditorController::RegisterPrefs(registry
);
216 MetricsLog::RegisterPrefs(registry
);
217 MetricsService::RegisterPrefs(registry
);
218 metrics::CachingPermutedEntropyProvider::RegisterPrefs(registry
);
219 PrefProxyConfigTrackerImpl::RegisterPrefs(registry
);
220 ProfileInfoCache::RegisterPrefs(registry
);
221 profiles::RegisterPrefs(registry
);
222 PromoResourceService::RegisterPrefs(registry
);
223 RegisterPrefsForRecoveryComponent(registry
);
224 SigninManagerFactory::RegisterPrefs(registry
);
225 SSLConfigServiceManager::RegisterPrefs(registry
);
226 UpgradeDetector::RegisterPrefs(registry
);
227 WebCacheManager::RegisterPrefs(registry
);
228 chrome_variations::VariationsService::RegisterPrefs(registry
);
230 #if defined(ENABLE_PLUGINS)
231 PluginFinder::RegisterPrefs(registry
);
234 #if defined(ENABLE_PLUGIN_INSTALLATION)
235 PluginsResourceService::RegisterPrefs(registry
);
238 #if defined(ENABLE_CONFIGURATION_POLICY)
239 policy::BrowserPolicyConnector::RegisterPrefs(registry
);
240 policy::PolicyStatisticsCollector::RegisterPrefs(registry
);
243 #if defined(ENABLE_NOTIFICATIONS)
244 NotificationPrefsManager::RegisterPrefs(registry
);
247 #if defined(ENABLE_TASK_MANAGER)
248 TaskManager::RegisterPrefs(registry
);
249 #endif // defined(ENABLE_TASK_MANAGER)
251 #if defined(TOOLKIT_VIEWS)
252 RegisterBrowserViewPrefs(registry
);
253 RegisterTabStripLayoutTypePrefs(registry
);
256 #if !defined(OS_ANDROID)
257 BackgroundModeManager::RegisterPrefs(registry
);
258 RegisterBrowserPrefs(registry
);
259 RegisterDefaultBrowserPromptPrefs(registry
);
262 #if defined(OS_CHROMEOS)
263 chromeos::AudioDevicesPrefHandlerImpl::RegisterPrefs(registry
);
264 chromeos::DataPromoNotification::RegisterPrefs(registry
);
265 chromeos::DeviceOAuth2TokenService::RegisterPrefs(registry
);
266 chromeos::device_settings_cache::RegisterPrefs(registry
);
267 chromeos::default_pinned_apps_field_trial::RegisterPrefs(registry
);
268 chromeos::language_prefs::RegisterPrefs(registry
);
269 chromeos::KioskAppManager::RegisterPrefs(registry
);
270 chromeos::LoginUtils::RegisterPrefs(registry
);
271 chromeos::Preferences::RegisterPrefs(registry
);
272 chromeos::proxy_config::RegisterPrefs(registry
);
273 chromeos::RegisterDisplayLocalStatePrefs(registry
);
274 chromeos::ServicesCustomizationDocument::RegisterPrefs(registry
);
275 chromeos::SigninScreenHandler::RegisterPrefs(registry
);
276 chromeos::system::AutomaticRebootManager::RegisterPrefs(registry
);
277 chromeos::UserImageManager::RegisterPrefs(registry
);
278 chromeos::UserManager::RegisterPrefs(registry
);
279 chromeos::WallpaperManager::RegisterPrefs(registry
);
280 chromeos::StartupUtils::RegisterPrefs(registry
);
281 chromeos::echo_offer::RegisterPrefs(registry
);
282 policy::AutoEnrollmentClient::RegisterPrefs(registry
);
283 policy::DeviceCloudPolicyManagerChromeOS::RegisterPrefs(registry
);
284 policy::DeviceStatusCollector::RegisterPrefs(registry
);
287 #if defined(OS_MACOSX)
288 confirm_quit::RegisterLocalState(registry
);
292 // Register prefs applicable to all profiles.
293 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable
* registry
) {
294 TRACE_EVENT0("browser", "chrome::RegisterUserPrefs");
295 // User prefs. Please keep this list alphabetized.
296 AlternateErrorPageTabObserver::RegisterProfilePrefs(registry
);
297 apps::RegisterProfilePrefs(registry
);
298 autofill::AutofillManager::RegisterProfilePrefs(registry
);
299 #if !defined(OS_ANDROID)
300 autofill::GeneratedCreditCardBubbleController::RegisterUserPrefs(registry
);
302 BookmarkPromptPrefs::RegisterProfilePrefs(registry
);
303 bookmark_utils::RegisterProfilePrefs(registry
);
304 browser_sync::SyncPrefs::RegisterProfilePrefs(registry
);
305 ChromeContentBrowserClient::RegisterProfilePrefs(registry
);
306 ChromeVersionService::RegisterProfilePrefs(registry
);
307 chrome_browser_net::HttpServerPropertiesManager::RegisterProfilePrefs(
309 chrome_browser_net::Predictor::RegisterProfilePrefs(registry
);
310 DownloadPrefs::RegisterProfilePrefs(registry
);
311 extensions::ExtensionPrefs::RegisterProfilePrefs(registry
);
312 ExtensionWebUI::RegisterProfilePrefs(registry
);
313 HostContentSettingsMap::RegisterProfilePrefs(registry
);
314 IncognitoModePrefs::RegisterProfilePrefs(registry
);
315 InstantUI::RegisterProfilePrefs(registry
);
316 MediaCaptureDevicesDispatcher::RegisterProfilePrefs(registry
);
317 MediaStreamDevicesController::RegisterProfilePrefs(registry
);
318 NetPrefObserver::RegisterProfilePrefs(registry
);
319 NewTabUI::RegisterProfilePrefs(registry
);
320 PasswordGenerationManager::RegisterProfilePrefs(registry
);
321 PasswordManager::RegisterProfilePrefs(registry
);
322 PrefProxyConfigTrackerImpl::RegisterProfilePrefs(registry
);
323 PrefsTabHelper::RegisterProfilePrefs(registry
);
324 Profile::RegisterProfilePrefs(registry
);
325 ProfileImpl::RegisterProfilePrefs(registry
);
326 PromoResourceService::RegisterProfilePrefs(registry
);
327 ProtocolHandlerRegistry::RegisterProfilePrefs(registry
);
328 RegisterBrowserUserPrefs(registry
);
329 SessionStartupPref::RegisterProfilePrefs(registry
);
330 TemplateURLPrepopulateData::RegisterProfilePrefs(registry
);
331 TranslatePrefs::RegisterProfilePrefs(registry
);
332 extensions::ActivityLog::RegisterProfilePrefs(registry
);
334 #if defined(ENABLE_AUTOFILL_DIALOG)
335 autofill::AutofillDialogController::RegisterProfilePrefs(registry
);
338 #if defined(ENABLE_CONFIGURATION_POLICY)
339 policy::URLBlacklistManager::RegisterProfilePrefs(registry
);
342 #if defined(ENABLE_MANAGED_USERS)
343 ManagedUserService::RegisterProfilePrefs(registry
);
344 ManagedUserSyncService::RegisterProfilePrefs(registry
);
347 #if defined(ENABLE_NOTIFICATIONS)
348 DesktopNotificationService::RegisterProfilePrefs(registry
);
351 #if defined(TOOLKIT_VIEWS)
352 RegisterInvertBubbleUserPrefs(registry
);
353 #elif defined(TOOLKIT_GTK)
354 BrowserWindowGtk::RegisterProfilePrefs(registry
);
357 #if defined(ENABLE_FULL_PRINTING)
358 print_dialog_cloud::RegisterProfilePrefs(registry
);
359 printing::StickySettings::RegisterProfilePrefs(registry
);
360 CloudPrintURL::RegisterProfilePrefs(registry
);
363 #if defined(OS_ANDROID)
364 PromoHandler::RegisterProfilePrefs(registry
);
368 ash::RegisterChromeLauncherUserPrefs(registry
);
371 #if !defined(OS_ANDROID)
372 DeviceIDFetcher::RegisterProfilePrefs(registry
);
373 DevToolsWindow::RegisterProfilePrefs(registry
);
374 extensions::CommandService::RegisterProfilePrefs(registry
);
375 extensions::ExtensionSettingsHandler::RegisterProfilePrefs(registry
);
376 extensions::TabsCaptureVisibleTabFunction::RegisterProfilePrefs(registry
);
377 first_run::RegisterProfilePrefs(registry
);
378 PepperFlashSettingsManager::RegisterProfilePrefs(registry
);
379 PinnedTabCodec::RegisterProfilePrefs(registry
);
380 PluginsUI::RegisterProfilePrefs(registry
);
381 RegisterAutolaunchUserPrefs(registry
);
382 signin::RegisterProfilePrefs(registry
);
385 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
386 default_apps::RegisterProfilePrefs(registry
);
389 #if defined(OS_CHROMEOS)
390 chromeos::Preferences::RegisterProfilePrefs(registry
);
391 chromeos::proxy_config::RegisterProfilePrefs(registry
);
392 extensions::EnterprisePlatformKeysPrivateChallengeUserKeyFunction::
393 RegisterProfilePrefs(registry
);
394 FlagsUI::RegisterProfilePrefs(registry
);
395 chromeos::UserImageSyncObserver::RegisterProfilePrefs(registry
);
399 NetworkProfileBubble::RegisterProfilePrefs(registry
);
402 #if defined(OS_MACOSX)
403 RegisterBrowserActionsControllerProfilePrefs(registry
);
406 // Prefs registered only for migration (clearing or moving to a new
408 registry
->RegisterDictionaryPref(
410 new DictionaryValue(),
411 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF
);
412 registry
->RegisterListPref(
414 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF
);
415 #if !defined(OS_ANDROID)
416 registry
->RegisterStringPref(
417 kSyncPromoErrorMessage
,
419 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF
);
423 void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable
* registry
) {
424 RegisterProfilePrefs(registry
);
426 #if defined(OS_CHROMEOS)
427 chromeos::PowerPrefs::RegisterUserProfilePrefs(registry
);
431 #if defined(OS_CHROMEOS)
432 void RegisterLoginProfilePrefs(user_prefs::PrefRegistrySyncable
* registry
) {
433 RegisterProfilePrefs(registry
);
435 chromeos::PowerPrefs::RegisterLoginProfilePrefs(registry
);
439 void MigrateUserPrefs(Profile
* profile
) {
440 PrefService
* prefs
= profile
->GetPrefs();
442 // Cleanup prefs from now-removed protector feature.
443 prefs
->ClearPref(kBackupPref
);
445 // Cleanup prefs from now-removed Chrome To Mobile feature.
446 prefs
->ClearPref(kChromeToMobilePref
);
448 #if !defined(OS_ANDROID)
449 // Cleanup now-removed sync promo error message preference.
450 // TODO(fdoray): Remove this when it's safe to do so (crbug.com/268442).
451 prefs
->ClearPref(kSyncPromoErrorMessage
);
454 PrefsTabHelper::MigrateUserPrefs(prefs
);
455 PromoResourceService::MigrateUserPrefs(prefs
);
456 TranslatePrefs::MigrateUserPrefs(prefs
);
458 #if defined(ENABLE_MANAGED_USERS)
459 ManagedUserService::MigrateUserPrefs(prefs
);
463 void MigrateBrowserPrefs(Profile
* profile
, PrefService
* local_state
) {
464 // Copy pref values which have been migrated to user_prefs from local_state,
465 // or remove them from local_state outright, if copying is not required.
466 int current_version
=
467 local_state
->GetInteger(prefs::kMultipleProfilePrefMigration
);
468 PrefRegistrySimple
* registry
= static_cast<PrefRegistrySimple
*>(
469 local_state
->DeprecatedGetPrefRegistry());
471 if (!(current_version
& DNS_PREFS
)) {
472 registry
->RegisterListPref(prefs::kDnsStartupPrefetchList
);
473 local_state
->ClearPref(prefs::kDnsStartupPrefetchList
);
475 registry
->RegisterListPref(prefs::kDnsHostReferralList
);
476 local_state
->ClearPref(prefs::kDnsHostReferralList
);
478 current_version
|= DNS_PREFS
;
479 local_state
->SetInteger(prefs::kMultipleProfilePrefMigration
,
483 PrefService
* user_prefs
= profile
->GetPrefs();
484 if (!(current_version
& WINDOWS_PREFS
)) {
485 registry
->RegisterIntegerPref(prefs::kDevToolsHSplitLocation
, -1);
486 if (local_state
->HasPrefPath(prefs::kDevToolsHSplitLocation
)) {
487 user_prefs
->SetInteger(
488 prefs::kDevToolsHSplitLocation
,
489 local_state
->GetInteger(prefs::kDevToolsHSplitLocation
));
491 local_state
->ClearPref(prefs::kDevToolsHSplitLocation
);
493 registry
->RegisterDictionaryPref(prefs::kBrowserWindowPlacement
);
494 if (local_state
->HasPrefPath(prefs::kBrowserWindowPlacement
)) {
495 const PrefService::Preference
* pref
=
496 local_state
->FindPreference(prefs::kBrowserWindowPlacement
);
498 user_prefs
->Set(prefs::kBrowserWindowPlacement
,
499 *(pref
->GetValue()));
501 local_state
->ClearPref(prefs::kBrowserWindowPlacement
);
503 current_version
|= WINDOWS_PREFS
;
504 local_state
->SetInteger(prefs::kMultipleProfilePrefMigration
,
508 if (!(current_version
& GOOGLE_URL_TRACKER_PREFS
)) {
509 GoogleURLTrackerFactory::GetInstance()->RegisterUserPrefsOnBrowserContext(
511 registry
->RegisterStringPref(prefs::kLastKnownGoogleURL
,
512 GoogleURLTracker::kDefaultGoogleHomepage
);
513 if (local_state
->HasPrefPath(prefs::kLastKnownGoogleURL
)) {
514 user_prefs
->SetString(prefs::kLastKnownGoogleURL
,
515 local_state
->GetString(prefs::kLastKnownGoogleURL
));
517 local_state
->ClearPref(prefs::kLastKnownGoogleURL
);
519 registry
->RegisterStringPref(prefs::kLastPromptedGoogleURL
,
521 if (local_state
->HasPrefPath(prefs::kLastPromptedGoogleURL
)) {
522 user_prefs
->SetString(
523 prefs::kLastPromptedGoogleURL
,
524 local_state
->GetString(prefs::kLastPromptedGoogleURL
));
526 local_state
->ClearPref(prefs::kLastPromptedGoogleURL
);
528 current_version
|= GOOGLE_URL_TRACKER_PREFS
;
529 local_state
->SetInteger(prefs::kMultipleProfilePrefMigration
,
534 } // namespace chrome