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/common/speech_recognition_messages.h" | 10 #include "content/common/speech_recognition_messages.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 context.requested_by_page_element = false; | 72 context.requested_by_page_element = false; |
73 | 73 |
74 SpeechRecognitionSessionConfig config; | 74 SpeechRecognitionSessionConfig config; |
75 config.is_legacy_api = false; | 75 config.is_legacy_api = false; |
76 config.language = params.language; | 76 config.language = params.language; |
77 config.grammars = params.grammars; | 77 config.grammars = params.grammars; |
78 config.max_hypotheses = params.max_hypotheses; | 78 config.max_hypotheses = params.max_hypotheses; |
79 config.origin_url = params.origin_url; | 79 config.origin_url = params.origin_url; |
80 config.initial_context = context; | 80 config.initial_context = context; |
81 config.url_request_context_getter = context_getter_.get(); | 81 config.url_request_context_getter = context_getter_.get(); |
82 if (recognition_preferences_) { | 82 if (recognition_preferences_.get()) { |
83 config.filter_profanities = recognition_preferences_->FilterProfanities(); | 83 config.filter_profanities = recognition_preferences_->FilterProfanities(); |
84 } else { | 84 } else { |
85 config.filter_profanities = false; | 85 config.filter_profanities = false; |
86 } | 86 } |
87 config.continuous = params.continuous; | 87 config.continuous = params.continuous; |
88 config.interim_results = params.interim_results; | 88 config.interim_results = params.interim_results; |
89 config.event_listener = this; | 89 config.event_listener = this; |
90 | 90 |
91 int session_id = manager()->CreateSession(config); | 91 int session_id = manager()->CreateSession(config); |
92 DCHECK_NE(session_id, SpeechRecognitionManager::kSessionIDInvalid); | 92 DCHECK_NE(session_id, SpeechRecognitionManager::kSessionIDInvalid); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 void SpeechRecognitionDispatcherHost::OnAudioLevelsChange(int session_id, | 185 void SpeechRecognitionDispatcherHost::OnAudioLevelsChange(int session_id, |
186 float volume, | 186 float volume, |
187 float noise_volume) { | 187 float noise_volume) { |
188 } | 188 } |
189 | 189 |
190 void SpeechRecognitionDispatcherHost::OnEnvironmentEstimationComplete( | 190 void SpeechRecognitionDispatcherHost::OnEnvironmentEstimationComplete( |
191 int session_id) { | 191 int session_id) { |
192 } | 192 } |
193 | 193 |
194 } // namespace content | 194 } // namespace content |
OLD | NEW |