summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
authorsatish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-17 11:40:22 +0000
committersatish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-17 11:40:22 +0000
commitc61a6b6d9e4315174806366425fece0da631cc7c (patch)
tree49520f1da513debb0b3264e9317e92ecd89b77f6 /chrome/renderer
parent04d75b6f37e104c672db22cbbba84fa3b21a510d (diff)
downloadchromium_src-c61a6b6d9e4315174806366425fece0da631cc7c.zip
chromium_src-c61a6b6d9e4315174806366425fece0da631cc7c.tar.gz
chromium_src-c61a6b6d9e4315174806366425fece0da631cc7c.tar.bz2
Support for multiple speech enabled elements in same page.
This is the chromium side of https://bugs.webkit.org/show_bug.cgi?id=43922. For all speech input requests WebKit now sends a 'requestId' which identifies the input element within the page. This requestId is returned back to WebKit in all the speech input callbacks/events. Within chromium, the pair (render view id, request id) uniquely identifies a caller and we introduce the SpeechInputCallerId to hold this data. All code which was previously using render view id now uses this caller id. Once this is working fully on both ends I'll add relevant browser tests. BUG=none TEST=manually Review URL: http://codereview.chromium.org/3130018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56333 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r--chrome/renderer/speech_input_dispatcher.cc24
-rw-r--r--chrome/renderer/speech_input_dispatcher.h12
2 files changed, 18 insertions, 18 deletions
diff --git a/chrome/renderer/speech_input_dispatcher.cc b/chrome/renderer/speech_input_dispatcher.cc
index 70989d6..3aaf15f 100644
--- a/chrome/renderer/speech_input_dispatcher.cc
+++ b/chrome/renderer/speech_input_dispatcher.cc
@@ -31,31 +31,31 @@ bool SpeechInputDispatcher::OnMessageReceived(const IPC::Message& message) {
return handled;
}
-bool SpeechInputDispatcher::startRecognition() {
+bool SpeechInputDispatcher::startRecognition(int request_id) {
render_view_->Send(new ViewHostMsg_SpeechInput_StartRecognition(
- render_view_->routing_id()));
+ render_view_->routing_id(), request_id));
return true;
}
-void SpeechInputDispatcher::cancelRecognition() {
+void SpeechInputDispatcher::cancelRecognition(int request_id) {
render_view_->Send(new ViewHostMsg_SpeechInput_CancelRecognition(
- render_view_->routing_id()));
+ render_view_->routing_id(), request_id));
}
-void SpeechInputDispatcher::stopRecording() {
+void SpeechInputDispatcher::stopRecording(int request_id) {
render_view_->Send(new ViewHostMsg_SpeechInput_StopRecording(
- render_view_->routing_id()));
+ render_view_->routing_id(), request_id));
}
void SpeechInputDispatcher::OnSpeechRecognitionResult(
- const string16& result) {
- listener_->setRecognitionResult(result);
+ int request_id, const string16& result) {
+ listener_->setRecognitionResult(request_id, result);
}
-void SpeechInputDispatcher::OnSpeechRecordingComplete() {
- listener_->didCompleteRecording();
+void SpeechInputDispatcher::OnSpeechRecordingComplete(int request_id) {
+ listener_->didCompleteRecording(request_id);
}
-void SpeechInputDispatcher::OnSpeechRecognitionComplete() {
- listener_->didCompleteRecognition();
+void SpeechInputDispatcher::OnSpeechRecognitionComplete(int request_id) {
+ listener_->didCompleteRecognition(request_id);
}
diff --git a/chrome/renderer/speech_input_dispatcher.h b/chrome/renderer/speech_input_dispatcher.h
index ccb69a9..b6f6c4c 100644
--- a/chrome/renderer/speech_input_dispatcher.h
+++ b/chrome/renderer/speech_input_dispatcher.h
@@ -28,14 +28,14 @@ class SpeechInputDispatcher : public WebKit::WebSpeechInputController {
bool OnMessageReceived(const IPC::Message& msg);
// WebKit::WebSpeechInputController.
- bool startRecognition();
- void cancelRecognition();
- void stopRecording();
+ bool startRecognition(int request_id);
+ void cancelRecognition(int request_id);
+ void stopRecording(int request_id);
private:
- void OnSpeechRecognitionResult(const string16& result);
- void OnSpeechRecordingComplete();
- void OnSpeechRecognitionComplete();
+ void OnSpeechRecognitionResult(int request_id, const string16& result);
+ void OnSpeechRecordingComplete(int request_id);
+ void OnSpeechRecognitionComplete(int request_id);
RenderView* render_view_;
WebKit::WebSpeechInputListener* listener_;