diff options
author | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-09 06:19:16 +0000 |
---|---|---|
committer | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-09 06:19:16 +0000 |
commit | d36f941bbea3e9fa6d13829626a1911008b37f17 (patch) | |
tree | d7b3e6a109c39557bd30154407c000f0bb730339 /chrome/browser/translate | |
parent | 838dd914a5bd6a049915984c9619d69ef160b82e (diff) | |
download | chromium_src-d36f941bbea3e9fa6d13829626a1911008b37f17.zip chromium_src-d36f941bbea3e9fa6d13829626a1911008b37f17.tar.gz chromium_src-d36f941bbea3e9fa6d13829626a1911008b37f17.tar.bz2 |
Refactor preference syncing.
The following are the primary changes:
1. Whenever a profile preference is registered, it must specify whether that
preference should be synced or not. Local state preferences do not require this.
However, we DCHECK that local state preferences are in fact registered to the
local state.
2. We've created a new sync model associator interface, which all datatypes
will eventually implement. This new model associator is designed to be
decoupled from much of the sync internals, and to be owned by the chrome service
being synced. It also implements most of the functionality previous handled by
the change processor.
3. The PrefService now owns its sync model associator
(pref_model_associator), which partially implements the new model associator
functionality. Further work will be done to remove the use of sync
transactions from the model associator, as well as to migrate other datatypes.
BUG=76232
TEST=
Review URL: http://codereview.chromium.org/6905044
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84603 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/translate')
-rw-r--r-- | chrome/browser/translate/translate_prefs.cc | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/chrome/browser/translate/translate_prefs.cc b/chrome/browser/translate/translate_prefs.cc index cc04f42..3aca798 100644 --- a/chrome/browser/translate/translate_prefs.cc +++ b/chrome/browser/translate/translate_prefs.cc @@ -152,17 +152,22 @@ bool TranslatePrefs::ShouldAutoTranslate(PrefService* user_prefs, void TranslatePrefs::RegisterUserPrefs(PrefService* user_prefs) { if (!user_prefs->FindPreference(kPrefTranslateLanguageBlacklist)) - user_prefs->RegisterListPref(kPrefTranslateLanguageBlacklist); + user_prefs->RegisterListPref(kPrefTranslateLanguageBlacklist, + PrefService::SYNCABLE_PREF); if (!user_prefs->FindPreference(kPrefTranslateSiteBlacklist)) - user_prefs->RegisterListPref(kPrefTranslateSiteBlacklist); + user_prefs->RegisterListPref(kPrefTranslateSiteBlacklist, + PrefService::SYNCABLE_PREF); if (!user_prefs->FindPreference(kPrefTranslateWhitelists)) { - user_prefs->RegisterDictionaryPref(kPrefTranslateWhitelists); + user_prefs->RegisterDictionaryPref(kPrefTranslateWhitelists, + PrefService::SYNCABLE_PREF); MigrateTranslateWhitelists(user_prefs); } if (!user_prefs->FindPreference(kPrefTranslateDeniedCount)) - user_prefs->RegisterDictionaryPref(kPrefTranslateDeniedCount); + user_prefs->RegisterDictionaryPref(kPrefTranslateDeniedCount, + PrefService::SYNCABLE_PREF); if (!user_prefs->FindPreference(kPrefTranslateAcceptedCount)) - user_prefs->RegisterDictionaryPref(kPrefTranslateAcceptedCount); + user_prefs->RegisterDictionaryPref(kPrefTranslateAcceptedCount, + PrefService::SYNCABLE_PREF); } // TranslatePrefs: private, static: -------------------------------------------- |