OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_INPUT_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_SPEECH_SPEECH_INPUT_MANAGER_H_ |
6 #define CONTENT_BROWSER_SPEECH_SPEECH_INPUT_MANAGER_H_ | 6 #define CONTENT_BROWSER_SPEECH_SPEECH_INPUT_MANAGER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "content/common/speech_input_result.h" | 9 #include "content/common/speech_input_result.h" |
10 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
11 | 11 |
12 namespace speech_input { | 12 namespace speech_input { |
13 | 13 |
14 // This is the gatekeeper for speech recognition in the browser process. It | 14 // This is the gatekeeper for speech recognition in the browser process. It |
15 // handles requests received from various render views and makes sure only one | 15 // handles requests received from various render views and makes sure only one |
16 // of them can use speech recognition at a time. It also sends recognition | 16 // of them can use speech recognition at a time. It also sends recognition |
17 // results and status events to the render views when required. | 17 // results and status events to the render views when required. |
18 // This class is a singleton and accessed via the Get method. | |
19 class SpeechInputManager { | 18 class SpeechInputManager { |
20 public: | 19 public: |
21 // Implemented by the dispatcher host to relay events to the render views. | 20 // Implemented by the dispatcher host to relay events to the render views. |
22 class Delegate { | 21 class Delegate { |
23 public: | 22 public: |
24 virtual void SetRecognitionResult( | 23 virtual void SetRecognitionResult( |
25 int caller_id, | 24 int caller_id, |
26 const SpeechInputResultArray& result) = 0; | 25 const SpeechInputResultArray& result) = 0; |
27 virtual void DidCompleteRecording(int caller_id) = 0; | 26 virtual void DidCompleteRecording(int caller_id) = 0; |
28 virtual void DidCompleteRecognition(int caller_id) = 0; | 27 virtual void DidCompleteRecognition(int caller_id) = 0; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 69 |
71 // This typedef is to workaround the issue with certain versions of | 70 // This typedef is to workaround the issue with certain versions of |
72 // Visual Studio where it gets confused between multiple Delegate | 71 // Visual Studio where it gets confused between multiple Delegate |
73 // classes and gives a C2500 error. (I saw this error on the try bots - | 72 // classes and gives a C2500 error. (I saw this error on the try bots - |
74 // the workaround was not needed for my machine). | 73 // the workaround was not needed for my machine). |
75 typedef SpeechInputManager::Delegate SpeechInputManagerDelegate; | 74 typedef SpeechInputManager::Delegate SpeechInputManagerDelegate; |
76 | 75 |
77 } // namespace speech_input | 76 } // namespace speech_input |
78 | 77 |
79 #endif // CONTENT_BROWSER_SPEECH_SPEECH_INPUT_MANAGER_H_ | 78 #endif // CONTENT_BROWSER_SPEECH_SPEECH_INPUT_MANAGER_H_ |
OLD | NEW |