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

Unified Diff: chrome/renderer/speech_input_dispatcher.cc

Issue 6308009: If user had consented for metrics reporting, send speech input request origin to the server. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/speech_input_dispatcher.h ('k') | ipc/ipc_message_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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";
}
« no previous file with comments | « chrome/renderer/speech_input_dispatcher.h ('k') | ipc/ipc_message_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698