OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Multiply-included message file, hence no include guard. | 5 // Multiply-included message file, hence no include guard. |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "content/common/speech_input_result.h" | 9 #include "content/common/speech_input_result.h" |
10 #include "ipc/ipc_message_macros.h" | 10 #include "ipc/ipc_message_macros.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 // Position of the UI element in page coordinates. | 22 // Position of the UI element in page coordinates. |
23 IPC_STRUCT_MEMBER(gfx::Rect, element_rect) | 23 IPC_STRUCT_MEMBER(gfx::Rect, element_rect) |
24 // Language to use for speech recognition. | 24 // Language to use for speech recognition. |
25 IPC_STRUCT_MEMBER(std::string, language) | 25 IPC_STRUCT_MEMBER(std::string, language) |
26 // Speech grammar given by the speech input element. | 26 // Speech grammar given by the speech input element. |
27 IPC_STRUCT_MEMBER(std::string, grammar) | 27 IPC_STRUCT_MEMBER(std::string, grammar) |
28 // URL of the page (or iframe if applicable). | 28 // URL of the page (or iframe if applicable). |
29 IPC_STRUCT_MEMBER(std::string, origin_url) | 29 IPC_STRUCT_MEMBER(std::string, origin_url) |
30 IPC_STRUCT_END() | 30 IPC_STRUCT_END() |
31 | 31 |
32 IPC_STRUCT_TRAITS_BEGIN(speech_input::SpeechInputResultItem) | 32 IPC_STRUCT_TRAITS_BEGIN(speech_input::SpeechInputHypothesis) |
33 IPC_STRUCT_TRAITS_MEMBER(utterance) | 33 IPC_STRUCT_TRAITS_MEMBER(utterance) |
34 IPC_STRUCT_TRAITS_MEMBER(confidence) | 34 IPC_STRUCT_TRAITS_MEMBER(confidence) |
35 IPC_STRUCT_TRAITS_END() | 35 IPC_STRUCT_TRAITS_END() |
36 | 36 |
| 37 IPC_ENUM_TRAITS(speech_input::SpeechInputError) |
| 38 |
| 39 IPC_STRUCT_TRAITS_BEGIN(speech_input::SpeechInputResult) |
| 40 IPC_STRUCT_TRAITS_MEMBER(error) |
| 41 IPC_STRUCT_TRAITS_MEMBER(hypotheses) |
| 42 IPC_STRUCT_TRAITS_END() |
| 43 |
37 // Speech input messages sent from the renderer to the browser. | 44 // Speech input messages sent from the renderer to the browser. |
38 | 45 |
39 // Requests the speech input service to start speech recognition on behalf of | 46 // Requests the speech input service to start speech recognition on behalf of |
40 // the given |render_view_id|. | 47 // the given |render_view_id|. |
41 IPC_MESSAGE_CONTROL1(SpeechInputHostMsg_StartRecognition, | 48 IPC_MESSAGE_CONTROL1(SpeechInputHostMsg_StartRecognition, |
42 SpeechInputHostMsg_StartRecognition_Params) | 49 SpeechInputHostMsg_StartRecognition_Params) |
43 | 50 |
44 // Requests the speech input service to cancel speech recognition on behalf of | 51 // Requests the speech input service to cancel speech recognition on behalf of |
45 // the given |render_view_id|. If speech recognition is not happening or | 52 // the given |render_view_id|. If speech recognition is not happening or |
46 // is happening on behalf of some other render view, this call does nothing. | 53 // is happening on behalf of some other render view, this call does nothing. |
47 IPC_MESSAGE_CONTROL2(SpeechInputHostMsg_CancelRecognition, | 54 IPC_MESSAGE_CONTROL2(SpeechInputHostMsg_CancelRecognition, |
48 int /* render_view_id */, | 55 int /* render_view_id */, |
49 int /* request_id */) | 56 int /* request_id */) |
50 | 57 |
51 // Requests the speech input service to stop audio recording on behalf of | 58 // Requests the speech input service to stop audio recording on behalf of |
52 // the given |render_view_id|. Any audio recorded so far will be fed to the | 59 // the given |render_view_id|. Any audio recorded so far will be fed to the |
53 // speech recognizer. If speech recognition is not happening nor or is | 60 // speech recognizer. If speech recognition is not happening nor or is |
54 // happening on behalf of some other render view, this call does nothing. | 61 // happening on behalf of some other render view, this call does nothing. |
55 IPC_MESSAGE_CONTROL2(SpeechInputHostMsg_StopRecording, | 62 IPC_MESSAGE_CONTROL2(SpeechInputHostMsg_StopRecording, |
56 int /* render_view_id */, | 63 int /* render_view_id */, |
57 int /* request_id */) | 64 int /* request_id */) |
58 | 65 |
59 // Speech input messages sent from the browser to the renderer. | 66 // Speech input messages sent from the browser to the renderer. |
60 | 67 |
61 // Relay a speech recognition result, either partial or final. | 68 // Relay a speech recognition result, either partial or final. |
62 IPC_MESSAGE_ROUTED2(SpeechInputMsg_SetRecognitionResult, | 69 IPC_MESSAGE_ROUTED2(SpeechInputMsg_SetRecognitionResult, |
63 int /* request_id */, | 70 int /* request_id */, |
64 speech_input::SpeechInputResultArray /* result */) | 71 speech_input::SpeechInputResult /* result */) |
65 | 72 |
66 // Indicate that speech recognizer has stopped recording and started | 73 // Indicate that speech recognizer has stopped recording and started |
67 // recognition. | 74 // recognition. |
68 IPC_MESSAGE_ROUTED1(SpeechInputMsg_RecordingComplete, | 75 IPC_MESSAGE_ROUTED1(SpeechInputMsg_RecordingComplete, |
69 int /* request_id */) | 76 int /* request_id */) |
70 | 77 |
71 // Indicate that speech recognizer has completed recognition. This will be | 78 // Indicate that speech recognizer has completed recognition. This will be |
72 // the last message sent in response to a | 79 // the last message sent in response to a |
73 // ViewHostMsg_SpeechInput_StartRecognition. | 80 // ViewHostMsg_SpeechInput_StartRecognition. |
74 IPC_MESSAGE_ROUTED1(SpeechInputMsg_RecognitionComplete, | 81 IPC_MESSAGE_ROUTED1(SpeechInputMsg_RecognitionComplete, |
75 int /* request_id */) | 82 int /* request_id */) |
76 | 83 |
77 // Toggle speech input on or off on the speech input control for the | 84 // Toggle speech input on or off on the speech input control for the |
78 // current focused element. Has no effect if the current element doesn't | 85 // current focused element. Has no effect if the current element doesn't |
79 // support speech input. | 86 // support speech input. |
80 IPC_MESSAGE_ROUTED0(SpeechInputMsg_ToggleSpeechInput) | 87 IPC_MESSAGE_ROUTED0(SpeechInputMsg_ToggleSpeechInput) |
OLD | NEW |