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 3 // found in the LICENSE file. 4 5 #ifndef CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_ 6 #define CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_ 7 8 namespace content { 9 10 enum SpeechRecognitionErrorCode { 11 #define DEFINE_SPEECH_RECOGNITION_ERROR(x, y) SPEECH_RECOGNITION_ERROR_##x = y, 12 #include "content/public/common/speech_recognition_error_list.h" 13 #undef DEFINE_SPEECH_RECOGNITION_ERROR 14 }; 15 16 // Error details for the SPEECH_RECOGNITION_ERROR_AUDIO error. 17 enum SpeechAudioErrorDetails { 18 SPEECH_AUDIO_ERROR_DETAILS_NONE = 0, 19 SPEECH_AUDIO_ERROR_DETAILS_NO_MIC, 20 SPEECH_AUDIO_ERROR_DETAILS_LAST = SPEECH_AUDIO_ERROR_DETAILS_NO_MIC 21 }; 22 23 struct CONTENT_EXPORT SpeechRecognitionError { 24 SpeechRecognitionErrorCode code; 25 SpeechAudioErrorDetails details; 26 27 SpeechRecognitionError() 28 : code(SPEECH_RECOGNITION_ERROR_NONE), 29 details(SPEECH_AUDIO_ERROR_DETAILS_NONE) { 30 } 31 explicit SpeechRecognitionError(SpeechRecognitionErrorCode code_value) 32 : code(code_value), 33 details(SPEECH_AUDIO_ERROR_DETAILS_NONE) { 34 } 35 SpeechRecognitionError(SpeechRecognitionErrorCode code_value, 36 SpeechAudioErrorDetails details_value) 37 : code(code_value), 38 details(details_value) { 39 } 40 }; 41 42 } // namespace content 43 44 #endif // CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_ 45