OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_SPEECH_SPEECH_INPUT_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_SPEECH_SPEECH_INPUT_MANAGER_H_ |
6 #define CHROME_BROWSER_SPEECH_SPEECH_INPUT_MANAGER_H_ | 6 #define CHROME_BROWSER_SPEECH_SPEECH_INPUT_MANAGER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "gfx/rect.h" | 9 #include "gfx/rect.h" |
10 #include "ipc/ipc_message.h" | 10 #include "ipc/ipc_message.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 class Delegate { | 22 class Delegate { |
23 public: | 23 public: |
24 virtual void SetRecognitionResult(int caller_id, const string16& value) = 0; | 24 virtual void SetRecognitionResult(int caller_id, const string16& value) = 0; |
25 virtual void DidCompleteRecording(int caller_id) = 0; | 25 virtual void DidCompleteRecording(int caller_id) = 0; |
26 virtual void DidCompleteRecognition(int caller_id) = 0; | 26 virtual void DidCompleteRecognition(int caller_id) = 0; |
27 | 27 |
28 protected: | 28 protected: |
29 virtual ~Delegate() {} | 29 virtual ~Delegate() {} |
30 }; | 30 }; |
31 | 31 |
| 32 // Whether the speech input feature is enabled, based on the browser channel |
| 33 // information and command line flags. |
| 34 static bool IsFeatureEnabled(); |
| 35 |
32 // Factory method to access the singleton. We have this method here instead of | 36 // Factory method to access the singleton. We have this method here instead of |
33 // using Singleton<> directly in the calling code to aid tests in injection | 37 // using Singleton<> directly in the calling code to aid tests in injection |
34 // mocks. | 38 // mocks. |
35 static SpeechInputManager* Get(); | 39 static SpeechInputManager* Get(); |
36 // Factory method definition useful for tests. | 40 // Factory method definition useful for tests. |
37 typedef SpeechInputManager* (AccessorMethod)(); | 41 typedef SpeechInputManager* (AccessorMethod)(); |
38 | 42 |
39 virtual ~SpeechInputManager() {} | 43 virtual ~SpeechInputManager() {} |
40 | 44 |
41 // Handlers for requests from render views. | 45 // Handlers for requests from render views. |
(...skipping 15 matching lines...) Expand all Loading... |
57 | 61 |
58 // This typedef is to workaround the issue with certain versions of | 62 // This typedef is to workaround the issue with certain versions of |
59 // Visual Studio where it gets confused between multiple Delegate | 63 // Visual Studio where it gets confused between multiple Delegate |
60 // classes and gives a C2500 error. (I saw this error on the try bots - | 64 // classes and gives a C2500 error. (I saw this error on the try bots - |
61 // the workaround was not needed for my machine). | 65 // the workaround was not needed for my machine). |
62 typedef SpeechInputManager::Delegate SpeechInputManagerDelegate; | 66 typedef SpeechInputManager::Delegate SpeechInputManagerDelegate; |
63 | 67 |
64 } // namespace speech_input | 68 } // namespace speech_input |
65 | 69 |
66 #endif // CHROME_BROWSER_SPEECH_SPEECH_INPUT_MANAGER_H_ | 70 #endif // CHROME_BROWSER_SPEECH_SPEECH_INPUT_MANAGER_H_ |
OLD | NEW |