OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/speech/chrome_speech_input_preferences.h" | 5 #include "chrome/browser/speech/chrome_speech_recognition_preferences.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "chrome/browser/prefs/pref_service.h" | 8 #include "chrome/browser/prefs/pref_service.h" |
9 #include "chrome/common/pref_names.h" | 9 #include "chrome/common/pref_names.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
11 | 11 |
12 using content::BrowserThread; | 12 using content::BrowserThread; |
13 | 13 |
14 ChromeSpeechInputPreferences::ChromeSpeechInputPreferences( | 14 ChromeSpeechRecognitionPreferences::ChromeSpeechRecognitionPreferences( |
15 PrefService* pref_service) | 15 PrefService* pref_service) |
16 : filter_profanities_( | 16 : filter_profanities_( |
17 pref_service->GetBoolean(prefs::kSpeechInputFilterProfanities)) { | 17 pref_service->GetBoolean(prefs::kSpeechRecognitionFilterProfanities)){ |
18 } | 18 } |
19 | 19 |
20 ChromeSpeechInputPreferences::~ChromeSpeechInputPreferences() { | 20 ChromeSpeechRecognitionPreferences::~ChromeSpeechRecognitionPreferences() { |
21 } | 21 } |
22 | 22 |
23 bool ChromeSpeechInputPreferences::FilterProfanities() const { | 23 bool ChromeSpeechRecognitionPreferences::FilterProfanities() const { |
24 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 24 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
25 return filter_profanities_; | 25 return filter_profanities_; |
26 } | 26 } |
27 | 27 |
28 void ChromeSpeechInputPreferences::SetFilterProfanities( | 28 void ChromeSpeechRecognitionPreferences::SetFilterProfanities( |
29 bool filter_profanities) { | 29 bool filter_profanities) { |
30 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { | 30 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { |
31 BrowserThread::PostTask( | 31 BrowserThread::PostTask( |
32 BrowserThread::IO, FROM_HERE, | 32 BrowserThread::IO, FROM_HERE, |
33 base::Bind(&ChromeSpeechInputPreferences::SetFilterProfanities, | 33 base::Bind(&ChromeSpeechRecognitionPreferences::SetFilterProfanities, |
34 this, filter_profanities)); | 34 this, filter_profanities)); |
35 return; | 35 return; |
36 } | 36 } |
37 filter_profanities_ = filter_profanities; | 37 filter_profanities_ = filter_profanities; |
38 } | 38 } |
OLD | NEW |