Chromium Code Reviews| 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..e64fe0ace744e9cf55894ae8bbb8bac4032a88ef 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,25 @@ 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 { |
|
Primiano Tucci (use gerrit)
2012/03/23 10:52:19
I know that the presence of SpeechAudioErrorDetail
Satish
2012/03/23 10:57:45
Can this be added in the next CLs where it is actu
|
| + SPEECH_AUDIO_ERROR_DETAILS_UNKNOWN = 0, |
| + SPEECH_AUDIO_ERROR_DETAILS_NO_MIC, |
| + SPEECH_AUDIO_ERROR_DETAILS_IN_USE |
| +}; |
| + |
| +struct CONTENT_EXPORT SpeechRecognitionError { |
| + SpeechRecognitionErrorCode code; |
| + int details; |
| - SpeechRecognitionResult(); |
| - ~SpeechRecognitionResult(); |
| + SpeechRecognitionError(SpeechRecognitionErrorCode code_val) |
| + : code(code_val), |
| + details(0) {} |
| + SpeechRecognitionError(SpeechRecognitionErrorCode code_val, int details_val) |
| + : code(code_val), |
| + details(details_val) {} |
| }; |
| } // namespace content |
| -#endif // CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_RESULT_H_ |
| +#endif // CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_ |