| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 public SpeechRecognitionEventListener { | 54 public SpeechRecognitionEventListener { |
| 55 public: | 55 public: |
| 56 // Returns the current SpeechRecognitionManagerImpl or NULL if the call is | 56 // Returns the current SpeechRecognitionManagerImpl or NULL if the call is |
| 57 // issued when it is not created yet or destroyed (by BrowserMainLoop). | 57 // issued when it is not created yet or destroyed (by BrowserMainLoop). |
| 58 static SpeechRecognitionManagerImpl* GetInstance(); | 58 static SpeechRecognitionManagerImpl* GetInstance(); |
| 59 | 59 |
| 60 // SpeechRecognitionManager implementation. | 60 // SpeechRecognitionManager implementation. |
| 61 int CreateSession(const SpeechRecognitionSessionConfig& config) override; | 61 int CreateSession(const SpeechRecognitionSessionConfig& config) override; |
| 62 void StartSession(int session_id) override; | 62 void StartSession(int session_id) override; |
| 63 void AbortSession(int session_id) override; | 63 void AbortSession(int session_id) override; |
| 64 void AbortAllSessionsForRenderProcess(int render_process_id) override; | 64 void AbortAllSessionsForRenderFrame( |
| 65 void AbortAllSessionsForRenderView(int render_process_id, | 65 RenderFrameHost* render_frame_host) override; |
| 66 int render_view_id) override; | |
| 67 void StopAudioCaptureForSession(int session_id) override; | 66 void StopAudioCaptureForSession(int session_id) override; |
| 68 const SpeechRecognitionSessionConfig& GetSessionConfig( | 67 const SpeechRecognitionSessionConfig& GetSessionConfig( |
| 69 int session_id) const override; | 68 int session_id) const override; |
| 70 SpeechRecognitionSessionContext GetSessionContext( | 69 SpeechRecognitionSessionContext GetSessionContext( |
| 71 int session_id) const override; | 70 int session_id) const override; |
| 72 int GetSession(int render_process_id, | 71 int GetSession(RenderFrameHost* render_frame_host, |
| 73 int render_view_id, | |
| 74 int request_id) const override; | 72 int request_id) const override; |
| 75 bool HasAudioInputDevices() override; | 73 bool HasAudioInputDevices() override; |
| 76 base::string16 GetAudioInputDeviceModel() override; | 74 base::string16 GetAudioInputDeviceModel() override; |
| 77 void ShowAudioInputSettings() override; | 75 void ShowAudioInputSettings() override; |
| 78 | 76 |
| 79 // SpeechRecognitionEventListener methods. | 77 // SpeechRecognitionEventListener methods. |
| 80 void OnRecognitionStart(int session_id) override; | 78 void OnRecognitionStart(int session_id) override; |
| 81 void OnAudioStart(int session_id) override; | 79 void OnAudioStart(int session_id) override; |
| 82 void OnEnvironmentEstimationComplete(int session_id) override; | 80 void OnEnvironmentEstimationComplete(int session_id) override; |
| 83 void OnSoundStart(int session_id) override; | 81 void OnSoundStart(int session_id) override; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 182 |
| 185 // Used for posting asynchronous tasks (on the IO thread) without worrying | 183 // Used for posting asynchronous tasks (on the IO thread) without worrying |
| 186 // about this class being destroyed in the meanwhile (due to browser shutdown) | 184 // about this class being destroyed in the meanwhile (due to browser shutdown) |
| 187 // since tasks pending on a destroyed WeakPtr are automatically discarded. | 185 // since tasks pending on a destroyed WeakPtr are automatically discarded. |
| 188 base::WeakPtrFactory<SpeechRecognitionManagerImpl> weak_factory_; | 186 base::WeakPtrFactory<SpeechRecognitionManagerImpl> weak_factory_; |
| 189 }; | 187 }; |
| 190 | 188 |
| 191 } // namespace content | 189 } // namespace content |
| 192 | 190 |
| 193 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_MANAGER_IMPL_H_ | 191 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_MANAGER_IMPL_H_ |
| OLD | NEW |