| 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 #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/renderer_host/media/media_stream_manager.h" | 9 #include "content/browser/renderer_host/media/media_stream_manager.h" |
| 10 #include "content/browser/speech/google_one_shot_remote_engine.h" | 10 #include "content/browser/speech/google_one_shot_remote_engine.h" |
| (...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 | 648 |
| 649 const SpeechRecognitionSessionConfig& | 649 const SpeechRecognitionSessionConfig& |
| 650 SpeechRecognitionManagerImpl::GetSessionConfig(int session_id) const { | 650 SpeechRecognitionManagerImpl::GetSessionConfig(int session_id) const { |
| 651 return GetSession(session_id).config; | 651 return GetSession(session_id).config; |
| 652 } | 652 } |
| 653 | 653 |
| 654 bool SpeechRecognitionManagerImpl::HasAudioInputDevices() { | 654 bool SpeechRecognitionManagerImpl::HasAudioInputDevices() { |
| 655 return BrowserMainLoop::GetAudioManager()->HasAudioInputDevices(); | 655 return BrowserMainLoop::GetAudioManager()->HasAudioInputDevices(); |
| 656 } | 656 } |
| 657 | 657 |
| 658 bool SpeechRecognitionManagerImpl::IsCapturingAudio() { | |
| 659 return BrowserMainLoop::GetAudioManager()->IsRecordingInProcess(); | |
| 660 } | |
| 661 | |
| 662 string16 SpeechRecognitionManagerImpl::GetAudioInputDeviceModel() { | 658 string16 SpeechRecognitionManagerImpl::GetAudioInputDeviceModel() { |
| 663 return BrowserMainLoop::GetAudioManager()->GetAudioInputDeviceModel(); | 659 return BrowserMainLoop::GetAudioManager()->GetAudioInputDeviceModel(); |
| 664 } | 660 } |
| 665 | 661 |
| 666 void SpeechRecognitionManagerImpl::ShowAudioInputSettings() { | 662 void SpeechRecognitionManagerImpl::ShowAudioInputSettings() { |
| 667 // Since AudioManager::ShowAudioInputSettings can potentially launch external | 663 // Since AudioManager::ShowAudioInputSettings can potentially launch external |
| 668 // processes, do that in the FILE thread to not block the calling threads. | 664 // processes, do that in the FILE thread to not block the calling threads. |
| 669 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 665 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
| 670 base::Bind(&ShowAudioInputSettingsOnFileThread)); | 666 base::Bind(&ShowAudioInputSettingsOnFileThread)); |
| 671 } | 667 } |
| 672 | 668 |
| 673 SpeechRecognitionManagerImpl::Session::Session() | 669 SpeechRecognitionManagerImpl::Session::Session() |
| 674 : id(kSessionIDInvalid), | 670 : id(kSessionIDInvalid), |
| 675 listener_is_active(true) { | 671 listener_is_active(true) { |
| 676 } | 672 } |
| 677 | 673 |
| 678 SpeechRecognitionManagerImpl::Session::~Session() { | 674 SpeechRecognitionManagerImpl::Session::~Session() { |
| 679 } | 675 } |
| 680 | 676 |
| 681 } // namespace content | 677 } // namespace content |
| OLD | NEW |