| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 189 |
| 190 SpeechInputManager::SpeechInputRequest::SpeechInputRequest() | 190 SpeechInputManager::SpeechInputRequest::SpeechInputRequest() |
| 191 : delegate(NULL), | 191 : delegate(NULL), |
| 192 is_active(false) { | 192 is_active(false) { |
| 193 } | 193 } |
| 194 | 194 |
| 195 SpeechInputManager::SpeechInputRequest::~SpeechInputRequest() { | 195 SpeechInputManager::SpeechInputRequest::~SpeechInputRequest() { |
| 196 } | 196 } |
| 197 | 197 |
| 198 } // namespace speech_input | 198 } // namespace speech_input |
| OLD | NEW |