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_recognition_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 "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/prefs/pref_service.h" | 9 #include "chrome/browser/prefs/pref_service.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 prefs->RegisterBooleanPref( | 61 prefs->RegisterBooleanPref( |
62 prefs::kSpeechRecognitionFilterProfanities, | 62 prefs::kSpeechRecognitionFilterProfanities, |
63 kDefaultFilterProfanities, | 63 kDefaultFilterProfanities, |
64 PrefService::UNSYNCABLE_PREF); | 64 PrefService::UNSYNCABLE_PREF); |
65 | 65 |
66 prefs->RegisterListPref( | 66 prefs->RegisterListPref( |
67 prefs::kSpeechRecognitionTrayNotificationShownContexts, | 67 prefs::kSpeechRecognitionTrayNotificationShownContexts, |
68 PrefService::UNSYNCABLE_PREF); | 68 PrefService::UNSYNCABLE_PREF); |
69 } | 69 } |
70 | 70 |
| 71 bool |
| 72 ChromeSpeechRecognitionPreferences::Factory::ServiceRedirectedInIncognito() { |
| 73 return false; |
| 74 } |
| 75 |
| 76 bool ChromeSpeechRecognitionPreferences::Factory::ServiceIsNULLWhileTesting() { |
| 77 return true; |
| 78 } |
| 79 |
| 80 bool |
| 81 ChromeSpeechRecognitionPreferences::Factory::ServiceIsCreatedWithProfile() { |
| 82 return false; |
| 83 } |
| 84 |
71 ChromeSpeechRecognitionPreferences::Service::Service( | 85 ChromeSpeechRecognitionPreferences::Service::Service( |
72 Profile* profile) | 86 Profile* profile) |
73 : preferences_(new ChromeSpeechRecognitionPreferences(profile)) { | 87 : preferences_(new ChromeSpeechRecognitionPreferences(profile)) { |
74 } | 88 } |
75 | 89 |
76 ChromeSpeechRecognitionPreferences::Service::~Service() { | 90 ChromeSpeechRecognitionPreferences::Service::~Service() { |
77 } | 91 } |
78 | 92 |
79 void ChromeSpeechRecognitionPreferences::Service::Shutdown() { | 93 void ChromeSpeechRecognitionPreferences::Service::Shutdown() { |
80 DCHECK(preferences_); | 94 DCHECK(preferences_); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 if (key == prefs::kSpeechRecognitionFilterProfanities) { | 204 if (key == prefs::kSpeechRecognitionFilterProfanities) { |
191 filter_profanities_ = | 205 filter_profanities_ = |
192 pref_service->GetBoolean(prefs::kSpeechRecognitionFilterProfanities); | 206 pref_service->GetBoolean(prefs::kSpeechRecognitionFilterProfanities); |
193 } else if (key == prefs::kSpeechRecognitionTrayNotificationShownContexts) { | 207 } else if (key == prefs::kSpeechRecognitionTrayNotificationShownContexts) { |
194 const base::ListValue* pref_list = profile_->GetPrefs()->GetList( | 208 const base::ListValue* pref_list = profile_->GetPrefs()->GetList( |
195 prefs::kSpeechRecognitionTrayNotificationShownContexts); | 209 prefs::kSpeechRecognitionTrayNotificationShownContexts); |
196 DCHECK(pref_list); | 210 DCHECK(pref_list); |
197 notifications_shown_.reset(pref_list->DeepCopy()); | 211 notifications_shown_.reset(pref_list->DeepCopy()); |
198 } | 212 } |
199 } | 213 } |
OLD | NEW |