Upstreaming browser/ui/uikit_ui_util from iOS.
[chromium-blink-merge.git] / content / public / common / speech_recognition_error.h
blob7456a43f2046344b4e99e796e2bb8537421741ec
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.
5 #ifndef CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_
6 #define CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_
8 namespace content {
10 // A Java counterpart will be generated for this enum.
11 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.content_public.common
12 // GENERATED_JAVA_PREFIX_TO_STRIP: SPEECH_RECOGNITION_ERROR_
13 enum SpeechRecognitionErrorCode {
14 // There was no error.
15 SPEECH_RECOGNITION_ERROR_NONE,
17 // No speech heard before timeout.
18 SPEECH_RECOGNITION_ERROR_NO_SPEECH,
20 // The user or a script aborted speech input.
21 SPEECH_RECOGNITION_ERROR_ABORTED,
23 // There was an error with recording audio.
24 SPEECH_RECOGNITION_ERROR_AUDIO_CAPTURE,
26 // There was a network error.
27 SPEECH_RECOGNITION_ERROR_NETWORK,
29 // Not allowed for privacy or security reasons.
30 SPEECH_RECOGNITION_ERROR_NOT_ALLOWED,
32 // Speech service is not allowed for privacy or security reasons.
33 SPEECH_RECOGNITION_ERROR_SERVICE_NOT_ALLOWED,
35 // There was an error in the speech recognition grammar.
36 SPEECH_RECOGNITION_ERROR_BAD_GRAMMAR,
38 // The language was not supported.
39 SPEECH_RECOGNITION_ERROR_LANGUAGE_NOT_SUPPORTED,
41 // Speech was heard, but could not be interpreted.
42 SPEECH_RECOGNITION_ERROR_NO_MATCH,
44 SPEECH_RECOGNITION_ERROR_LAST = SPEECH_RECOGNITION_ERROR_NO_MATCH,
47 // Error details for the SPEECH_RECOGNITION_ERROR_AUDIO error.
48 enum SpeechAudioErrorDetails {
49 SPEECH_AUDIO_ERROR_DETAILS_NONE = 0,
50 SPEECH_AUDIO_ERROR_DETAILS_NO_MIC,
51 SPEECH_AUDIO_ERROR_DETAILS_LAST = SPEECH_AUDIO_ERROR_DETAILS_NO_MIC
54 struct CONTENT_EXPORT SpeechRecognitionError {
55 SpeechRecognitionErrorCode code;
56 SpeechAudioErrorDetails details;
58 SpeechRecognitionError()
59 : code(SPEECH_RECOGNITION_ERROR_NONE),
60 details(SPEECH_AUDIO_ERROR_DETAILS_NONE) {
62 explicit SpeechRecognitionError(SpeechRecognitionErrorCode code_value)
63 : code(code_value),
64 details(SPEECH_AUDIO_ERROR_DETAILS_NONE) {
66 SpeechRecognitionError(SpeechRecognitionErrorCode code_value,
67 SpeechAudioErrorDetails details_value)
68 : code(code_value),
69 details(details_value) {
73 } // namespace content
75 #endif // CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_