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

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

Issue 6610022: Enable speech input by default and remove unused code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 10 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 | « content/browser/speech/speech_input_browsertest.cc ('k') | content/browser/speech/speech_input_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/speech/speech_input_dispatcher_host.cc
diff --git a/content/browser/speech/speech_input_dispatcher_host.cc b/content/browser/speech/speech_input_dispatcher_host.cc
index 84e2a9530ada6de74718f08ce3169ee3e424917c..d721fee6f5d326f17d2204285cb76e37aa891964 100644
--- a/content/browser/speech/speech_input_dispatcher_host.cc
+++ b/content/browser/speech/speech_input_dispatcher_host.cc
@@ -129,30 +129,18 @@ SpeechInputManager* SpeechInputDispatcherHost::manager() {
bool SpeechInputDispatcherHost::OnMessageReceived(
const IPC::Message& message, bool* message_was_ok) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
-
- uint32 message_type = message.type();
- if (message_type == SpeechInputHostMsg_StartRecognition::ID ||
- message_type == SpeechInputHostMsg_CancelRecognition::ID ||
- message_type == SpeechInputHostMsg_StopRecording::ID) {
- if (!SpeechInputManager::IsFeatureEnabled()) {
- *message_was_ok = false;
- return true;
- }
-
- may_have_pending_requests_ = true;
- IPC_BEGIN_MESSAGE_MAP_EX(SpeechInputDispatcherHost, message,
- *message_was_ok)
- IPC_MESSAGE_HANDLER(SpeechInputHostMsg_StartRecognition,
- OnStartRecognition)
- IPC_MESSAGE_HANDLER(SpeechInputHostMsg_CancelRecognition,
- OnCancelRecognition)
- IPC_MESSAGE_HANDLER(SpeechInputHostMsg_StopRecording,
- OnStopRecording)
- IPC_END_MESSAGE_MAP()
- return true;
- }
-
- return false;
+ bool handled = true;
+ IPC_BEGIN_MESSAGE_MAP_EX(SpeechInputDispatcherHost, message,
+ *message_was_ok)
+ IPC_MESSAGE_HANDLER(SpeechInputHostMsg_StartRecognition,
+ OnStartRecognition)
+ IPC_MESSAGE_HANDLER(SpeechInputHostMsg_CancelRecognition,
+ OnCancelRecognition)
+ IPC_MESSAGE_HANDLER(SpeechInputHostMsg_StopRecording,
+ OnStopRecording)
+ IPC_MESSAGE_UNHANDLED(handled = false)
+ IPC_END_MESSAGE_MAP()
+ return handled;
}
void SpeechInputDispatcherHost::OnStartRecognition(
« no previous file with comments | « content/browser/speech/speech_input_browsertest.cc ('k') | content/browser/speech/speech_input_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698