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

Side by Side Diff: chrome/browser/speech/chrome_speech_recognition_preferences.cc

Issue 10908088: Cleanup: Constify some ProfileKeyedBaseFactory methods and all overrides. Remove ProfileKeyedBaseFa… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: rebase, remove a few more lines of code Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 71 bool ChromeSpeechRecognitionPreferences::Factory::
72 ChromeSpeechRecognitionPreferences::Factory::ServiceRedirectedInIncognito() { 72 ServiceRedirectedInIncognito() const {
73 return false; 73 return false;
74 } 74 }
75 75
76 bool ChromeSpeechRecognitionPreferences::Factory::ServiceIsNULLWhileTesting() { 76 bool ChromeSpeechRecognitionPreferences::Factory::
77 ServiceIsNULLWhileTesting() const {
77 return true; 78 return true;
78 } 79 }
79 80
80 bool 81 bool ChromeSpeechRecognitionPreferences::Factory::
81 ChromeSpeechRecognitionPreferences::Factory::ServiceIsCreatedWithProfile() { 82 ServiceIsCreatedWithProfile() const {
82 return false; 83 return false;
83 } 84 }
84 85
85 ChromeSpeechRecognitionPreferences::Service::Service( 86 ChromeSpeechRecognitionPreferences::Service::Service(
86 Profile* profile) 87 Profile* profile)
87 : preferences_(new ChromeSpeechRecognitionPreferences(profile)) { 88 : preferences_(new ChromeSpeechRecognitionPreferences(profile)) {
88 } 89 }
89 90
90 ChromeSpeechRecognitionPreferences::Service::~Service() { 91 ChromeSpeechRecognitionPreferences::Service::~Service() {
91 } 92 }
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 if (key == prefs::kSpeechRecognitionFilterProfanities) { 205 if (key == prefs::kSpeechRecognitionFilterProfanities) {
205 filter_profanities_ = 206 filter_profanities_ =
206 pref_service->GetBoolean(prefs::kSpeechRecognitionFilterProfanities); 207 pref_service->GetBoolean(prefs::kSpeechRecognitionFilterProfanities);
207 } else if (key == prefs::kSpeechRecognitionTrayNotificationShownContexts) { 208 } else if (key == prefs::kSpeechRecognitionTrayNotificationShownContexts) {
208 const base::ListValue* pref_list = profile_->GetPrefs()->GetList( 209 const base::ListValue* pref_list = profile_->GetPrefs()->GetList(
209 prefs::kSpeechRecognitionTrayNotificationShownContexts); 210 prefs::kSpeechRecognitionTrayNotificationShownContexts);
210 DCHECK(pref_list); 211 DCHECK(pref_list);
211 notifications_shown_.reset(pref_list->DeepCopy()); 212 notifications_shown_.reset(pref_list->DeepCopy());
212 } 213 }
213 } 214 }
OLDNEW
« no previous file with comments | « chrome/browser/speech/chrome_speech_recognition_preferences.h ('k') | chrome/browser/speech/speech_input_extension_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698