Chromium Code Reviews| 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 "content/browser/speech/speech_input_preferences.h" | |
| 6 | |
| 7 #include "base/basictypes.h" | |
| 8 #include "content/browser/browser_thread.h" | |
| 9 | |
| 10 SpeechInputPreferences::SpeechInputPreferences(bool censor_results) | |
| 11 : censor_results_(censor_results){ | |
|
Satish
2011/09/23 16:31:54
if we pass a pref store here, there should be a pr
allanwoj
2011/09/26 13:05:15
Uses initializer list, as discussed.
| |
| 12 } | |
| 13 | |
| 14 SpeechInputPreferences::~SpeechInputPreferences() { | |
| 15 } | |
| 16 | |
| 17 bool SpeechInputPreferences::censor_results() const { | |
| 18 return censor_results_; | |
|
Satish
2011/09/23 16:31:54
add a dcheck to verify that we are in the IO threa
allanwoj
2011/09/26 13:05:15
Done.
| |
| 19 } | |
| 20 | |
| 21 void SpeechInputPreferences::set_censor_results(bool censor_results) { | |
| 22 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { | |
| 23 BrowserThread::PostTask( | |
| 24 BrowserThread::IO, FROM_HERE, | |
| 25 NewRunnableMethod(this, &SpeechInputPreferences::set_censor_results, | |
| 26 censor_results)); | |
| 27 return; | |
| 28 } | |
| 29 censor_results_ = censor_results; | |
| 30 } | |
| OLD | NEW |