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

Side by Side Diff: chrome/renderer/speech_input_dispatcher.cc

Issue 4119004: Add ability to parse multiple recognition results and send them to WebKit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move header to chrome/common and address review comments. Created 10 years, 1 month 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
« no previous file with comments | « chrome/renderer/speech_input_dispatcher.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/renderer/speech_input_dispatcher.h" 5 #include "chrome/renderer/speech_input_dispatcher.h"
6 6
7 #include "chrome/renderer/render_view.h" 7 #include "chrome/renderer/render_view.h"
8 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" 8 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h"
9 #include "third_party/WebKit/WebKit/chromium/public/WebSpeechInputListener.h" 9 #include "third_party/WebKit/WebKit/chromium/public/WebSpeechInputListener.h"
10 #include "third_party/WebKit/WebKit/chromium/public/WebSize.h" 10 #include "third_party/WebKit/WebKit/chromium/public/WebSize.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 } 59 }
60 60
61 void SpeechInputDispatcher::stopRecording(int request_id) { 61 void SpeechInputDispatcher::stopRecording(int request_id) {
62 VLOG(1) << "SpeechInputDispatcher::stopRecording enter"; 62 VLOG(1) << "SpeechInputDispatcher::stopRecording enter";
63 render_view_->Send(new ViewHostMsg_SpeechInput_StopRecording( 63 render_view_->Send(new ViewHostMsg_SpeechInput_StopRecording(
64 render_view_->routing_id(), request_id)); 64 render_view_->routing_id(), request_id));
65 VLOG(1) << "SpeechInputDispatcher::stopRecording exit"; 65 VLOG(1) << "SpeechInputDispatcher::stopRecording exit";
66 } 66 }
67 67
68 void SpeechInputDispatcher::OnSpeechRecognitionResult( 68 void SpeechInputDispatcher::OnSpeechRecognitionResult(
69 int request_id, const string16& result) { 69 int request_id, const speech_input::SpeechInputResultArray& result) {
70 VLOG(1) << "SpeechInputDispatcher::OnSpeechRecognitionResult enter"; 70 VLOG(1) << "SpeechInputDispatcher::OnSpeechRecognitionResult enter";
71 WebKit::WebString webkit_result(result); 71 WebKit::WebSpeechInputResultArray webkit_result(result.size());
72 for (size_t i = 0; i < result.size(); ++i)
73 webkit_result[i].set(result[i].utterance, result[i].confidence);
72 listener_->setRecognitionResult(request_id, webkit_result); 74 listener_->setRecognitionResult(request_id, webkit_result);
73 VLOG(1) << "SpeechInputDispatcher::OnSpeechRecognitionResult exit"; 75 VLOG(1) << "SpeechInputDispatcher::OnSpeechRecognitionResult exit";
74 } 76 }
75 77
76 void SpeechInputDispatcher::OnSpeechRecordingComplete(int request_id) { 78 void SpeechInputDispatcher::OnSpeechRecordingComplete(int request_id) {
77 VLOG(1) << "SpeechInputDispatcher::OnSpeechRecordingComplete enter"; 79 VLOG(1) << "SpeechInputDispatcher::OnSpeechRecordingComplete enter";
78 listener_->didCompleteRecording(request_id); 80 listener_->didCompleteRecording(request_id);
79 VLOG(1) << "SpeechInputDispatcher::OnSpeechRecordingComplete exit"; 81 VLOG(1) << "SpeechInputDispatcher::OnSpeechRecordingComplete exit";
80 } 82 }
81 83
82 void SpeechInputDispatcher::OnSpeechRecognitionComplete(int request_id) { 84 void SpeechInputDispatcher::OnSpeechRecognitionComplete(int request_id) {
83 VLOG(1) << "SpeechInputDispatcher::OnSpeechRecognitionComplete enter"; 85 VLOG(1) << "SpeechInputDispatcher::OnSpeechRecognitionComplete enter";
84 listener_->didCompleteRecognition(request_id); 86 listener_->didCompleteRecognition(request_id);
85 VLOG(1) << "SpeechInputDispatcher::OnSpeechRecognitionComplete exit"; 87 VLOG(1) << "SpeechInputDispatcher::OnSpeechRecognitionComplete exit";
86 } 88 }
OLDNEW
« no previous file with comments | « chrome/renderer/speech_input_dispatcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698