Index: content/public/common/speech_recognition_error.h |
diff --git a/content/public/common/speech_recognition_result.h b/content/public/common/speech_recognition_error.h |
similarity index 51% |
copy from content/public/common/speech_recognition_result.h |
copy to content/public/common/speech_recognition_error.h |
index e5efe5ba9a6362305ec38727aa80a3e752b40d51..10af480d9abf18c661655175c1bb2c71ebb71e95 100644 |
--- a/content/public/common/speech_recognition_result.h |
+++ b/content/public/common/speech_recognition_error.h |
@@ -2,33 +2,11 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_RESULT_H_ |
-#define CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_RESULT_H_ |
- |
-#include <vector> |
- |
-#include "base/basictypes.h" |
-#include "base/string16.h" |
-#include "content/common/content_export.h" |
+#ifndef CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_ |
+#define CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_ |
namespace content { |
-struct SpeechRecognitionHypothesis { |
- string16 utterance; |
- double confidence; |
- |
- SpeechRecognitionHypothesis() : confidence(0.0) {} |
- |
- SpeechRecognitionHypothesis(const string16 utterance_value, |
- double confidence_value) |
- : utterance(utterance_value), |
- confidence(confidence_value) { |
- } |
-}; |
- |
-typedef std::vector<SpeechRecognitionHypothesis> |
- SpeechRecognitionHypothesisArray; |
- |
// This enumeration follows the values described here: |
// http://www.w3.org/2005/Incubator/htmlspeech/2010/10/google-api-draft.html#speech-input-error |
enum SpeechRecognitionErrorCode { |
@@ -48,14 +26,26 @@ enum SpeechRecognitionErrorCode { |
SPEECH_RECOGNITION_ERROR_BAD_GRAMMAR, |
}; |
-struct CONTENT_EXPORT SpeechRecognitionResult { |
- SpeechRecognitionErrorCode error; |
- SpeechRecognitionHypothesisArray hypotheses; |
+// Error details for the SPEECH_RECOGNITION_ERROR_AUDIO error. |
+enum SpeechAudioErrorDetails { |
+ SPEECH_AUDIO_ERROR_DETAILS_NONE = 0, |
+ SPEECH_AUDIO_ERROR_DETAILS_NO_MIC, |
+ SPEECH_AUDIO_ERROR_DETAILS_IN_USE |
+}; |
- SpeechRecognitionResult(); |
- ~SpeechRecognitionResult(); |
+struct CONTENT_EXPORT SpeechRecognitionError { |
+ SpeechRecognitionErrorCode code; |
+ SpeechAudioErrorDetails details; |
+ |
+ SpeechRecognitionError(SpeechRecognitionErrorCode code_value) |
+ : code(code_value), |
+ details(SPEECH_AUDIO_ERROR_DETAILS_NONE) {} |
+ SpeechRecognitionError(SpeechRecognitionErrorCode code_value, |
+ SpeechAudioErrorDetails details_value) |
+ : code(code_value), |
+ details(details_value) {} |
}; |
} // namespace content |
-#endif // CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_RESULT_H_ |
+#endif // CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_ |