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

Unified Diff: chrome/browser/profiles/profile_impl.cc

Issue 7989001: Remove use of default request context and fix use of speech censor flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update SpeechInputPreferences when preference changes Created 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/profiles/profile_impl.cc
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
index be393ae5584660f493534d0b4795260d80a4604d..f3844d70178b68fc788ca4c8832099641d5e4158 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -101,6 +101,7 @@
#include "content/browser/in_process_webkit/webkit_context.h"
#include "content/browser/renderer_host/render_process_host.h"
#include "content/browser/speech/speech_input_manager.h"
+#include "content/browser/speech/speech_input_preferences.h"
#include "content/browser/ssl/ssl_host_state.h"
#include "content/browser/user_metrics.h"
#include "content/common/notification_service.h"
@@ -451,9 +452,6 @@ void ProfileImpl::DoFinalInit() {
GetSpellCheckProfile()->StartRecordingMetrics(
GetPrefs()->GetBoolean(prefs::kEnableSpellCheck));
- speech_input::ChromeSpeechInputManager::GetInstance()->set_censor_results(
- prefs->GetBoolean(prefs::kSpeechInputCensorResults));
-
FilePath cookie_path = GetPath();
cookie_path = cookie_path.Append(chrome::kCookieFilename);
FilePath origin_bound_cert_path = GetPath();
@@ -1144,6 +1142,13 @@ GeolocationPermissionContext* ProfileImpl::GetGeolocationPermissionContext() {
return geolocation_permission_context_.get();
}
+SpeechInputPreferences* ProfileImpl::GetSpeechInputPreferences() {
+ if (!speech_input_preferences_.get())
Satish 2011/09/23 16:31:54 suggest using braces for multi-line if blocks like
allanwoj 2011/09/26 13:05:15 Done.
+ speech_input_preferences_ = new SpeechInputPreferences(
+ GetPrefs()->GetBoolean(prefs::kSpeechInputCensorResults));
+ return speech_input_preferences_.get();
+}
+
UserStyleSheetWatcher* ProfileImpl::GetUserStyleSheetWatcher() {
if (!user_style_sheet_watcher_.get()) {
user_style_sheet_watcher_ = new UserStyleSheetWatcher(GetPath());
@@ -1549,9 +1554,8 @@ void ProfileImpl::Observe(int type,
process->Send(new SpellCheckMsg_EnableAutoSpellCorrect(enabled));
}
} else if (*pref_name_in == prefs::kSpeechInputCensorResults) {
- speech_input::ChromeSpeechInputManager::GetInstance()->
- set_censor_results(prefs->GetBoolean(
- prefs::kSpeechInputCensorResults));
+ GetSpeechInputPreferences()->set_censor_results(prefs->GetBoolean(
+ prefs::kSpeechInputCensorResults));
} else if (*pref_name_in == prefs::kClearSiteDataOnExit) {
clear_local_state_on_exit_ =
prefs->GetBoolean(prefs::kClearSiteDataOnExit);

Powered by Google App Engine
This is Rietveld 408576698