Fix prefs registration in SyncPrefs.

All preferences should be registered _before_ a PrefService is created,
so reading other prefs during registration is a no-no.

The previous code dynamically set a default for the
kSyncKeepEverythingSynced preference and for each data type preference
dynamically based on whether or not sync setup is complete, but during
sync setup each of these would be explicitly set anyway, overriding
the default.

The one complexity is that there is code in
ProfileSyncService::TrySyncDatatypePrefRecovery that attempts to
recover from an old bug, and it depends on checking whether the value
is default. We remove one of the checks it used, which was redundant
(the needed check is just whether the pref is still at its default
value, regardless of that default value).

TBR=ben@chromium.org
BUG=155525


Review URL: https://chromiumcodereview.appspot.com/12315053

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184800 0039d316-1c4b-4281-b951-d872f2087c98
10 files changed