| 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 namespace { |
| 22 const uint32 kFilteredMessageClasses[] = { |
| 23 SpeechRecognitionMsgStart |
| 24 }; |
| 25 } // namespace |
| 21 | 26 |
| 22 SpeechRecognitionDispatcherHost::SpeechRecognitionDispatcherHost( | 27 SpeechRecognitionDispatcherHost::SpeechRecognitionDispatcherHost( |
| 23 bool is_guest, | 28 bool is_guest, |
| 24 int render_process_id, | 29 int render_process_id, |
| 25 net::URLRequestContextGetter* context_getter) | 30 net::URLRequestContextGetter* context_getter) |
| 26 : is_guest_(is_guest), | 31 : BrowserMessageFilter( |
| 32 kFilteredMessageClasses, arraysize(kFilteredMessageClasses)), |
| 33 is_guest_(is_guest), |
| 27 render_process_id_(render_process_id), | 34 render_process_id_(render_process_id), |
| 28 context_getter_(context_getter) { | 35 context_getter_(context_getter) { |
| 29 // Do not add any non-trivial initialization here, instead do it lazily when | 36 // Do not add any non-trivial initialization here, instead do it lazily when |
| 30 // required (e.g. see the method |SpeechRecognitionManager::GetInstance()|) or | 37 // required (e.g. see the method |SpeechRecognitionManager::GetInstance()|) or |
| 31 // add an Init() method. | 38 // add an Init() method. |
| 32 } | 39 } |
| 33 | 40 |
| 34 SpeechRecognitionDispatcherHost::~SpeechRecognitionDispatcherHost() { | 41 SpeechRecognitionDispatcherHost::~SpeechRecognitionDispatcherHost() { |
| 35 SpeechRecognitionManager::GetInstance()->AbortAllSessionsForListener(this); | 42 SpeechRecognitionManager::GetInstance()->AbortAllSessionsForListener(this); |
| 36 } | 43 } |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 void SpeechRecognitionDispatcherHost::OnAudioLevelsChange(int session_id, | 235 void SpeechRecognitionDispatcherHost::OnAudioLevelsChange(int session_id, |
| 229 float volume, | 236 float volume, |
| 230 float noise_volume) { | 237 float noise_volume) { |
| 231 } | 238 } |
| 232 | 239 |
| 233 void SpeechRecognitionDispatcherHost::OnEnvironmentEstimationComplete( | 240 void SpeechRecognitionDispatcherHost::OnEnvironmentEstimationComplete( |
| 234 int session_id) { | 241 int session_id) { |
| 235 } | 242 } |
| 236 | 243 |
| 237 } // namespace content | 244 } // namespace content |
| OLD | NEW |