Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Unified Diff: chrome/browser/speech/chrome_speech_input_preferences.cc

Issue 8199010: Fixing misleading name a in speech input setting and related variables. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/speech/chrome_speech_input_preferences.cc
diff --git a/chrome/browser/speech/chrome_speech_input_preferences.cc b/chrome/browser/speech/chrome_speech_input_preferences.cc
index e6a298271e758e10f9cbf75244633245d492d0ef..f007e2a5ad0aac8b3552d19b1be8ebe4df02858a 100644
--- a/chrome/browser/speech/chrome_speech_input_preferences.cc
+++ b/chrome/browser/speech/chrome_speech_input_preferences.cc
@@ -10,26 +10,36 @@
#include "content/browser/browser_thread.h"
ChromeSpeechInputPreferences::ChromeSpeechInputPreferences(
- PrefService* pref_service)
- : censor_results_(
- pref_service->GetBoolean(prefs::kSpeechInputCensorResults)) {
+ PrefService* pref_service) {
+ // Migrate the old profanity filtering key to the new one.
Satish 2011/10/07 20:09:26 may be simpler to leave the name of the preference
Leandro GraciĆ” Gil 2011/10/07 23:22:09 Agreed. I'll leave a comment to make sure the old
+ if (pref_service->HasPrefPath(prefs::kSpeechInputCensorResultsDeprecated)) {
+ bool filter = pref_service->GetBoolean(
+ prefs::kSpeechInputCensorResultsDeprecated);
+ pref_service->ClearPref(prefs::kSpeechInputCensorResultsDeprecated);
+ pref_service->SetBoolean(prefs::kSpeechInputFilterProfanities, filter);
+ filter_profanities_ = filter;
+ } else {
+ filter_profanities_ = pref_service->GetBoolean(
+ prefs::kSpeechInputFilterProfanities);
+ }
}
ChromeSpeechInputPreferences::~ChromeSpeechInputPreferences() {
}
-bool ChromeSpeechInputPreferences::censor_results() const {
+bool ChromeSpeechInputPreferences::filter_profanities() const {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- return censor_results_;
+ return filter_profanities_;
}
-void ChromeSpeechInputPreferences::set_censor_results(bool censor_results) {
+void ChromeSpeechInputPreferences::set_filter_profanities(
+ bool filter_profanities) {
if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
- base::Bind(&ChromeSpeechInputPreferences::set_censor_results,
- this, censor_results));
+ base::Bind(&ChromeSpeechInputPreferences::set_filter_profanities,
+ this, filter_profanities));
return;
}
- censor_results_ = censor_results;
+ filter_profanities_ = filter_profanities;
}

Powered by Google App Engine
This is Rietveld 408576698