Chromium Code Reviews| Index: content/public/browser/speech_recognizer.h |
| diff --git a/content/public/browser/speech_recognizer.h b/content/public/browser/speech_recognizer.h |
| index 50c5c318562508b9ad5ddea8c1f2173cd7117a7b..dd456438725c005348c59e6b068b6d6d57d2204c 100644 |
| --- a/content/public/browser/speech_recognizer.h |
| +++ b/content/public/browser/speech_recognizer.h |
| @@ -16,15 +16,22 @@ class URLRequestContextGetter; |
| namespace content { |
| -class SpeechRecognizerDelegate; |
| +class SpeechRecognitionEventListener; |
| // Records audio, sends recorded audio to server and translates server response |
| // to recognition result. |
| +// TODO(primiano) remove this public interface as soon as we fix speech input |
| +// extensions. |
| class SpeechRecognizer : public base::RefCountedThreadSafe<SpeechRecognizer> { |
| public: |
| + |
| + // TODO(primiano) Create(...) is transitional (until we fix speech input |
| + // extensions) and should be removed soon. The manager should be the only one |
| + // knowing the existence of SpeechRecognizer, thus the only one in charge of |
| + // instantiating it. |
| CONTENT_EXPORT static SpeechRecognizer* Create( |
| - SpeechRecognizerDelegate* delegate, |
| - int caller_id, |
| + SpeechRecognitionEventListener* event_listener, |
| + int session_id, |
| const std::string& language, |
| const std::string& grammar, |
| net::URLRequestContextGetter* context_getter, |
| @@ -34,18 +41,27 @@ class SpeechRecognizer : public base::RefCountedThreadSafe<SpeechRecognizer> { |
| virtual ~SpeechRecognizer() {} |
| - // Starts audio recording and does recognition after recording ends. The same |
| + // Starts audio recording and the recognition process. The same |
| // SpeechRecognizer instance can be used multiple times for speech recognition |
| // though each recognition request can be made only after the previous one |
| // completes (i.e. after receiving |
| - // SpeechRecognizerDelegate::DidCompleteRecognition). |
| - virtual bool StartRecording() = 0; |
| + // SpeechRecognitionEventListener::OnRecognitionEnd). |
| + virtual bool StartRecognition() = 0; |
| // Stops recording audio and cancels recognition. Any audio recorded so far |
| // gets discarded. |
| - virtual void CancelRecognition() = 0; |
| + virtual void AbortRecognition() = 0; |
| + |
| + // Stops recording audio and fianlizes recognition, possibly getting results. |
|
Satish
2012/03/13 15:30:15
fianlizes -> finalizes
Primiano Tucci (use gerrit)
2012/03/14 09:40:35
Done.
|
| + virtual void StopAudioCapture() = 0; |
| + |
| + // Checks wether the recognizer is active. |
|
Satish
2012/03/13 15:30:15
please define what 'active' means so the comment b
Primiano Tucci (use gerrit)
2012/03/14 09:40:35
Right!
|
| + virtual bool IsActive() const = 0; |
| + |
| + // Checks wether the recognizer is capturing audio. |
| + virtual bool IsCapturingAudio() const = 0; |
| }; |
| -} // namespace speech |
| +} // namespace content |
| #endif // CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNIZER_H_ |