summaryrefslogtreecommitdiffstats
path: root/content/browser/speech/speech_recognizer.cc
diff options
context:
space:
mode:
authorsatish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-07 17:24:13 +0000
committersatish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-07 17:24:13 +0000
commit441c6c3210063f995d3541b45e01e3aaaea80c59 (patch)
tree1534273cebadd6fbf44f60ab31dcbbf70c1280e8 /content/browser/speech/speech_recognizer.cc
parent2db531074be20594b38f882448fa918996cd2abc (diff)
downloadchromium_src-441c6c3210063f995d3541b45e01e3aaaea80c59.zip
chromium_src-441c6c3210063f995d3541b45e01e3aaaea80c59.tar.gz
chromium_src-441c6c3210063f995d3541b45e01e3aaaea80c59.tar.bz2
Better error messages for speech input errors.
Show a connection-failed type error message when receiving connection errors with speech service. Also updated the no-results error message with latest text and added 2 new unit tests. BUG=61677 TEST=unit_tests --gtest_filter=SpeechRecognizerTest.* Review URL: http://codereview.chromium.org/6628049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77149 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/speech/speech_recognizer.cc')
-rw-r--r--content/browser/speech/speech_recognizer.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/content/browser/speech/speech_recognizer.cc b/content/browser/speech/speech_recognizer.cc
index 3b7b89e..3b9201a 100644
--- a/content/browser/speech/speech_recognizer.cc
+++ b/content/browser/speech/speech_recognizer.cc
@@ -278,8 +278,9 @@ void SpeechRecognizer::HandleOnData(string* data) {
void SpeechRecognizer::SetRecognitionResult(
bool error, const SpeechInputResultArray& result) {
- if (result.empty()) {
- InformErrorAndCancelRecognition(RECOGNIZER_ERROR_NO_RESULTS);
+ if (error || result.empty()) {
+ InformErrorAndCancelRecognition(error ? RECOGNIZER_ERROR_NETWORK :
+ RECOGNIZER_ERROR_NO_RESULTS);
return;
}