| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // Multiply-included message file, hence no include guard. | |
| 6 | |
| 7 #include <string> | |
| 8 | |
| 9 #include "chrome/common/common_param_traits.h" | |
| 10 #include "chrome/common/speech_input_result.h" | |
| 11 #include "ipc/ipc_message_macros.h" | |
| 12 #include "ipc/ipc_param_traits.h" | |
| 13 #include "ui/gfx/rect.h" | |
| 14 | |
| 15 #define IPC_MESSAGE_START SpeechInputMsgStart | |
| 16 | |
| 17 // Used to start a speech recognition session. | |
| 18 IPC_STRUCT_BEGIN(SpeechInputHostMsg_StartRecognition_Params) | |
| 19 // The render view requesting speech recognition. | |
| 20 IPC_STRUCT_MEMBER(int, render_view_id) | |
| 21 // Request ID used within the render view. | |
| 22 IPC_STRUCT_MEMBER(int, request_id) | |
| 23 // Position of the UI element in page coordinates. | |
| 24 IPC_STRUCT_MEMBER(gfx::Rect, element_rect) | |
| 25 // Language to use for speech recognition. | |
| 26 IPC_STRUCT_MEMBER(std::string, language) | |
| 27 // Speech grammar given by the speech input element. | |
| 28 IPC_STRUCT_MEMBER(std::string, grammar) | |
| 29 // URL of the page (or iframe if applicable). | |
| 30 IPC_STRUCT_MEMBER(std::string, origin_url) | |
| 31 IPC_STRUCT_END() | |
| 32 | |
| 33 IPC_STRUCT_TRAITS_BEGIN(speech_input::SpeechInputResultItem) | |
| 34 IPC_STRUCT_TRAITS_MEMBER(utterance) | |
| 35 IPC_STRUCT_TRAITS_MEMBER(confidence) | |
| 36 IPC_STRUCT_TRAITS_END() | |
| 37 | |
| 38 // Speech input messages sent from the renderer to the browser. | |
| 39 | |
| 40 // Requests the speech input service to start speech recognition on behalf of | |
| 41 // the given |render_view_id|. | |
| 42 IPC_MESSAGE_CONTROL1(SpeechInputHostMsg_StartRecognition, | |
| 43 SpeechInputHostMsg_StartRecognition_Params) | |
| 44 | |
| 45 // Requests the speech input service to cancel speech recognition on behalf of | |
| 46 // the given |render_view_id|. If speech recognition is not happening or | |
| 47 // is happening on behalf of some other render view, this call does nothing. | |
| 48 IPC_MESSAGE_CONTROL2(SpeechInputHostMsg_CancelRecognition, | |
| 49 int /* render_view_id */, | |
| 50 int /* request_id */) | |
| 51 | |
| 52 // Requests the speech input service to stop audio recording on behalf of | |
| 53 // the given |render_view_id|. Any audio recorded so far will be fed to the | |
| 54 // speech recognizer. If speech recognition is not happening nor or is | |
| 55 // happening on behalf of some other render view, this call does nothing. | |
| 56 IPC_MESSAGE_CONTROL2(SpeechInputHostMsg_StopRecording, | |
| 57 int /* render_view_id */, | |
| 58 int /* request_id */) | |
| 59 | |
| 60 // Speech input messages sent from the browser to the renderer. | |
| 61 | |
| 62 // Relay a speech recognition result, either partial or final. | |
| 63 IPC_MESSAGE_ROUTED2(SpeechInputMsg_SetRecognitionResult, | |
| 64 int /* request_id */, | |
| 65 speech_input::SpeechInputResultArray /* result */) | |
| 66 | |
| 67 // Indicate that speech recognizer has stopped recording and started | |
| 68 // recognition. | |
| 69 IPC_MESSAGE_ROUTED1(SpeechInputMsg_RecordingComplete, | |
| 70 int /* request_id */) | |
| 71 | |
| 72 // Indicate that speech recognizer has completed recognition. This will be | |
| 73 // the last message sent in response to a | |
| 74 // ViewHostMsg_SpeechInput_StartRecognition. | |
| 75 IPC_MESSAGE_ROUTED1(SpeechInputMsg_RecognitionComplete, | |
| 76 int /* request_id */) | |
| 77 | |
| OLD | NEW |