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

Side by Side Diff: content/browser/speech/speech_input_dispatcher_host.cc

Issue 8137005: Applying changes to the existing speech input code to support the extension API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: mac bot fix. Created 9 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/browser/speech/speech_input_dispatcher_host.h ('k') | content/browser/speech/speech_input_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698