OLD | NEW |
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_BROWSER_SPEECH_SPEECH_RECOGNITION_MANAGER_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_MANAGER_IMPL_H_ |
6 #define CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_MANAGER_IMPL_H_ | 6 #define CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_MANAGER_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 EVENT_AUDIO_ENDED, | 120 EVENT_AUDIO_ENDED, |
121 EVENT_RECOGNITION_ENDED, | 121 EVENT_RECOGNITION_ENDED, |
122 EVENT_MAX_VALUE = EVENT_RECOGNITION_ENDED | 122 EVENT_MAX_VALUE = EVENT_RECOGNITION_ENDED |
123 }; | 123 }; |
124 | 124 |
125 struct Session { | 125 struct Session { |
126 Session(); | 126 Session(); |
127 ~Session(); | 127 ~Session(); |
128 | 128 |
129 int id; | 129 int id; |
| 130 bool abort_requested; |
130 bool listener_is_active; | 131 bool listener_is_active; |
131 SpeechRecognitionSessionConfig config; | 132 SpeechRecognitionSessionConfig config; |
132 SpeechRecognitionSessionContext context; | 133 SpeechRecognitionSessionContext context; |
133 scoped_refptr<SpeechRecognizer> recognizer; | 134 scoped_refptr<SpeechRecognizer> recognizer; |
134 scoped_ptr<MediaStreamUIProxy> ui; | 135 scoped_ptr<MediaStreamUIProxy> ui; |
135 }; | 136 }; |
136 | 137 |
137 // Callback issued by the SpeechRecognitionManagerDelegate for reporting | 138 // Callback issued by the SpeechRecognitionManagerDelegate for reporting |
138 // asynchronously the result of the CheckRecognitionIsAllowed call. | 139 // asynchronously the result of the CheckRecognitionIsAllowed call. |
139 void RecognitionAllowedCallback(int session_id, | 140 void RecognitionAllowedCallback(int session_id, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 | 185 |
185 // Used for posting asynchronous tasks (on the IO thread) without worrying | 186 // Used for posting asynchronous tasks (on the IO thread) without worrying |
186 // about this class being destroyed in the meanwhile (due to browser shutdown) | 187 // about this class being destroyed in the meanwhile (due to browser shutdown) |
187 // since tasks pending on a destroyed WeakPtr are automatically discarded. | 188 // since tasks pending on a destroyed WeakPtr are automatically discarded. |
188 base::WeakPtrFactory<SpeechRecognitionManagerImpl> weak_factory_; | 189 base::WeakPtrFactory<SpeechRecognitionManagerImpl> weak_factory_; |
189 }; | 190 }; |
190 | 191 |
191 } // namespace content | 192 } // namespace content |
192 | 193 |
193 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_MANAGER_IMPL_H_ | 194 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_MANAGER_IMPL_H_ |
OLD | NEW |