| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/speech/chrome_speech_input_preferences.h" |
| 6 |
| 7 #include "base/bind.h" |
| 8 #include "chrome/browser/prefs/pref_service.h" |
| 9 #include "chrome/common/pref_names.h" |
| 10 #include "content/browser/browser_thread.h" |
| 11 |
| 12 ChromeSpeechInputPreferences::ChromeSpeechInputPreferences( |
| 13 PrefService* pref_service) |
| 14 : censor_results_( |
| 15 pref_service->GetBoolean(prefs::kSpeechInputCensorResults)) { |
| 16 } |
| 17 |
| 18 ChromeSpeechInputPreferences::~ChromeSpeechInputPreferences() { |
| 19 } |
| 20 |
| 21 bool ChromeSpeechInputPreferences::censor_results() const { |
| 22 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 23 return censor_results_; |
| 24 } |
| 25 |
| 26 void ChromeSpeechInputPreferences::set_censor_results(bool censor_results) { |
| 27 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { |
| 28 BrowserThread::PostTask( |
| 29 BrowserThread::IO, FROM_HERE, |
| 30 base::Bind(&ChromeSpeechInputPreferences::set_censor_results, |
| 31 this, censor_results)); |
| 32 return; |
| 33 } |
| 34 censor_results_ = censor_results; |
| 35 } |
| OLD | NEW |