Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(325)

Side by Side Diff: content/browser/speech/speech_recognition_dispatcher_host.cc

Issue 142923005: Allow MessageFilters to restrict listening to specific message classes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 : is_guest_(is_guest), 26 : BrowserMessageFilter(SpeechRecognitionMsgStart),
27 is_guest_(is_guest),
27 render_process_id_(render_process_id), 28 render_process_id_(render_process_id),
28 context_getter_(context_getter), 29 context_getter_(context_getter),
29 weak_factory_(this) { 30 weak_factory_(this) {
30 // Do not add any non-trivial initialization here, instead do it lazily when 31 // Do not add any non-trivial initialization here, instead do it lazily when
31 // required (e.g. see the method |SpeechRecognitionManager::GetInstance()|) or 32 // required (e.g. see the method |SpeechRecognitionManager::GetInstance()|) or
32 // add an Init() method. 33 // add an Init() method.
33 } 34 }
34 35
35 SpeechRecognitionDispatcherHost::~SpeechRecognitionDispatcherHost() { 36 SpeechRecognitionDispatcherHost::~SpeechRecognitionDispatcherHost() {
36 SpeechRecognitionManager::GetInstance()->AbortAllSessionsForRenderProcess( 37 SpeechRecognitionManager::GetInstance()->AbortAllSessionsForRenderProcess(
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 void SpeechRecognitionDispatcherHost::OnAudioLevelsChange(int session_id, 240 void SpeechRecognitionDispatcherHost::OnAudioLevelsChange(int session_id,
240 float volume, 241 float volume,
241 float noise_volume) { 242 float noise_volume) {
242 } 243 }
243 244
244 void SpeechRecognitionDispatcherHost::OnEnvironmentEstimationComplete( 245 void SpeechRecognitionDispatcherHost::OnEnvironmentEstimationComplete(
245 int session_id) { 246 int session_id) {
246 } 247 }
247 248
248 } // namespace content 249 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/speech/input_tag_speech_dispatcher_host.cc ('k') | content/browser/tracing/trace_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698