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

Unified Diff: chrome/common/speech_input_messages.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/common/speech_input_messages.h ('k') | chrome/renderer/speech_input_dispatcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/speech_input_messages.cc
diff --git a/chrome/common/speech_input_messages.cc b/chrome/common/speech_input_messages.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c93062fb2aaa1ae1a714bc799126623339604884
--- /dev/null
+++ b/chrome/common/speech_input_messages.cc
@@ -0,0 +1,83 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/common/common_param_traits.h"
+
+#define IPC_MESSAGE_IMPL
+#include "chrome/common/speech_input_messages.h"
+
+SpeechInputHostMsg_StartRecognition_Params::
+SpeechInputHostMsg_StartRecognition_Params()
+ : render_view_id(0),
+ request_id(0) {
+}
+
+SpeechInputHostMsg_StartRecognition_Params::
+~SpeechInputHostMsg_StartRecognition_Params() {
+}
+
+namespace IPC {
+
+void ParamTraits<speech_input::SpeechInputResultItem>::Write(
+ Message* m, const param_type& p) {
+ WriteParam(m, p.utterance);
+ WriteParam(m, p.confidence);
+}
+
+bool ParamTraits<speech_input::SpeechInputResultItem>::Read(const Message* m,
+ void** iter,
+ param_type* p) {
+ return ReadParam(m, iter, &p->utterance) &&
+ ReadParam(m, iter, &p->confidence);
+}
+
+void ParamTraits<speech_input::SpeechInputResultItem>::Log(const param_type& p,
+ std::string* l) {
+ l->append("(");
+ LogParam(p.utterance, l);
+ l->append(":");
+ LogParam(p.confidence, l);
+ l->append(")");
+}
+
+void ParamTraits<SpeechInputHostMsg_StartRecognition_Params>::Write(
+ Message* m,
+ const param_type& p) {
+ WriteParam(m, p.render_view_id);
+ WriteParam(m, p.request_id);
+ WriteParam(m, p.element_rect);
+ WriteParam(m, p.language);
+ WriteParam(m, p.grammar);
+ WriteParam(m, p.origin_url);
+}
+
+bool ParamTraits<SpeechInputHostMsg_StartRecognition_Params>::Read(
+ const Message* m, void** iter, param_type* p) {
+ return
+ ReadParam(m, iter, &p->render_view_id) &&
+ ReadParam(m, iter, &p->request_id) &&
+ ReadParam(m, iter, &p->element_rect) &&
+ ReadParam(m, iter, &p->language) &&
+ ReadParam(m, iter, &p->grammar) &&
+ ReadParam(m, iter, &p->origin_url);
+}
+
+void ParamTraits<SpeechInputHostMsg_StartRecognition_Params>::Log(
+ const param_type& p, std::string* l) {
+ l->append("(");
+ LogParam(p.render_view_id, l);
+ l->append(", ");
+ LogParam(p.request_id, l);
+ l->append(", ");
+ LogParam(p.element_rect, l);
+ l->append(", ");
+ LogParam(p.language, l);
+ l->append(", ");
+ LogParam(p.grammar, l);
+ l->append(", ");
+ LogParam(p.origin_url, l);
+ l->append(")");
+}
+
+} // namespace IPC
« no previous file with comments | « chrome/common/speech_input_messages.h ('k') | chrome/renderer/speech_input_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698