| 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 #include "content/browser/speech/speech_recognition_manager_impl.h" | 5 #include "content/browser/speech/speech_recognition_manager_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "content/browser/browser_main_loop.h" | 8 #include "content/browser/browser_main_loop.h" |
| 9 #include "content/browser/speech/google_one_shot_remote_engine.h" | 9 #include "content/browser/speech/google_one_shot_remote_engine.h" |
| 10 #include "content/browser/speech/google_streaming_remote_engine.h" | 10 #include "content/browser/speech/google_streaming_remote_engine.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 using content::SpeechRecognitionEventListener; | 27 using content::SpeechRecognitionEventListener; |
| 28 using content::SpeechRecognitionManager; | 28 using content::SpeechRecognitionManager; |
| 29 using content::SpeechRecognitionResult; | 29 using content::SpeechRecognitionResult; |
| 30 using content::SpeechRecognitionSessionContext; | 30 using content::SpeechRecognitionSessionContext; |
| 31 using content::SpeechRecognitionSessionConfig; | 31 using content::SpeechRecognitionSessionConfig; |
| 32 | 32 |
| 33 namespace content { | 33 namespace content { |
| 34 SpeechRecognitionManager* SpeechRecognitionManager::GetInstance() { | 34 SpeechRecognitionManager* SpeechRecognitionManager::GetInstance() { |
| 35 return speech::SpeechRecognitionManagerImpl::GetInstance(); | 35 return speech::SpeechRecognitionManagerImpl::GetInstance(); |
| 36 } | 36 } |
| 37 |
| 38 void SpeechRecognitionManager::SetAudioManagerForTests( |
| 39 media::AudioManager* audio_manager) { |
| 40 speech::SpeechRecognizer::SetAudioManagerForTests(audio_manager); |
| 41 } |
| 42 |
| 43 void SpeechRecognitionManager::SetURLFetcherIDForTests(int url_fetcher_id) { |
| 44 speech::GoogleOneShotRemoteEngine::url_fetcher_id_for_tests = url_fetcher_id; |
| 45 } |
| 37 } // namespace content | 46 } // namespace content |
| 38 | 47 |
| 39 namespace { | 48 namespace { |
| 40 speech::SpeechRecognitionManagerImpl* g_speech_recognition_manager_impl; | 49 speech::SpeechRecognitionManagerImpl* g_speech_recognition_manager_impl; |
| 41 | 50 |
| 42 void ShowAudioInputSettingsOnFileThread() { | 51 void ShowAudioInputSettingsOnFileThread() { |
| 43 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 52 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 44 media::AudioManager* audio_manager = BrowserMainLoop::GetAudioManager(); | 53 media::AudioManager* audio_manager = BrowserMainLoop::GetAudioManager(); |
| 45 DCHECK(audio_manager->CanShowAudioInputSettings()); | 54 DCHECK(audio_manager->CanShowAudioInputSettings()); |
| 46 if (audio_manager->CanShowAudioInputSettings()) | 55 if (audio_manager->CanShowAudioInputSettings()) |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 | 551 |
| 543 SpeechRecognitionManagerImpl::Session::Session() | 552 SpeechRecognitionManagerImpl::Session::Session() |
| 544 : id(kSessionIDInvalid), | 553 : id(kSessionIDInvalid), |
| 545 listener_is_active(true) { | 554 listener_is_active(true) { |
| 546 } | 555 } |
| 547 | 556 |
| 548 SpeechRecognitionManagerImpl::Session::~Session() { | 557 SpeechRecognitionManagerImpl::Session::~Session() { |
| 549 } | 558 } |
| 550 | 559 |
| 551 } // namespace speech | 560 } // namespace speech |
| OLD | NEW |