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_input_manager.h" | 5 #include "content/browser/speech/speech_input_manager.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "content/browser/renderer_host/render_view_host.h" | 8 #include "content/browser/renderer_host/render_view_host.h" |
9 #include "content/browser/resource_context.h" | 9 #include "content/browser/resource_context.h" |
10 #include "content/browser/speech/speech_input_preferences.h" | 10 #include "content/browser/speech/speech_input_preferences.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 return; | 86 return; |
87 } | 87 } |
88 | 88 |
89 DCHECK(audio_manager->CanShowAudioInputSettings()); | 89 DCHECK(audio_manager->CanShowAudioInputSettings()); |
90 if (audio_manager->CanShowAudioInputSettings()) | 90 if (audio_manager->CanShowAudioInputSettings()) |
91 audio_manager->ShowAudioInputSettings(); | 91 audio_manager->ShowAudioInputSettings(); |
92 } | 92 } |
93 | 93 |
94 // static | 94 // static |
95 void SpeechInputManager::ShowAudioInputSettingsFromUI( | 95 void SpeechInputManager::ShowAudioInputSettingsFromUI( |
96 const content::ResourceContext* resource_context) { | 96 content::ResourceContext* resource_context) { |
97 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { | 97 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { |
98 BrowserThread::PostTask( | 98 BrowserThread::PostTask( |
99 BrowserThread::IO, FROM_HERE, | 99 BrowserThread::IO, FROM_HERE, |
100 base::Bind(&SpeechInputManager::ShowAudioInputSettingsFromUI, | 100 base::Bind(&SpeechInputManager::ShowAudioInputSettingsFromUI, |
101 base::Unretained(resource_context))); | 101 base::Unretained(resource_context))); |
102 return; | 102 return; |
103 } | 103 } |
104 ShowAudioInputSettings(resource_context->audio_manager()); | 104 ShowAudioInputSettings(resource_context->GetAudioManager()); |
105 } | 105 } |
106 | 106 |
107 void SpeechInputManager::StartRecognition( | 107 void SpeechInputManager::StartRecognition( |
108 SpeechInputManagerDelegate* delegate, | 108 SpeechInputManagerDelegate* delegate, |
109 int caller_id, | 109 int caller_id, |
110 int render_process_id, | 110 int render_process_id, |
111 int render_view_id, | 111 int render_view_id, |
112 const gfx::Rect& element_rect, | 112 const gfx::Rect& element_rect, |
113 const std::string& language, | 113 const std::string& language, |
114 const std::string& grammar, | 114 const std::string& grammar, |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 | 305 |
306 SpeechInputManager::SpeechInputRequest::SpeechInputRequest() | 306 SpeechInputManager::SpeechInputRequest::SpeechInputRequest() |
307 : delegate(NULL), | 307 : delegate(NULL), |
308 is_active(false) { | 308 is_active(false) { |
309 } | 309 } |
310 | 310 |
311 SpeechInputManager::SpeechInputRequest::~SpeechInputRequest() { | 311 SpeechInputManager::SpeechInputRequest::~SpeechInputRequest() { |
312 } | 312 } |
313 | 313 |
314 } // namespace speech_input | 314 } // namespace speech_input |
OLD | NEW |