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_PUBLIC_BROWSER_SPEECH_INPUT_MANAGER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_MANAGER_H_ |
6 #define CONTENT_PUBLIC_BROWSER_SPEECH_INPUT_MANAGER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_MANAGER_H_ |
7 | 7 |
8 #include "base/string16.h" | 8 #include "base/string16.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 | 10 |
11 namespace content { | 11 namespace content { |
12 | 12 |
13 // This is the gatekeeper for speech recognition in the browser process. It | 13 // This is the gatekeeper for speech recognition in the browser process. It |
14 // handles requests received from various render views and makes sure only one | 14 // handles requests received from various render views and makes sure only one |
15 // of them can use speech recognition at a time. It also sends recognition | 15 // of them can use speech recognition at a time. It also sends recognition |
16 // results and status events to the render views when required. | 16 // results and status events to the render views when required. |
17 class SpeechInputManager { | 17 class SpeechRecognitionManager { |
18 public: | 18 public: |
19 // Returns the singleton instance. | 19 // Returns the singleton instance. |
20 CONTENT_EXPORT static SpeechInputManager* GetInstance(); | 20 CONTENT_EXPORT static SpeechRecognitionManager* GetInstance(); |
21 | 21 |
22 // Starts/restarts recognition for an existing request. | 22 // Starts/restarts recognition for an existing request. |
23 virtual void StartRecognitionForRequest(int caller_id) = 0; | 23 virtual void StartRecognitionForRequest(int caller_id) = 0; |
24 | 24 |
25 // Cancels recognition for an existing request. | 25 // Cancels recognition for an existing request. |
26 virtual void CancelRecognitionForRequest(int caller_id) = 0; | 26 virtual void CancelRecognitionForRequest(int caller_id) = 0; |
27 | 27 |
28 // Called when the user clicks outside the speech input UI causing it to close | 28 // Called when the user clicks outside the speech input UI causing it to close |
29 // and possibly have speech input go to another element. | 29 // and possibly have speech input go to another element. |
30 virtual void FocusLostForRequest(int caller_id) = 0; | 30 virtual void FocusLostForRequest(int caller_id) = 0; |
31 | 31 |
32 // Returns true if the OS reports existence of audio recording devices. | 32 // Returns true if the OS reports existence of audio recording devices. |
33 virtual bool HasAudioInputDevices() = 0; | 33 virtual bool HasAudioInputDevices() = 0; |
34 | 34 |
35 // Used to determine if something else is currently making use of audio input. | 35 // Used to determine if something else is currently making use of audio input. |
36 virtual bool IsRecordingInProcess() = 0; | 36 virtual bool IsCapturingAudio() = 0; |
37 | 37 |
38 // Returns a human readable string for the model/make of the active audio | 38 // Returns a human readable string for the model/make of the active audio |
39 // input device for this computer. | 39 // input device for this computer. |
40 virtual string16 GetAudioInputDeviceModel() = 0; | 40 virtual string16 GetAudioInputDeviceModel() = 0; |
41 | 41 |
42 // Invokes the platform provided microphone settings UI in a non-blocking way, | 42 // Invokes the platform provided microphone settings UI in a non-blocking way, |
43 // via the BrowserThread::FILE thread. | 43 // via the BrowserThread::FILE thread. |
44 virtual void ShowAudioInputSettings() = 0; | 44 virtual void ShowAudioInputSettings() = 0; |
45 | 45 |
46 protected: | 46 protected: |
47 virtual ~SpeechInputManager() {} | 47 virtual ~SpeechRecognitionManager() {} |
48 }; | 48 }; |
49 | 49 |
50 } // namespace content | 50 } // namespace content |
51 | 51 |
52 #endif // CONTENT_PUBLIC_BROWSER_SPEECH_INPUT_MANAGER_H_ | 52 #endif // CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_MANAGER_H_ |
OLD | NEW |