| 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 "content/public/common/speech_input_result.h" | |
| 10 #include "ipc/ipc_message_macros.h" | |
| 11 #include "ipc/ipc_param_traits.h" | |
| 12 #include "ui/gfx/rect.h" | |
| 13 | |
| 14 #define IPC_MESSAGE_START SpeechInputMsgStart | |
| 15 | |
| 16 IPC_ENUM_TRAITS(content::SpeechInputError) | |
| 17 | |
| 18 IPC_STRUCT_TRAITS_BEGIN(content::SpeechInputHypothesis) | |
| 19 IPC_STRUCT_TRAITS_MEMBER(utterance) | |
| 20 IPC_STRUCT_TRAITS_MEMBER(confidence) | |
| 21 IPC_STRUCT_TRAITS_END() | |
| 22 | |
| 23 IPC_STRUCT_TRAITS_BEGIN(content::SpeechInputResult) | |
| 24 IPC_STRUCT_TRAITS_MEMBER(error) | |
| 25 IPC_STRUCT_TRAITS_MEMBER(hypotheses) | |
| 26 IPC_STRUCT_TRAITS_END() | |
| 27 | |
| 28 // Used to start a speech recognition session. | |
| 29 IPC_STRUCT_BEGIN(SpeechInputHostMsg_StartRecognition_Params) | |
| 30 // The render view requesting speech recognition. | |
| 31 IPC_STRUCT_MEMBER(int, render_view_id) | |
| 32 // Request ID used within the render view. | |
| 33 IPC_STRUCT_MEMBER(int, request_id) | |
| 34 // Position of the UI element in page coordinates. | |
| 35 IPC_STRUCT_MEMBER(gfx::Rect, element_rect) | |
| 36 // Language to use for speech recognition. | |
| 37 IPC_STRUCT_MEMBER(std::string, language) | |
| 38 // Speech grammar given by the speech input element. | |
| 39 IPC_STRUCT_MEMBER(std::string, grammar) | |
| 40 // URL of the page (or iframe if applicable). | |
| 41 IPC_STRUCT_MEMBER(std::string, origin_url) | |
| 42 IPC_STRUCT_END() | |
| 43 | |
| 44 // Speech input messages sent from the renderer to the browser. | |
| 45 | |
| 46 // Requests the speech input service to start speech recognition on behalf of | |
| 47 // the given |render_view_id|. | |
| 48 IPC_MESSAGE_CONTROL1(SpeechInputHostMsg_StartRecognition, | |
| 49 SpeechInputHostMsg_StartRecognition_Params) | |
| 50 | |
| 51 // Requests the speech input service to cancel speech recognition on behalf of | |
| 52 // the given |render_view_id|. If speech recognition is not happening or | |
| 53 // is happening on behalf of some other render view, this call does nothing. | |
| 54 IPC_MESSAGE_CONTROL2(SpeechInputHostMsg_CancelRecognition, | |
| 55 int /* render_view_id */, | |
| 56 int /* request_id */) | |
| 57 | |
| 58 // Requests the speech input service to stop audio recording on behalf of | |
| 59 // the given |render_view_id|. Any audio recorded so far will be fed to the | |
| 60 // speech recognizer. If speech recognition is not happening nor or is | |
| 61 // happening on behalf of some other render view, this call does nothing. | |
| 62 IPC_MESSAGE_CONTROL2(SpeechInputHostMsg_StopRecording, | |
| 63 int /* render_view_id */, | |
| 64 int /* request_id */) | |
| 65 | |
| 66 // Speech input messages sent from the browser to the renderer. | |
| 67 | |
| 68 // Relay a speech recognition result, either partial or final. | |
| 69 IPC_MESSAGE_ROUTED2(SpeechInputMsg_SetRecognitionResult, | |
| 70 int /* request_id */, | |
| 71 content::SpeechInputResult /* result */) | |
| 72 | |
| 73 // Indicate that speech recognizer has stopped recording and started | |
| 74 // recognition. | |
| 75 IPC_MESSAGE_ROUTED1(SpeechInputMsg_RecordingComplete, | |
| 76 int /* request_id */) | |
| 77 | |
| 78 // Indicate that speech recognizer has completed recognition. This will be | |
| 79 // the last message sent in response to a | |
| 80 // ViewHostMsg_SpeechInput_StartRecognition. | |
| 81 IPC_MESSAGE_ROUTED1(SpeechInputMsg_RecognitionComplete, | |
| 82 int /* request_id */) | |
| 83 | |
| 84 // Toggle speech input on or off on the speech input control for the | |
| 85 // current focused element. Has no effect if the current element doesn't | |
| 86 // support speech input. | |
| 87 IPC_MESSAGE_ROUTED0(SpeechInputMsg_ToggleSpeechInput) | |
| OLD | NEW |