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

Side by Side Diff: content/renderer/speech_recognition_dispatcher.cc

Issue 10825133: Speech recognition: fire the speechstart/speechend events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/renderer/speech_recognition_dispatcher.h" 5 #include "content/renderer/speech_recognition_dispatcher.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "content/common/speech_recognition_messages.h" 9 #include "content/common/speech_recognition_messages.h"
10 #include "content/renderer/render_view_impl.h" 10 #include "content/renderer/render_view_impl.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 103
104 void SpeechRecognitionDispatcher::OnRecognitionStarted(int request_id) { 104 void SpeechRecognitionDispatcher::OnRecognitionStarted(int request_id) {
105 recognizer_client_->didStart(GetHandleFromID(request_id)); 105 recognizer_client_->didStart(GetHandleFromID(request_id));
106 } 106 }
107 107
108 void SpeechRecognitionDispatcher::OnAudioStarted(int request_id) { 108 void SpeechRecognitionDispatcher::OnAudioStarted(int request_id) {
109 recognizer_client_->didStartAudio(GetHandleFromID(request_id)); 109 recognizer_client_->didStartAudio(GetHandleFromID(request_id));
110 } 110 }
111 111
112 void SpeechRecognitionDispatcher::OnSoundStarted(int request_id) { 112 void SpeechRecognitionDispatcher::OnSoundStarted(int request_id) {
113 recognizer_client_->didStartSound(GetHandleFromID(request_id)); 113 recognizer_client_->didStartSound(GetHandleFromID(request_id));
darin (slow to review) 2012/08/02 06:18:33 I don't understand why we need two function calls
114 recognizer_client_->didStartSpeech(GetHandleFromID(request_id));
114 } 115 }
115 116
116 void SpeechRecognitionDispatcher::OnSoundEnded(int request_id) { 117 void SpeechRecognitionDispatcher::OnSoundEnded(int request_id) {
118 recognizer_client_->didEndSpeech(GetHandleFromID(request_id));
darin (slow to review) 2012/08/02 06:18:33 Ditto.
117 recognizer_client_->didEndSound(GetHandleFromID(request_id)); 119 recognizer_client_->didEndSound(GetHandleFromID(request_id));
118 } 120 }
119 121
120 void SpeechRecognitionDispatcher::OnAudioEnded(int request_id) { 122 void SpeechRecognitionDispatcher::OnAudioEnded(int request_id) {
121 recognizer_client_->didEndAudio(GetHandleFromID(request_id)); 123 recognizer_client_->didEndAudio(GetHandleFromID(request_id));
122 } 124 }
123 125
124 void SpeechRecognitionDispatcher::OnErrorOccurred( 126 void SpeechRecognitionDispatcher::OnErrorOccurred(
125 int request_id, const SpeechRecognitionError& error) { 127 int request_id, const SpeechRecognitionError& error) {
126 if (error.code == content::SPEECH_RECOGNITION_ERROR_NO_MATCH) { 128 if (error.code == content::SPEECH_RECOGNITION_ERROR_NO_MATCH) {
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 } 209 }
208 return false; 210 return false;
209 } 211 }
210 212
211 const WebSpeechRecognitionHandle& SpeechRecognitionDispatcher::GetHandleFromID( 213 const WebSpeechRecognitionHandle& SpeechRecognitionDispatcher::GetHandleFromID(
212 int request_id) { 214 int request_id) {
213 HandleMap::iterator iter = handle_map_.find(request_id); 215 HandleMap::iterator iter = handle_map_.find(request_id);
214 DCHECK(iter != handle_map_.end()); 216 DCHECK(iter != handle_map_.end());
215 return iter->second; 217 return iter->second;
216 } 218 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698