OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/browser/browser_thread.h" | 7 #include "content/browser/browser_thread.h" |
8 #include "content/browser/speech/speech_input_preferences.h" | 8 #include "content/browser/speech/speech_input_preferences.h" |
9 #include "media/audio/audio_manager.h" | 9 #include "media/audio/audio_manager.h" |
10 | 10 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 DCHECK(!HasPendingRequest(caller_id)); | 58 DCHECK(!HasPendingRequest(caller_id)); |
59 | 59 |
60 ShowRecognitionRequested( | 60 ShowRecognitionRequested( |
61 caller_id, render_process_id, render_view_id, element_rect); | 61 caller_id, render_process_id, render_view_id, element_rect); |
62 GetRequestInfo(&can_report_metrics_, &request_info_); | 62 GetRequestInfo(&can_report_metrics_, &request_info_); |
63 | 63 |
64 SpeechInputRequest* request = &requests_[caller_id]; | 64 SpeechInputRequest* request = &requests_[caller_id]; |
65 request->delegate = delegate; | 65 request->delegate = delegate; |
66 request->recognizer = new SpeechRecognizer( | 66 request->recognizer = new SpeechRecognizer( |
67 this, caller_id, language, grammar, context_getter, | 67 this, caller_id, language, grammar, context_getter, |
68 speech_input_prefs->censor_results(), | 68 speech_input_prefs->filter_profanities(), |
69 request_info_, can_report_metrics_ ? origin_url : ""); | 69 request_info_, can_report_metrics_ ? origin_url : ""); |
70 request->is_active = false; | 70 request->is_active = false; |
71 | 71 |
72 StartRecognitionForRequest(caller_id); | 72 StartRecognitionForRequest(caller_id); |
73 } | 73 } |
74 | 74 |
75 void SpeechInputManager::StartRecognitionForRequest(int caller_id) { | 75 void SpeechInputManager::StartRecognitionForRequest(int caller_id) { |
76 DCHECK(HasPendingRequest(caller_id)); | 76 DCHECK(HasPendingRequest(caller_id)); |
77 | 77 |
78 // If we are currently recording audio for another caller, abort that cleanly. | 78 // If we are currently recording audio for another caller, abort that cleanly. |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 195 |
196 SpeechInputManager::SpeechInputRequest::SpeechInputRequest() | 196 SpeechInputManager::SpeechInputRequest::SpeechInputRequest() |
197 : delegate(NULL), | 197 : delegate(NULL), |
198 is_active(false) { | 198 is_active(false) { |
199 } | 199 } |
200 | 200 |
201 SpeechInputManager::SpeechInputRequest::~SpeechInputRequest() { | 201 SpeechInputManager::SpeechInputRequest::~SpeechInputRequest() { |
202 } | 202 } |
203 | 203 |
204 } // namespace speech_input | 204 } // namespace speech_input |
OLD | NEW |