OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 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 "chrome/browser/prefs/browser_prefs.h" | 5 #include "chrome/browser/prefs/browser_prefs.h" |
6 | 6 |
7 #include "chrome/browser/about_flags.h" | 7 #include "chrome/browser/about_flags.h" |
8 #include "chrome/browser/accessibility/invert_bubble_prefs.h" | 8 #include "chrome/browser/accessibility/invert_bubble_prefs.h" |
9 #include "chrome/browser/autofill/autofill_manager.h" | 9 #include "chrome/browser/autofill/autofill_manager.h" |
10 #include "chrome/browser/background/background_mode_manager.h" | 10 #include "chrome/browser/background/background_mode_manager.h" |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 #if defined(OS_CHROMEOS) | 298 #if defined(OS_CHROMEOS) |
299 chromeos::Preferences::RegisterUserPrefs(user_prefs); | 299 chromeos::Preferences::RegisterUserPrefs(user_prefs); |
300 chromeos::ProxyConfigServiceImpl::RegisterPrefs(user_prefs); | 300 chromeos::ProxyConfigServiceImpl::RegisterPrefs(user_prefs); |
301 #endif | 301 #endif |
302 | 302 |
303 #if defined(OS_WIN) | 303 #if defined(OS_WIN) |
304 NetworkProfileBubble::RegisterPrefs(user_prefs); | 304 NetworkProfileBubble::RegisterPrefs(user_prefs); |
305 #endif | 305 #endif |
306 } | 306 } |
307 | 307 |
| 308 void MigrateUserPrefs(Profile* profile) { |
| 309 // Cleanup old prefs. |
| 310 static const char kBackupPref[] = "backup"; |
| 311 PrefService* prefs = profile->GetPrefs(); |
| 312 prefs->RegisterDictionaryPref(kBackupPref, new DictionaryValue(), |
| 313 PrefService::UNSYNCABLE_PREF); |
| 314 prefs->ClearPref(kBackupPref); |
| 315 prefs->UnregisterPreference(kBackupPref); |
| 316 } |
| 317 |
308 void MigrateBrowserPrefs(Profile* profile, PrefService* local_state) { | 318 void MigrateBrowserPrefs(Profile* profile, PrefService* local_state) { |
309 // Copy pref values which have been migrated to user_prefs from local_state, | 319 // Copy pref values which have been migrated to user_prefs from local_state, |
310 // or remove them from local_state outright, if copying is not required. | 320 // or remove them from local_state outright, if copying is not required. |
311 int current_version = | 321 int current_version = |
312 local_state->GetInteger(prefs::kMultipleProfilePrefMigration); | 322 local_state->GetInteger(prefs::kMultipleProfilePrefMigration); |
313 | 323 |
314 if (!(current_version & DNS_PREFS)) { | 324 if (!(current_version & DNS_PREFS)) { |
315 local_state->RegisterListPref(prefs::kDnsStartupPrefetchList, | 325 local_state->RegisterListPref(prefs::kDnsStartupPrefetchList, |
316 PrefService::UNSYNCABLE_PREF); | 326 PrefService::UNSYNCABLE_PREF); |
317 local_state->ClearPref(prefs::kDnsStartupPrefetchList); | 327 local_state->ClearPref(prefs::kDnsStartupPrefetchList); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 } | 376 } |
367 local_state->ClearPref(prefs::kLastPromptedGoogleURL); | 377 local_state->ClearPref(prefs::kLastPromptedGoogleURL); |
368 | 378 |
369 current_version |= GOOGLE_URL_TRACKER_PREFS; | 379 current_version |= GOOGLE_URL_TRACKER_PREFS; |
370 local_state->SetInteger(prefs::kMultipleProfilePrefMigration, | 380 local_state->SetInteger(prefs::kMultipleProfilePrefMigration, |
371 current_version); | 381 current_version); |
372 } | 382 } |
373 } | 383 } |
374 | 384 |
375 } // namespace chrome | 385 } // namespace chrome |
OLD | NEW |