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

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

Issue 7086005: Context menu for "Voice recognition options" (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Context menu for "Voice recognition options" only appears when input-field has x-webkit-speech Created 9 years, 5 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 0cbc653fe489f536df0a09c2f0652d9f36034197..c347fcb4ea62eab5f0fa07b634e3d1a13f1ad505 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -92,6 +92,7 @@
#include "content/browser/host_zoom_map.h"
#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/ssl/ssl_host_state.h"
#include "content/browser/user_metrics.h"
#include "content/common/notification_service.h"
@@ -328,6 +329,7 @@ void ProfileImpl::DoFinalInit() {
pref_change_registrar_.Add(prefs::kSpellCheckDictionary, this);
pref_change_registrar_.Add(prefs::kEnableSpellCheck, this);
pref_change_registrar_.Add(prefs::kEnableAutoSpellCorrect, this);
+ pref_change_registrar_.Add(prefs::kSpeechInputCensorResults, this);
pref_change_registrar_.Add(prefs::kClearSiteDataOnExit, this);
pref_change_registrar_.Add(prefs::kGoogleServicesUsername, this);
pref_change_registrar_.Add(prefs::kDefaultZoomLevel, this);
@@ -400,6 +402,9 @@ void ProfileImpl::DoFinalInit() {
GetPrefs()->GetBoolean(prefs::kEnableSpellCheck));
}
+ speech_input::SpeechInputManager::Get()->NotifyCensorResults(
+ prefs->GetBoolean(prefs::kSpeechInputCensorResults));
+
FilePath cookie_path = GetPath();
cookie_path = cookie_path.Append(chrome::kCookieFilename);
FilePath cache_path = base_cache_path_;
@@ -1386,6 +1391,9 @@ void ProfileImpl::Observe(int type,
RenderProcessHost* process = i.GetCurrentValue();
process->Send(new SpellCheckMsg_EnableAutoSpellCorrect(enabled));
}
+ } else if (*pref_name_in == prefs::kSpeechInputCensorResults) {
+ speech_input::SpeechInputManager::Get()->NotifyCensorResults(
+ 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