| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_RECOGNIZER_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_IMPL_H_ |
| 6 #define CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_IMPL_H_ | 6 #define CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "content/browser/speech/endpointer/endpointer.h" | 11 #include "content/browser/speech/endpointer/endpointer.h" |
| 11 #include "content/browser/speech/speech_recognition_engine.h" | 12 #include "content/browser/speech/speech_recognition_engine.h" |
| 12 #include "content/browser/speech/speech_recognizer.h" | 13 #include "content/browser/speech/speech_recognizer.h" |
| 13 #include "content/public/common/speech_recognition_error.h" | 14 #include "content/public/common/speech_recognition_error.h" |
| 14 #include "content/public/common/speech_recognition_result.h" | 15 #include "content/public/common/speech_recognition_result.h" |
| 15 #include "media/audio/audio_input_controller.h" | 16 #include "media/audio/audio_input_controller.h" |
| 16 #include "media/audio/audio_logging.h" | 17 #include "media/audio/audio_logging.h" |
| 17 #include "net/url_request/url_request_context_getter.h" | 18 #include "net/url_request/url_request_context_getter.h" |
| 18 | 19 |
| 19 namespace media { | 20 namespace media { |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 | 142 |
| 142 // SpeechRecognitionEngineDelegate methods. | 143 // SpeechRecognitionEngineDelegate methods. |
| 143 void OnSpeechRecognitionEngineResults( | 144 void OnSpeechRecognitionEngineResults( |
| 144 const SpeechRecognitionResults& results) override; | 145 const SpeechRecognitionResults& results) override; |
| 145 void OnSpeechRecognitionEngineEndOfUtterance() override; | 146 void OnSpeechRecognitionEngineEndOfUtterance() override; |
| 146 void OnSpeechRecognitionEngineError( | 147 void OnSpeechRecognitionEngineError( |
| 147 const SpeechRecognitionError& error) override; | 148 const SpeechRecognitionError& error) override; |
| 148 | 149 |
| 149 static media::AudioManager* audio_manager_for_tests_; | 150 static media::AudioManager* audio_manager_for_tests_; |
| 150 | 151 |
| 151 scoped_ptr<SpeechRecognitionEngine> recognition_engine_; | 152 std::unique_ptr<SpeechRecognitionEngine> recognition_engine_; |
| 152 Endpointer endpointer_; | 153 Endpointer endpointer_; |
| 153 scoped_refptr<media::AudioInputController> audio_controller_; | 154 scoped_refptr<media::AudioInputController> audio_controller_; |
| 154 scoped_ptr<media::AudioLog> audio_log_; | 155 std::unique_ptr<media::AudioLog> audio_log_; |
| 155 int num_samples_recorded_; | 156 int num_samples_recorded_; |
| 156 float audio_level_; | 157 float audio_level_; |
| 157 bool is_dispatching_event_; | 158 bool is_dispatching_event_; |
| 158 bool provisional_results_; | 159 bool provisional_results_; |
| 159 bool end_of_utterance_; | 160 bool end_of_utterance_; |
| 160 FSMState state_; | 161 FSMState state_; |
| 161 std::string device_id_; | 162 std::string device_id_; |
| 162 | 163 |
| 163 class OnDataConverter; | 164 class OnDataConverter; |
| 164 | 165 |
| 165 // Converts data between native input format and a WebSpeech specific | 166 // Converts data between native input format and a WebSpeech specific |
| 166 // output format. | 167 // output format. |
| 167 scoped_ptr<SpeechRecognizerImpl::OnDataConverter> audio_converter_; | 168 std::unique_ptr<SpeechRecognizerImpl::OnDataConverter> audio_converter_; |
| 168 | 169 |
| 169 DISALLOW_COPY_AND_ASSIGN(SpeechRecognizerImpl); | 170 DISALLOW_COPY_AND_ASSIGN(SpeechRecognizerImpl); |
| 170 }; | 171 }; |
| 171 | 172 |
| 172 } // namespace content | 173 } // namespace content |
| 173 | 174 |
| 174 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_IMPL_H_ | 175 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_IMPL_H_ |
| OLD | NEW |