OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * * Redistributions of source code must retain the above copyright | 7 * * Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * * Redistributions in binary form must reproduce the above copyright | 9 * * Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "config.h" | 26 #include "config.h" |
27 | 27 |
28 #include "modules/speech/SpeechRecognitionError.h" | 28 #include "modules/speech/SpeechRecognitionError.h" |
29 | 29 |
30 namespace WebCore { | 30 namespace WebCore { |
31 | 31 |
32 static String ErrorCodeToString(SpeechRecognitionError::ErrorCode code) | 32 static String ErrorCodeToString(SpeechRecognitionError::ErrorCode code) |
33 { | 33 { |
34 switch (code) { | 34 switch (code) { |
35 case SpeechRecognitionError::ErrorCodeOther: | 35 case SpeechRecognitionError::ErrorCodeOther: |
36 return ASCIILiteral("other"); | 36 return "other"; |
37 case SpeechRecognitionError::ErrorCodeNoSpeech: | 37 case SpeechRecognitionError::ErrorCodeNoSpeech: |
38 return ASCIILiteral("no-speech"); | 38 return "no-speech"; |
39 case SpeechRecognitionError::ErrorCodeAborted: | 39 case SpeechRecognitionError::ErrorCodeAborted: |
40 return ASCIILiteral("aborted"); | 40 return "aborted"; |
41 case SpeechRecognitionError::ErrorCodeAudioCapture: | 41 case SpeechRecognitionError::ErrorCodeAudioCapture: |
42 return ASCIILiteral("audio-capture"); | 42 return "audio-capture"; |
43 case SpeechRecognitionError::ErrorCodeNetwork: | 43 case SpeechRecognitionError::ErrorCodeNetwork: |
44 return ASCIILiteral("network"); | 44 return "network"; |
45 case SpeechRecognitionError::ErrorCodeNotAllowed: | 45 case SpeechRecognitionError::ErrorCodeNotAllowed: |
46 return ASCIILiteral("not-allowed"); | 46 return "not-allowed"; |
47 case SpeechRecognitionError::ErrorCodeServiceNotAllowed: | 47 case SpeechRecognitionError::ErrorCodeServiceNotAllowed: |
48 return ASCIILiteral("service-not-allowed"); | 48 return "service-not-allowed"; |
49 case SpeechRecognitionError::ErrorCodeBadGrammar: | 49 case SpeechRecognitionError::ErrorCodeBadGrammar: |
50 return ASCIILiteral("bad-grammar"); | 50 return "bad-grammar"; |
51 case SpeechRecognitionError::ErrorCodeLanguageNotSupported: | 51 case SpeechRecognitionError::ErrorCodeLanguageNotSupported: |
52 return ASCIILiteral("language-not-supported"); | 52 return "language-not-supported"; |
53 } | 53 } |
54 | 54 |
55 ASSERT_NOT_REACHED(); | 55 ASSERT_NOT_REACHED(); |
56 return String(); | 56 return String(); |
57 } | 57 } |
58 | 58 |
59 PassRefPtr<SpeechRecognitionError> SpeechRecognitionError::create(ErrorCode code
, const String& message) | 59 PassRefPtr<SpeechRecognitionError> SpeechRecognitionError::create(ErrorCode code
, const String& message) |
60 { | 60 { |
61 return adoptRef(new SpeechRecognitionError(ErrorCodeToString(code), message)
); | 61 return adoptRef(new SpeechRecognitionError(ErrorCodeToString(code), message)
); |
62 } | 62 } |
(...skipping 27 matching lines...) Expand all Loading... |
90 const AtomicString& SpeechRecognitionError::interfaceName() const | 90 const AtomicString& SpeechRecognitionError::interfaceName() const |
91 { | 91 { |
92 return eventNames().interfaceForSpeechRecognitionError; | 92 return eventNames().interfaceForSpeechRecognitionError; |
93 } | 93 } |
94 | 94 |
95 SpeechRecognitionErrorInit::SpeechRecognitionErrorInit() | 95 SpeechRecognitionErrorInit::SpeechRecognitionErrorInit() |
96 { | 96 { |
97 } | 97 } |
98 | 98 |
99 } // namespace WebCore | 99 } // namespace WebCore |
OLD | NEW |