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_dispatcher_host.h" | 5 #include "content/browser/speech/speech_recognition_dispatcher_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 10 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
11 #include "content/browser/renderer_host/render_view_host_impl.h" | 11 #include "content/browser/renderer_host/render_view_host_impl.h" |
12 #include "content/browser/speech/speech_recognition_manager_impl.h" | 12 #include "content/browser/speech/speech_recognition_manager_impl.h" |
13 #include "content/browser/web_contents/web_contents_impl.h" | 13 #include "content/browser/web_contents/web_contents_impl.h" |
14 #include "content/common/speech_recognition_messages.h" | 14 #include "content/common/speech_recognition_messages.h" |
15 #include "content/public/browser/speech_recognition_manager_delegate.h" | 15 #include "content/public/browser/speech_recognition_manager_delegate.h" |
16 #include "content/public/browser/speech_recognition_session_config.h" | 16 #include "content/public/browser/speech_recognition_session_config.h" |
17 #include "content/public/browser/speech_recognition_session_context.h" | 17 #include "content/public/browser/speech_recognition_session_context.h" |
18 #include "content/public/common/content_switches.h" | 18 #include "content/public/common/content_switches.h" |
19 | 19 |
20 namespace content { | 20 namespace content { |
21 | 21 |
22 SpeechRecognitionDispatcherHost::SpeechRecognitionDispatcherHost( | 22 SpeechRecognitionDispatcherHost::SpeechRecognitionDispatcherHost( |
23 bool is_guest, | 23 bool is_guest, |
24 int render_process_id, | 24 int render_process_id, |
25 net::URLRequestContextGetter* context_getter) | 25 net::URLRequestContextGetter* context_getter) |
26 : BrowserMessageFilter(SpeechRecognitionMsgStart), | 26 : is_guest_(is_guest), |
27 is_guest_(is_guest), | |
28 render_process_id_(render_process_id), | 27 render_process_id_(render_process_id), |
29 context_getter_(context_getter), | 28 context_getter_(context_getter), |
30 weak_factory_(this) { | 29 weak_factory_(this) { |
31 // Do not add any non-trivial initialization here, instead do it lazily when | 30 // Do not add any non-trivial initialization here, instead do it lazily when |
32 // required (e.g. see the method |SpeechRecognitionManager::GetInstance()|) or | 31 // required (e.g. see the method |SpeechRecognitionManager::GetInstance()|) or |
33 // add an Init() method. | 32 // add an Init() method. |
34 } | 33 } |
35 | 34 |
36 SpeechRecognitionDispatcherHost::~SpeechRecognitionDispatcherHost() { | 35 SpeechRecognitionDispatcherHost::~SpeechRecognitionDispatcherHost() { |
37 SpeechRecognitionManager::GetInstance()->AbortAllSessionsForRenderProcess( | 36 SpeechRecognitionManager::GetInstance()->AbortAllSessionsForRenderProcess( |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 void SpeechRecognitionDispatcherHost::OnAudioLevelsChange(int session_id, | 239 void SpeechRecognitionDispatcherHost::OnAudioLevelsChange(int session_id, |
241 float volume, | 240 float volume, |
242 float noise_volume) { | 241 float noise_volume) { |
243 } | 242 } |
244 | 243 |
245 void SpeechRecognitionDispatcherHost::OnEnvironmentEstimationComplete( | 244 void SpeechRecognitionDispatcherHost::OnEnvironmentEstimationComplete( |
246 int session_id) { | 245 int session_id) { |
247 } | 246 } |
248 | 247 |
249 } // namespace content | 248 } // namespace content |
OLD | NEW |