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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 virtual void OnRecognitionResult( | 92 virtual void OnRecognitionResult( |
93 int session_id, const content::SpeechRecognitionResult& result) OVERRIDE; | 93 int session_id, const content::SpeechRecognitionResult& result) OVERRIDE; |
94 virtual void OnRecognitionError( | 94 virtual void OnRecognitionError( |
95 int session_id, const content::SpeechRecognitionError& error) OVERRIDE; | 95 int session_id, const content::SpeechRecognitionError& error) OVERRIDE; |
96 virtual void OnAudioLevelsChange(int session_id, float volume, | 96 virtual void OnAudioLevelsChange(int session_id, float volume, |
97 float noise_volume) OVERRIDE; | 97 float noise_volume) OVERRIDE; |
98 | 98 |
99 protected: | 99 protected: |
100 // BrowserMainLoop is the only one allowed to istantiate and free us. | 100 // BrowserMainLoop is the only one allowed to istantiate and free us. |
101 friend class content::BrowserMainLoop; | 101 friend class content::BrowserMainLoop; |
102 friend class scoped_ptr<SpeechRecognitionManagerImpl>; // Needed for dtor. | 102 |
| 103 // Needed for dtor. |
| 104 friend struct base::DefaultDeleter<SpeechRecognitionManagerImpl>; |
| 105 |
103 SpeechRecognitionManagerImpl(); | 106 SpeechRecognitionManagerImpl(); |
104 virtual ~SpeechRecognitionManagerImpl(); | 107 virtual ~SpeechRecognitionManagerImpl(); |
105 | 108 |
106 private: | 109 private: |
107 // Data types for the internal Finite State Machine (FSM). | 110 // Data types for the internal Finite State Machine (FSM). |
108 enum FSMState { | 111 enum FSMState { |
109 SESSION_STATE_IDLE = 0, | 112 SESSION_STATE_IDLE = 0, |
110 SESSION_STATE_CAPTURING_AUDIO, | 113 SESSION_STATE_CAPTURING_AUDIO, |
111 SESSION_STATE_WAITING_FOR_RESULT, | 114 SESSION_STATE_WAITING_FOR_RESULT, |
112 SESSION_STATE_MAX_VALUE = SESSION_STATE_WAITING_FOR_RESULT | 115 SESSION_STATE_MAX_VALUE = SESSION_STATE_WAITING_FOR_RESULT |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 180 |
178 #if !defined(OS_IOS) | 181 #if !defined(OS_IOS) |
179 class PermissionRequest; | 182 class PermissionRequest; |
180 scoped_ptr<PermissionRequest> permission_request_; | 183 scoped_ptr<PermissionRequest> permission_request_; |
181 #endif // !defined(OS_IOS) | 184 #endif // !defined(OS_IOS) |
182 }; | 185 }; |
183 | 186 |
184 } // namespace speech | 187 } // namespace speech |
185 | 188 |
186 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_MANAGER_IMPL_H_ | 189 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_MANAGER_IMPL_H_ |
OLD | NEW |