Lines Matching full:user_prefs
24 TranslatePrefs::TranslatePrefs(PrefService* user_prefs)
25 : prefs_(user_prefs) {
139 bool TranslatePrefs::CanTranslate(PrefService* user_prefs,
141 TranslatePrefs prefs(user_prefs);
147 bool TranslatePrefs::ShouldAutoTranslate(PrefService* user_prefs,
149 TranslatePrefs prefs(user_prefs);
153 void TranslatePrefs::RegisterUserPrefs(PrefService* user_prefs) {
154 if (!user_prefs->FindPreference(kPrefTranslateLanguageBlacklist))
155 user_prefs->RegisterListPref(kPrefTranslateLanguageBlacklist);
156 if (!user_prefs->FindPreference(kPrefTranslateSiteBlacklist))
157 user_prefs->RegisterListPref(kPrefTranslateSiteBlacklist);
158 if (!user_prefs->FindPreference(kPrefTranslateWhitelists)) {
159 user_prefs->RegisterDictionaryPref(kPrefTranslateWhitelists);
160 MigrateTranslateWhitelists(user_prefs);
162 if (!user_prefs->FindPreference(kPrefTranslateDeniedCount))
163 user_prefs->RegisterDictionaryPref(kPrefTranslateDeniedCount);
164 if (!user_prefs->FindPreference(kPrefTranslateAcceptedCount))
165 user_prefs->RegisterDictionaryPref(kPrefTranslateAcceptedCount);
170 void TranslatePrefs::MigrateTranslateWhitelists(PrefService* user_prefs) {
187 DictionaryPrefUpdate update(user_prefs, kPrefTranslateWhitelists);
207 user_prefs->ScheduleSavePersistentPrefs();