diff options
author | satish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-26 14:55:51 +0000 |
---|---|---|
committer | satish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-26 14:55:51 +0000 |
commit | c4734d414ea93fdd8dbb22caa1dd9f4901aeb9f0 (patch) | |
tree | db875e34abb92a79fcffd5d47b0b7df898bd2800 /chrome/renderer/speech_input_dispatcher.cc | |
parent | 790ff98076d7bf7354a96637a1a6609c0e096668 (diff) | |
download | chromium_src-c4734d414ea93fdd8dbb22caa1dd9f4901aeb9f0.zip chromium_src-c4734d414ea93fdd8dbb22caa1dd9f4901aeb9f0.tar.gz chromium_src-c4734d414ea93fdd8dbb22caa1dd9f4901aeb9f0.tar.bz2 |
Add ability to parse multiple recognition results and send them to WebKit.
The relevant Webkit change was submitted earlier: http://bugs.webkit.org/show_bug.cgi?id=48068
The unit tests have been updated for the multi-results case as well.
BUG=none
TEST=unit_tests --gtest_filter=Speech*
Review URL: http://codereview.chromium.org/4119004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63891 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/speech_input_dispatcher.cc')
-rw-r--r-- | chrome/renderer/speech_input_dispatcher.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/chrome/renderer/speech_input_dispatcher.cc b/chrome/renderer/speech_input_dispatcher.cc index 41b850a..dc4e1ff 100644 --- a/chrome/renderer/speech_input_dispatcher.cc +++ b/chrome/renderer/speech_input_dispatcher.cc @@ -66,9 +66,11 @@ void SpeechInputDispatcher::stopRecording(int request_id) { } void SpeechInputDispatcher::OnSpeechRecognitionResult( - int request_id, const string16& result) { + int request_id, const speech_input::SpeechInputResultArray& result) { VLOG(1) << "SpeechInputDispatcher::OnSpeechRecognitionResult enter"; - WebKit::WebString webkit_result(result); + WebKit::WebSpeechInputResultArray webkit_result(result.size()); + for (size_t i = 0; i < result.size(); ++i) + webkit_result[i].set(result[i].utterance, result[i].confidence); listener_->setRecognitionResult(request_id, webkit_result); VLOG(1) << "SpeechInputDispatcher::OnSpeechRecognitionResult exit"; } |