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 "apps/prefs.h" | 7 #include "apps/prefs.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/prefs/pref_registry_simple.h" | 9 #include "base/prefs/pref_registry_simple.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 registry->RegisterDictionaryPref( | 471 registry->RegisterDictionaryPref( |
472 kBackupPref, | 472 kBackupPref, |
473 new base::DictionaryValue(), | 473 new base::DictionaryValue(), |
474 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 474 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
475 #if !defined(OS_ANDROID) | 475 #if !defined(OS_ANDROID) |
476 registry->RegisterStringPref( | 476 registry->RegisterStringPref( |
477 kSyncPromoErrorMessage, | 477 kSyncPromoErrorMessage, |
478 std::string(), | 478 std::string(), |
479 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 479 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
480 #endif | 480 #endif |
481 | |
482 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) | |
483 RegisterNewProfileUIPrefs(registry); | |
484 #endif | |
485 } | 481 } |
486 | 482 |
487 void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { | 483 void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { |
488 RegisterProfilePrefs(registry); | 484 RegisterProfilePrefs(registry); |
489 | 485 |
490 #if defined(OS_CHROMEOS) | 486 #if defined(OS_CHROMEOS) |
491 chromeos::PowerPrefs::RegisterUserProfilePrefs(registry); | 487 chromeos::PowerPrefs::RegisterUserProfilePrefs(registry); |
492 #endif | 488 #endif |
493 } | 489 } |
494 | 490 |
495 void RegisterScreenshotPrefs(PrefRegistrySimple* registry) { | 491 void RegisterScreenshotPrefs(PrefRegistrySimple* registry) { |
496 registry->RegisterBooleanPref(prefs::kDisableScreenshots, false); | 492 registry->RegisterBooleanPref(prefs::kDisableScreenshots, false); |
497 } | 493 } |
498 | 494 |
499 #if defined(OS_CHROMEOS) | 495 #if defined(OS_CHROMEOS) |
500 void RegisterLoginProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { | 496 void RegisterLoginProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { |
501 RegisterProfilePrefs(registry); | 497 RegisterProfilePrefs(registry); |
502 | 498 |
503 chromeos::PowerPrefs::RegisterLoginProfilePrefs(registry); | 499 chromeos::PowerPrefs::RegisterLoginProfilePrefs(registry); |
504 } | 500 } |
505 #endif | 501 #endif |
506 | 502 |
507 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) | |
508 void RegisterNewProfileUIPrefs(user_prefs::PrefRegistrySyncable* registry) { | |
509 registry->RegisterIntegerPref( | |
510 prefs::kProfileAvatarTutorialShown, | |
511 0, | |
512 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
513 } | |
514 #endif | |
515 | |
516 void MigrateUserPrefs(Profile* profile) { | 503 void MigrateUserPrefs(Profile* profile) { |
517 PrefService* prefs = profile->GetPrefs(); | 504 PrefService* prefs = profile->GetPrefs(); |
518 | 505 |
519 // Cleanup prefs from now-removed protector feature. | 506 // Cleanup prefs from now-removed protector feature. |
520 prefs->ClearPref(kBackupPref); | 507 prefs->ClearPref(kBackupPref); |
521 | 508 |
522 #if !defined(OS_ANDROID) | 509 #if !defined(OS_ANDROID) |
523 // Cleanup now-removed sync promo error message preference. | 510 // Cleanup now-removed sync promo error message preference. |
524 // TODO(fdoray): Remove this when it's safe to do so (crbug.com/268442). | 511 // TODO(fdoray): Remove this when it's safe to do so (crbug.com/268442). |
525 prefs->ClearPref(kSyncPromoErrorMessage); | 512 prefs->ClearPref(kSyncPromoErrorMessage); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 local_state->SetInteger(prefs::kMultipleProfilePrefMigration, | 579 local_state->SetInteger(prefs::kMultipleProfilePrefMigration, |
593 current_version); | 580 current_version); |
594 } | 581 } |
595 | 582 |
596 #if defined(OS_CHROMEOS) | 583 #if defined(OS_CHROMEOS) |
597 chromeos::default_pinned_apps_field_trial::MigratePrefs(local_state); | 584 chromeos::default_pinned_apps_field_trial::MigratePrefs(local_state); |
598 #endif | 585 #endif |
599 } | 586 } |
600 | 587 |
601 } // namespace chrome | 588 } // namespace chrome |
OLD | NEW |