OLD | NEW |
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/browser/speech/speech_recognition_dispatcher_host.h" | 5 #include "content/browser/speech/speech_recognition_dispatcher_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "content/common/speech_recognition_messages.h" | 10 #include "content/common/speech_recognition_messages.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 context.request_id)); | 154 context.request_id)); |
155 } | 155 } |
156 | 156 |
157 void SpeechRecognitionDispatcherHost::OnRecognitionEnd(int session_id) { | 157 void SpeechRecognitionDispatcherHost::OnRecognitionEnd(int session_id) { |
158 const SpeechRecognitionSessionContext& context = | 158 const SpeechRecognitionSessionContext& context = |
159 manager()->GetSessionContext(session_id); | 159 manager()->GetSessionContext(session_id); |
160 Send(new SpeechRecognitionMsg_Ended(context.render_view_id, | 160 Send(new SpeechRecognitionMsg_Ended(context.render_view_id, |
161 context.request_id)); | 161 context.request_id)); |
162 } | 162 } |
163 | 163 |
164 void SpeechRecognitionDispatcherHost::OnRecognitionResults( | 164 void SpeechRecognitionDispatcherHost::OnRecognitionResult( |
165 int session_id, | 165 int session_id, |
166 const SpeechRecognitionResults& results) { | 166 const SpeechRecognitionResult& result) { |
167 const SpeechRecognitionSessionContext& context = | 167 const SpeechRecognitionSessionContext& context = |
168 manager()->GetSessionContext(session_id); | 168 manager()->GetSessionContext(session_id); |
169 Send(new SpeechRecognitionMsg_ResultRetrieved(context.render_view_id, | 169 Send(new SpeechRecognitionMsg_ResultRetrieved(context.render_view_id, |
170 context.request_id, | 170 context.request_id, |
171 results)); | 171 result)); |
172 } | 172 } |
173 | 173 |
174 void SpeechRecognitionDispatcherHost::OnRecognitionError( | 174 void SpeechRecognitionDispatcherHost::OnRecognitionError( |
175 int session_id, | 175 int session_id, |
176 const SpeechRecognitionError& error) { | 176 const SpeechRecognitionError& error) { |
177 const SpeechRecognitionSessionContext& context = | 177 const SpeechRecognitionSessionContext& context = |
178 manager()->GetSessionContext(session_id); | 178 manager()->GetSessionContext(session_id); |
179 Send(new SpeechRecognitionMsg_ErrorOccurred(context.render_view_id, | 179 Send(new SpeechRecognitionMsg_ErrorOccurred(context.render_view_id, |
180 context.request_id, | 180 context.request_id, |
181 error)); | 181 error)); |
182 } | 182 } |
183 | 183 |
184 // The events below are currently not used by speech JS APIs implementation. | 184 // The events below are currently not used by speech JS APIs implementation. |
185 void SpeechRecognitionDispatcherHost::OnAudioLevelsChange(int session_id, | 185 void SpeechRecognitionDispatcherHost::OnAudioLevelsChange(int session_id, |
186 float volume, | 186 float volume, |
187 float noise_volume) { | 187 float noise_volume) { |
188 } | 188 } |
189 | 189 |
190 void SpeechRecognitionDispatcherHost::OnEnvironmentEstimationComplete( | 190 void SpeechRecognitionDispatcherHost::OnEnvironmentEstimationComplete( |
191 int session_id) { | 191 int session_id) { |
192 } | 192 } |
193 | 193 |
194 } // namespace content | 194 } // namespace content |
OLD | NEW |