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

Unified Diff: chrome/browser/speech/speech_input_dispatcher_host.cc

Issue 6353005: Revert r70896 to move speech input back behind a flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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
« no previous file with comments | « chrome/browser/speech/speech_input_browsertest.cc ('k') | chrome/browser/speech/speech_input_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/speech/speech_input_dispatcher_host.cc
diff --git a/chrome/browser/speech/speech_input_dispatcher_host.cc b/chrome/browser/speech/speech_input_dispatcher_host.cc
index 5e1daab14439cac490b3b6a0d8c5d72f1bdcebd4..50b9aec9d86e54f6e95a6a25b8a510139615aabd 100644
--- a/chrome/browser/speech/speech_input_dispatcher_host.cc
+++ b/chrome/browser/speech/speech_input_dispatcher_host.cc
@@ -121,18 +121,29 @@ SpeechInputManager* SpeechInputDispatcherHost::manager() {
bool SpeechInputDispatcherHost::OnMessageReceived(
const IPC::Message& message, bool* message_was_ok) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- bool handled = true;
- IPC_BEGIN_MESSAGE_MAP_EX(SpeechInputDispatcherHost, message,
- *message_was_ok)
- IPC_MESSAGE_HANDLER(ViewHostMsg_SpeechInput_StartRecognition,
- OnStartRecognition)
- IPC_MESSAGE_HANDLER(ViewHostMsg_SpeechInput_CancelRecognition,
- OnCancelRecognition)
- IPC_MESSAGE_HANDLER(ViewHostMsg_SpeechInput_StopRecording,
- OnStopRecording)
- IPC_MESSAGE_UNHANDLED(handled = false)
- IPC_END_MESSAGE_MAP()
- return handled;
+
+ uint32 message_type = message.type();
+ if (message_type == ViewHostMsg_SpeechInput_StartRecognition::ID ||
+ message_type == ViewHostMsg_SpeechInput_CancelRecognition::ID ||
+ message_type == ViewHostMsg_SpeechInput_StopRecording::ID) {
+ if (!SpeechInputManager::IsFeatureEnabled()) {
+ *message_was_ok = false;
+ return true;
+ }
+
+ IPC_BEGIN_MESSAGE_MAP_EX(SpeechInputDispatcherHost, message,
+ *message_was_ok)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_SpeechInput_StartRecognition,
+ OnStartRecognition)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_SpeechInput_CancelRecognition,
+ OnCancelRecognition)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_SpeechInput_StopRecording,
+ OnStopRecording)
+ IPC_END_MESSAGE_MAP()
+ return true;
+ }
+
+ return false;
}
void SpeechInputDispatcherHost::OnStartRecognition(
« no previous file with comments | « chrome/browser/speech/speech_input_browsertest.cc ('k') | chrome/browser/speech/speech_input_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698