| Index: chrome/renderer/speech_input_dispatcher.cc
|
| diff --git a/chrome/renderer/speech_input_dispatcher.cc b/chrome/renderer/speech_input_dispatcher.cc
|
| index 9ea368f427d070ca563deeb6c91f171c5b5dd5f9..ec2b0a9f07370439e6b870c1627c193f7ed56975 100644
|
| --- a/chrome/renderer/speech_input_dispatcher.cc
|
| +++ b/chrome/renderer/speech_input_dispatcher.cc
|
| @@ -5,10 +5,12 @@
|
| #include "chrome/renderer/speech_input_dispatcher.h"
|
|
|
| #include "base/utf_string_conversions.h"
|
| +#include "chrome/common/speech_input_messages.h"
|
| #include "chrome/renderer/render_view.h"
|
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
|
| -#include "third_party/WebKit/Source/WebKit/chromium/public/WebSpeechInputListener.h"
|
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebSize.h"
|
| +#include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h"
|
| +#include "third_party/WebKit/Source/WebKit/chromium/public/WebSpeechInputListener.h"
|
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
|
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
|
|
|
| @@ -24,11 +26,11 @@ SpeechInputDispatcher::SpeechInputDispatcher(
|
| bool SpeechInputDispatcher::OnMessageReceived(const IPC::Message& message) {
|
| bool handled = true;
|
| IPC_BEGIN_MESSAGE_MAP(SpeechInputDispatcher, message)
|
| - IPC_MESSAGE_HANDLER(ViewMsg_SpeechInput_SetRecognitionResult,
|
| + IPC_MESSAGE_HANDLER(SpeechInputMsg_SetRecognitionResult,
|
| OnSpeechRecognitionResult)
|
| - IPC_MESSAGE_HANDLER(ViewMsg_SpeechInput_RecordingComplete,
|
| + IPC_MESSAGE_HANDLER(SpeechInputMsg_RecordingComplete,
|
| OnSpeechRecordingComplete)
|
| - IPC_MESSAGE_HANDLER(ViewMsg_SpeechInput_RecognitionComplete,
|
| + IPC_MESSAGE_HANDLER(SpeechInputMsg_RecognitionComplete,
|
| OnSpeechRecognitionComplete)
|
| IPC_MESSAGE_UNHANDLED(handled = false)
|
| IPC_END_MESSAGE_MAP()
|
| @@ -39,27 +41,34 @@ bool SpeechInputDispatcher::startRecognition(
|
| int request_id,
|
| const WebKit::WebRect& element_rect,
|
| const WebKit::WebString& language,
|
| - const WebKit::WebString& grammar) {
|
| + const WebKit::WebString& grammar,
|
| + const WebKit::WebSecurityOrigin& origin) {
|
| VLOG(1) << "SpeechInputDispatcher::startRecognition enter";
|
| +
|
| + SpeechInputHostMsg_StartRecognition_Params params;
|
| + params.grammar = UTF16ToUTF8(grammar);
|
| + params.language = UTF16ToUTF8(language);
|
| + params.origin_url = UTF16ToUTF8(origin.toString());
|
| + params.render_view_id = routing_id();
|
| + params.request_id = request_id;
|
| gfx::Size scroll = render_view()->webview()->mainFrame()->scrollOffset();
|
| - gfx::Rect rect = element_rect;
|
| - rect.Offset(-scroll.width(), -scroll.height());
|
| - Send(new ViewHostMsg_SpeechInput_StartRecognition(
|
| - routing_id(), request_id, rect,
|
| - UTF16ToUTF8(language), UTF16ToUTF8(grammar)));
|
| + params.element_rect = element_rect;
|
| + params.element_rect.Offset(-scroll.width(), -scroll.height());
|
| +
|
| + Send(new SpeechInputHostMsg_StartRecognition(params));
|
| VLOG(1) << "SpeechInputDispatcher::startRecognition exit";
|
| return true;
|
| }
|
|
|
| void SpeechInputDispatcher::cancelRecognition(int request_id) {
|
| VLOG(1) << "SpeechInputDispatcher::cancelRecognition enter";
|
| - Send(new ViewHostMsg_SpeechInput_CancelRecognition(routing_id(), request_id));
|
| + Send(new SpeechInputHostMsg_CancelRecognition(routing_id(), request_id));
|
| VLOG(1) << "SpeechInputDispatcher::cancelRecognition exit";
|
| }
|
|
|
| void SpeechInputDispatcher::stopRecording(int request_id) {
|
| VLOG(1) << "SpeechInputDispatcher::stopRecording enter";
|
| - Send(new ViewHostMsg_SpeechInput_StopRecording(routing_id(), request_id));
|
| + Send(new SpeechInputHostMsg_StopRecording(routing_id(), request_id));
|
| VLOG(1) << "SpeechInputDispatcher::stopRecording exit";
|
| }
|
|
|
|
|