OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/browser/speech/speech_input_dispatcher_host.h" | 5 #include "content/browser/speech/speech_input_dispatcher_host.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "content/browser/content_browser_client.h" | 8 #include "content/browser/content_browser_client.h" |
9 #include "content/browser/speech/speech_input_preferences.h" | 9 #include "content/browser/speech/speech_input_preferences.h" |
10 #include "content/common/speech_input_messages.h" | 10 #include "content/common/speech_input_messages.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 | 179 |
180 void SpeechInputDispatcherHost::OnStopRecording(int render_view_id, | 180 void SpeechInputDispatcherHost::OnStopRecording(int render_view_id, |
181 int request_id) { | 181 int request_id) { |
182 int caller_id = g_speech_input_callers.Get().GetId( | 182 int caller_id = g_speech_input_callers.Get().GetId( |
183 render_process_id_, render_view_id, request_id); | 183 render_process_id_, render_view_id, request_id); |
184 if (caller_id) | 184 if (caller_id) |
185 manager()->StopRecording(caller_id); | 185 manager()->StopRecording(caller_id); |
186 } | 186 } |
187 | 187 |
188 void SpeechInputDispatcherHost::SetRecognitionResult( | 188 void SpeechInputDispatcherHost::SetRecognitionResult( |
189 int caller_id, const SpeechInputResultArray& result) { | 189 int caller_id, const SpeechInputResult& result) { |
190 VLOG(1) << "SpeechInputDispatcherHost::SetRecognitionResult enter"; | 190 VLOG(1) << "SpeechInputDispatcherHost::SetRecognitionResult enter"; |
191 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 191 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
192 int caller_render_view_id = | 192 int caller_render_view_id = |
193 g_speech_input_callers.Get().render_view_id(caller_id); | 193 g_speech_input_callers.Get().render_view_id(caller_id); |
194 int caller_request_id = g_speech_input_callers.Get().request_id(caller_id); | 194 int caller_request_id = g_speech_input_callers.Get().request_id(caller_id); |
195 Send(new SpeechInputMsg_SetRecognitionResult(caller_render_view_id, | 195 Send(new SpeechInputMsg_SetRecognitionResult(caller_render_view_id, |
196 caller_request_id, | 196 caller_request_id, |
197 result)); | 197 result)); |
198 VLOG(1) << "SpeechInputDispatcherHost::SetRecognitionResult exit"; | 198 VLOG(1) << "SpeechInputDispatcherHost::SetRecognitionResult exit"; |
199 } | 199 } |
(...skipping 16 matching lines...) Expand all Loading... |
216 g_speech_input_callers.Get().render_view_id(caller_id); | 216 g_speech_input_callers.Get().render_view_id(caller_id); |
217 int caller_request_id = g_speech_input_callers.Get().request_id(caller_id); | 217 int caller_request_id = g_speech_input_callers.Get().request_id(caller_id); |
218 Send(new SpeechInputMsg_RecognitionComplete(caller_render_view_id, | 218 Send(new SpeechInputMsg_RecognitionComplete(caller_render_view_id, |
219 caller_request_id)); | 219 caller_request_id)); |
220 // Request sequence ended, so remove mapping. | 220 // Request sequence ended, so remove mapping. |
221 g_speech_input_callers.Get().RemoveId(caller_id); | 221 g_speech_input_callers.Get().RemoveId(caller_id); |
222 VLOG(1) << "SpeechInputDispatcherHost::DidCompleteRecognition exit"; | 222 VLOG(1) << "SpeechInputDispatcherHost::DidCompleteRecognition exit"; |
223 } | 223 } |
224 | 224 |
225 } // namespace speech_input | 225 } // namespace speech_input |
OLD | NEW |