| 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/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/strings/utf_string_conversions.h" | 8 #include "base/strings/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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 static WebSpeechRecognizerClient::ErrorCode WebKitErrorCode( | 161 static WebSpeechRecognizerClient::ErrorCode WebKitErrorCode( |
| 162 SpeechRecognitionErrorCode e) { | 162 SpeechRecognitionErrorCode e) { |
| 163 switch (e) { | 163 switch (e) { |
| 164 case SPEECH_RECOGNITION_ERROR_NONE: | 164 case SPEECH_RECOGNITION_ERROR_NONE: |
| 165 NOTREACHED(); | 165 NOTREACHED(); |
| 166 return WebSpeechRecognizerClient::OtherError; | 166 return WebSpeechRecognizerClient::OtherError; |
| 167 case SPEECH_RECOGNITION_ERROR_NO_SPEECH: | 167 case SPEECH_RECOGNITION_ERROR_NO_SPEECH: |
| 168 return WebSpeechRecognizerClient::NoSpeechError; | 168 return WebSpeechRecognizerClient::NoSpeechError; |
| 169 case SPEECH_RECOGNITION_ERROR_ABORTED: | 169 case SPEECH_RECOGNITION_ERROR_ABORTED: |
| 170 return WebSpeechRecognizerClient::AbortedError; | 170 return WebSpeechRecognizerClient::AbortedError; |
| 171 case SPEECH_RECOGNITION_ERROR_AUDIO: | 171 case SPEECH_RECOGNITION_ERROR_AUDIO_CAPTURE: |
| 172 return WebSpeechRecognizerClient::AudioCaptureError; | 172 return WebSpeechRecognizerClient::AudioCaptureError; |
| 173 case SPEECH_RECOGNITION_ERROR_NETWORK: | 173 case SPEECH_RECOGNITION_ERROR_NETWORK: |
| 174 return WebSpeechRecognizerClient::NetworkError; | 174 return WebSpeechRecognizerClient::NetworkError; |
| 175 case SPEECH_RECOGNITION_ERROR_NOT_ALLOWED: | 175 case SPEECH_RECOGNITION_ERROR_NOT_ALLOWED: |
| 176 return WebSpeechRecognizerClient::NotAllowedError; | 176 return WebSpeechRecognizerClient::NotAllowedError; |
| 177 case SPEECH_RECOGNITION_ERROR_SERVICE_NOT_ALLOWED: | 177 case SPEECH_RECOGNITION_ERROR_SERVICE_NOT_ALLOWED: |
| 178 return WebSpeechRecognizerClient::ServiceNotAllowedError; | 178 return WebSpeechRecognizerClient::ServiceNotAllowedError; |
| 179 case SPEECH_RECOGNITION_ERROR_BAD_GRAMMAR: | 179 case SPEECH_RECOGNITION_ERROR_BAD_GRAMMAR: |
| 180 return WebSpeechRecognizerClient::BadGrammarError; | 180 return WebSpeechRecognizerClient::BadGrammarError; |
| 181 case SPEECH_RECOGNITION_ERROR_LANGUAGE_NOT_SUPPORTED: | 181 case SPEECH_RECOGNITION_ERROR_LANGUAGE_NOT_SUPPORTED: |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 } | 311 } |
| 312 | 312 |
| 313 const WebSpeechRecognitionHandle& SpeechRecognitionDispatcher::GetHandleFromID( | 313 const WebSpeechRecognitionHandle& SpeechRecognitionDispatcher::GetHandleFromID( |
| 314 int request_id) { | 314 int request_id) { |
| 315 HandleMap::iterator iter = handle_map_.find(request_id); | 315 HandleMap::iterator iter = handle_map_.find(request_id); |
| 316 DCHECK(iter != handle_map_.end()); | 316 DCHECK(iter != handle_map_.end()); |
| 317 return iter->second; | 317 return iter->second; |
| 318 } | 318 } |
| 319 | 319 |
| 320 } // namespace content | 320 } // namespace content |
| OLD | NEW |