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

Side by Side Diff: content/public/common/speech_recognition_error.h

Issue 10233010: Introducing new data types and IPC messages for scripted JS speech recognition APIs (Speech CL2.0) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed according to Hans review. Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_ 5 #ifndef CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_
6 #define CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_ 6 #define CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_
7 #pragma once
7 8
8 namespace content { 9 namespace content {
9 10
10 // This enumeration follows the values described here: 11 // This enumeration follows the values described here:
11 // http://www.w3.org/2005/Incubator/htmlspeech/2010/10/google-api-draft.html#spe ech-input-error 12 // http://www.w3.org/2005/Incubator/htmlspeech/2010/10/google-api-draft.html#spe ech-input-error
12 enum SpeechRecognitionErrorCode { 13 enum SpeechRecognitionErrorCode {
13 // There was no error. 14 // There was no error.
14 SPEECH_RECOGNITION_ERROR_NONE = 0, 15 SPEECH_RECOGNITION_ERROR_NONE = 0,
15 // The user or a script aborted speech input. 16 // The user or a script aborted speech input.
16 SPEECH_RECOGNITION_ERROR_ABORTED, 17 SPEECH_RECOGNITION_ERROR_ABORTED,
(...skipping 13 matching lines...) Expand all
30 enum SpeechAudioErrorDetails { 31 enum SpeechAudioErrorDetails {
31 SPEECH_AUDIO_ERROR_DETAILS_NONE = 0, 32 SPEECH_AUDIO_ERROR_DETAILS_NONE = 0,
32 SPEECH_AUDIO_ERROR_DETAILS_NO_MIC, 33 SPEECH_AUDIO_ERROR_DETAILS_NO_MIC,
33 SPEECH_AUDIO_ERROR_DETAILS_IN_USE 34 SPEECH_AUDIO_ERROR_DETAILS_IN_USE
34 }; 35 };
35 36
36 struct CONTENT_EXPORT SpeechRecognitionError { 37 struct CONTENT_EXPORT SpeechRecognitionError {
37 SpeechRecognitionErrorCode code; 38 SpeechRecognitionErrorCode code;
38 SpeechAudioErrorDetails details; 39 SpeechAudioErrorDetails details;
39 40
40 SpeechRecognitionError(SpeechRecognitionErrorCode code_value) 41 SpeechRecognitionError()
Satish 2012/04/27 10:04:41 style guide forbids inlining constructors in heade
hans 2012/04/27 10:53:30 I think in practice it's fine to avoid the extra .
Satish 2012/04/27 11:08:02 Thats what I thought earlier, but the style guide
jam 2012/04/27 14:43:26 For files in content/public we have tried to avoid
Satish 2012/04/27 14:45:34 Cool, makes sense. Is it ok to mention this in the
42 : code(SPEECH_RECOGNITION_ERROR_NONE),
43 details(SPEECH_AUDIO_ERROR_DETAILS_NONE) {
44 }
45 explicit SpeechRecognitionError(SpeechRecognitionErrorCode code_value)
41 : code(code_value), 46 : code(code_value),
42 details(SPEECH_AUDIO_ERROR_DETAILS_NONE) {} 47 details(SPEECH_AUDIO_ERROR_DETAILS_NONE) {
48 }
43 SpeechRecognitionError(SpeechRecognitionErrorCode code_value, 49 SpeechRecognitionError(SpeechRecognitionErrorCode code_value,
44 SpeechAudioErrorDetails details_value) 50 SpeechAudioErrorDetails details_value)
45 : code(code_value), 51 : code(code_value),
46 details(details_value) {} 52 details(details_value) {
53 }
47 }; 54 };
48 55
49 } // namespace content 56 } // namespace content
50 57
51 #endif // CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_ 58 #endif // CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_ERROR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698