Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1134)

Unified Diff: content/public/common/speech_recognition_error.h

Issue 9663066: Refactoring of chrome speech recognition architecture (CL1.3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed compilation issues on windows. Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/browser/speech_recognizer.h ('k') | content/public/common/speech_recognition_result.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « content/public/browser/speech_recognizer.h ('k') | content/public/common/speech_recognition_result.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698