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

Side by Side Diff: chrome/browser/speech/speech_input_manager.cc

Issue 7086005: Context menu for "Voice recognition options" (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: No changes (Just trying to get commit-bot to wake up) Created 9 years, 4 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 | Annotate | Revision Log
OLDNEW
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 <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 // subsequent requests may have the hardware info available if the fetch 220 // subsequent requests may have the hardware info available if the fetch
221 // completed before them. This way we don't end up stalling the user with 221 // completed before them. This way we don't end up stalling the user with
222 // a long wait and disk seeks when they click on a UI element and start 222 // a long wait and disk seeks when they click on a UI element and start
223 // speaking. 223 // speaking.
224 optional_request_info_->Refresh(); 224 optional_request_info_->Refresh();
225 } 225 }
226 226
227 SpeechInputRequest* request = &requests_[caller_id]; 227 SpeechInputRequest* request = &requests_[caller_id];
228 request->delegate = delegate; 228 request->delegate = delegate;
229 request->recognizer = new SpeechRecognizer( 229 request->recognizer = new SpeechRecognizer(
230 this, caller_id, language, grammar, optional_request_info_->value(), 230 this, caller_id, language, grammar, censor_results(),
231 optional_request_info_->value(),
231 optional_request_info_->can_report_metrics() ? origin_url : ""); 232 optional_request_info_->can_report_metrics() ? origin_url : "");
232 request->is_active = false; 233 request->is_active = false;
233 234
234 StartRecognitionForRequest(caller_id); 235 StartRecognitionForRequest(caller_id);
235 } 236 }
236 237
237 void SpeechInputManagerImpl::StartRecognitionForRequest(int caller_id) { 238 void SpeechInputManagerImpl::StartRecognitionForRequest(int caller_id) {
238 DCHECK(HasPendingRequest(caller_id)); 239 DCHECK(HasPendingRequest(caller_id));
239 240
240 // If we are currently recording audio for another caller, abort that cleanly. 241 // If we are currently recording audio for another caller, abort that cleanly.
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 // to the user, abort it since user has switched focus. Otherwise 388 // to the user, abort it since user has switched focus. Otherwise
388 // recognition has started and keep that going so user can start speaking to 389 // recognition has started and keep that going so user can start speaking to
389 // another element while this gets the results in parallel. 390 // another element while this gets the results in parallel.
390 if (recording_caller_id_ == caller_id || !requests_[caller_id].is_active) { 391 if (recording_caller_id_ == caller_id || !requests_[caller_id].is_active) {
391 CancelRecognitionAndInformDelegate(caller_id); 392 CancelRecognitionAndInformDelegate(caller_id);
392 } 393 }
393 } 394 }
394 } 395 }
395 396
396 } // namespace speech_input 397 } // namespace speech_input
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_impl.cc ('k') | chrome/browser/tab_contents/render_view_context_menu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698