diff options
author | primiano@chromium.org <primiano@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-23 17:06:04 +0000 |
---|---|---|
committer | primiano@chromium.org <primiano@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-23 17:06:04 +0000 |
commit | 011cfc7db8473b172cf92db23329506c1264b2ff (patch) | |
tree | c96fe386f0419668c24a955536798574573af33a /content/browser/speech/speech_recognizer_impl.h | |
parent | 8bf9ce70928f0aa18cfb64e8a965a1c0c142d41a (diff) | |
download | chromium_src-011cfc7db8473b172cf92db23329506c1264b2ff.zip chromium_src-011cfc7db8473b172cf92db23329506c1264b2ff.tar.gz chromium_src-011cfc7db8473b172cf92db23329506c1264b2ff.tar.bz2 |
SpeechInputExtensionManager now interface (exclusively) with SpeechRecognitionManagerDelegate (Speech CL1.11).
- The tray icon and balloon handing has been moved from speech_input_extensions_manager to chrome_speech_recognition_manager_delegate, since that code (tray icon) will be used also for continuous recognition.
- Removed the SpeechRecognizer interface from /content/public (thus de-virtualized and refcounted the SpeechRecognizerImpl)
BUG=116954
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10377082
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138498 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/speech/speech_recognizer_impl.h')
-rw-r--r-- | content/browser/speech/speech_recognizer_impl.h | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/content/browser/speech/speech_recognizer_impl.h b/content/browser/speech/speech_recognizer_impl.h index 1aa2eaa..8179e2743 100644 --- a/content/browser/speech/speech_recognizer_impl.h +++ b/content/browser/speech/speech_recognizer_impl.h @@ -11,7 +11,6 @@ #include "base/memory/scoped_ptr.h" #include "content/browser/speech/endpointer/endpointer.h" #include "content/browser/speech/speech_recognition_engine.h" -#include "content/public/browser/speech_recognizer.h" #include "content/public/common/speech_recognition_error.h" #include "content/public/common/speech_recognition_result.h" #include "media/audio/audio_input_controller.h" @@ -27,15 +26,13 @@ class AudioManager; namespace speech { -// TODO(primiano) Next CL: Remove the Impl suffix and the exported -// /content/public/browser/speech_recognizer.h interface since this class should -// not be visible outside (currently we need it for speech input extension API). +// TODO(primiano) Next CL: Remove the Impl suffix. // Handles speech recognition for a session (identified by |session_id|), taking // care of audio capture, silence detection/endpointer and interaction with the // SpeechRecognitionEngine. class CONTENT_EXPORT SpeechRecognizerImpl - : public NON_EXPORTED_BASE(content::SpeechRecognizer), + : public base::RefCountedThreadSafe<SpeechRecognizerImpl>, public media::AudioInputController::EventHandler, public NON_EXPORTED_BASE(SpeechRecognitionEngineDelegate) { public: @@ -50,18 +47,15 @@ class CONTENT_EXPORT SpeechRecognizerImpl int session_id, SpeechRecognitionEngine* engine); - // content::SpeechRecognizer methods. - virtual void StartRecognition() OVERRIDE; - virtual void AbortRecognition() OVERRIDE; - virtual void StopAudioCapture() OVERRIDE; - virtual bool IsActive() const OVERRIDE; - virtual bool IsCapturingAudio() const OVERRIDE; + void StartRecognition(); + void AbortRecognition(); + void StopAudioCapture(); + bool IsActive() const; + bool IsCapturingAudio() const; const SpeechRecognitionEngine& recognition_engine() const; - protected: - virtual ~SpeechRecognizerImpl(); - private: + friend class base::RefCountedThreadSafe<SpeechRecognizerImpl>; friend class SpeechRecognizerImplTest; enum FSMState { @@ -96,6 +90,8 @@ class CONTENT_EXPORT SpeechRecognizerImpl content::SpeechRecognitionError engine_error; }; + virtual ~SpeechRecognizerImpl(); + // Entry point for pushing any new external event into the recognizer FSM. void DispatchEvent(const FSMEventArgs& event_args); |