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 21 matching lines...) Expand all Loading... |
32 #include "modules/speech/SpeechRecognitionResultList.h" | 32 #include "modules/speech/SpeechRecognitionResultList.h" |
33 #include "platform/heap/Handle.h" | 33 #include "platform/heap/Handle.h" |
34 | 34 |
35 namespace blink { | 35 namespace blink { |
36 | 36 |
37 class Document; | 37 class Document; |
38 | 38 |
39 class SpeechRecognitionEvent final : public Event { | 39 class SpeechRecognitionEvent final : public Event { |
40 DEFINE_WRAPPERTYPEINFO(); | 40 DEFINE_WRAPPERTYPEINFO(); |
41 public: | 41 public: |
42 static SpeechRecognitionEvent* create(); | |
43 static SpeechRecognitionEvent* create(const AtomicString&, const SpeechRecog
nitionEventInit&); | 42 static SpeechRecognitionEvent* create(const AtomicString&, const SpeechRecog
nitionEventInit&); |
44 ~SpeechRecognitionEvent() override; | 43 ~SpeechRecognitionEvent() override; |
45 | 44 |
46 static SpeechRecognitionEvent* createResult(unsigned long resultIndex, const
HeapVector<Member<SpeechRecognitionResult>>& results); | 45 static SpeechRecognitionEvent* createResult(unsigned long resultIndex, const
HeapVector<Member<SpeechRecognitionResult>>& results); |
47 static SpeechRecognitionEvent* createNoMatch(SpeechRecognitionResult*); | 46 static SpeechRecognitionEvent* createNoMatch(SpeechRecognitionResult*); |
48 | 47 |
49 unsigned long resultIndex() const { return m_resultIndex; } | 48 unsigned long resultIndex() const { return m_resultIndex; } |
50 SpeechRecognitionResultList* results() const { return m_results; } | 49 SpeechRecognitionResultList* results() const { return m_results; } |
51 | 50 |
52 // These two methods are here to satisfy the specification which requires th
ese attributes to exist. | 51 // These two methods are here to satisfy the specification which requires th
ese attributes to exist. |
53 Document* interpretation() { return nullptr; } | 52 Document* interpretation() { return nullptr; } |
54 Document* emma() { return nullptr; } | 53 Document* emma() { return nullptr; } |
55 | 54 |
56 // Event | 55 // Event |
57 const AtomicString& interfaceName() const override; | 56 const AtomicString& interfaceName() const override; |
58 | 57 |
59 DECLARE_VIRTUAL_TRACE(); | 58 DECLARE_VIRTUAL_TRACE(); |
60 | 59 |
61 private: | 60 private: |
62 SpeechRecognitionEvent(); | |
63 SpeechRecognitionEvent(const AtomicString&, const SpeechRecognitionEventInit
&); | 61 SpeechRecognitionEvent(const AtomicString&, const SpeechRecognitionEventInit
&); |
64 SpeechRecognitionEvent(const AtomicString& eventName, unsigned long resultIn
dex, SpeechRecognitionResultList* results); | 62 SpeechRecognitionEvent(const AtomicString& eventName, unsigned long resultIn
dex, SpeechRecognitionResultList* results); |
65 | 63 |
66 unsigned long m_resultIndex; | 64 unsigned long m_resultIndex; |
67 Member<SpeechRecognitionResultList> m_results; | 65 Member<SpeechRecognitionResultList> m_results; |
68 }; | 66 }; |
69 | 67 |
70 } // namespace blink | 68 } // namespace blink |
71 | 69 |
72 #endif // SpeechRecognitionEvent_h | 70 #endif // SpeechRecognitionEvent_h |
OLD | NEW |