1 // Copyright 2015 Samsung Electronics. 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.
5 // Multiply-included file, no traditional include guard.
7 #include "base/values.h"
8 #include "common/print_pages_params.h"
9 #include "common/hit_test_params.h"
10 #include "common/cache_params_efl.h"
11 #include "common/navigation_policy_params.h"
12 #include "common/web_preferences_efl.h"
13 #include "ipc/ipc_message_macros.h"
14 #include "ipc/ipc_channel_handle.h"
15 #include "private/ewk_hit_test_private.h"
16 #include "private/ewk_text_style_private.h"
17 #include "private/ewk_wrt_private.h"
18 #include "public/ewk_hit_test.h"
19 #include "public/ewk_view.h"
20 #include "third_party/WebKit/public/web/WebNavigationPolicy.h"
21 #include "third_party/WebKit/public/web/WebNavigationType.h"
22 #include "third_party/WebKit/public/web/WebViewModeEnums.h"
23 #include "ipc_message_start_ewk.h"
25 typedef std::map<std::string, std::string> StringMap;
27 #define IPC_MESSAGE_START EwkMsgStart
29 IPC_STRUCT_TRAITS_BEGIN(Ewk_Wrt_Message_Data)
30 IPC_STRUCT_TRAITS_MEMBER(type)
31 IPC_STRUCT_TRAITS_MEMBER(value)
32 IPC_STRUCT_TRAITS_MEMBER(id)
33 IPC_STRUCT_TRAITS_MEMBER(reference_id)
34 IPC_STRUCT_TRAITS_END()
36 IPC_STRUCT_TRAITS_BEGIN(WebPreferencesEfl)
37 IPC_STRUCT_TRAITS_MEMBER(shrinks_viewport_content_to_fit)
38 IPC_STRUCT_TRAITS_MEMBER(javascript_can_open_windows_automatically_ewk)
39 IPC_STRUCT_TRAITS_END()
41 IPC_STRUCT_TRAITS_BEGIN(Hit_Test_Params::Node_Data)
42 IPC_STRUCT_TRAITS_MEMBER(tagName)
43 IPC_STRUCT_TRAITS_MEMBER(nodeValue)
44 IPC_STRUCT_TRAITS_MEMBER(attributes)
45 IPC_STRUCT_TRAITS_END()
47 IPC_STRUCT_TRAITS_BEGIN(Hit_Test_Params::Image_Data)
48 IPC_STRUCT_TRAITS_MEMBER(fileNameExtension)
49 IPC_STRUCT_TRAITS_MEMBER(imageBitmap)
50 IPC_STRUCT_TRAITS_END()
52 IPC_STRUCT_TRAITS_BEGIN(Hit_Test_Params)
53 IPC_STRUCT_TRAITS_MEMBER(context)
54 IPC_STRUCT_TRAITS_MEMBER(linkURI)
55 IPC_STRUCT_TRAITS_MEMBER(linkTitle)
56 IPC_STRUCT_TRAITS_MEMBER(linkLabel)
57 IPC_STRUCT_TRAITS_MEMBER(imageURI)
58 IPC_STRUCT_TRAITS_MEMBER(mediaURI)
59 IPC_STRUCT_TRAITS_MEMBER(isEditable)
60 IPC_STRUCT_TRAITS_MEMBER(mode)
61 IPC_STRUCT_TRAITS_MEMBER(nodeData)
62 IPC_STRUCT_TRAITS_MEMBER(imageData)
63 IPC_STRUCT_TRAITS_END()
65 IPC_ENUM_TRAITS(Ewk_CSP_Header_Type)
67 IPC_ENUM_TRAITS(Ewk_Hit_Test_Mode)
69 IPC_STRUCT_TRAITS_BEGIN(DidPrintPagesParams)
70 IPC_STRUCT_TRAITS_MEMBER(metafile_data_handle)
71 IPC_STRUCT_TRAITS_MEMBER(data_size)
72 IPC_STRUCT_TRAITS_MEMBER(document_cookie)
73 IPC_STRUCT_TRAITS_MEMBER(filename)
74 IPC_STRUCT_TRAITS_END()
76 IPC_STRUCT_TRAITS_BEGIN(CacheParamsEfl)
77 IPC_STRUCT_TRAITS_MEMBER(cache_total_capacity)
78 IPC_STRUCT_TRAITS_MEMBER(cache_min_dead_capacity)
79 IPC_STRUCT_TRAITS_MEMBER(cache_max_dead_capacity)
80 IPC_STRUCT_TRAITS_END()
82 IPC_STRUCT_TRAITS_BEGIN(SelectionStylePrams)
83 IPC_STRUCT_TRAITS_MEMBER(underline_state)
84 IPC_STRUCT_TRAITS_MEMBER(italic_state)
85 IPC_STRUCT_TRAITS_MEMBER(bold_state)
86 IPC_STRUCT_TRAITS_MEMBER(bg_color)
87 IPC_STRUCT_TRAITS_MEMBER(color)
88 IPC_STRUCT_TRAITS_MEMBER(font_size)
89 IPC_STRUCT_TRAITS_MEMBER(order_list_state)
90 IPC_STRUCT_TRAITS_MEMBER(un_order_list_state)
91 IPC_STRUCT_TRAITS_MEMBER(text_align_center_state)
92 IPC_STRUCT_TRAITS_MEMBER(text_align_left_state)
93 IPC_STRUCT_TRAITS_MEMBER(text_align_right_state)
94 IPC_STRUCT_TRAITS_MEMBER(text_align_full_state)
95 IPC_STRUCT_TRAITS_MEMBER(has_composition)
96 IPC_STRUCT_TRAITS_END()
98 IPC_STRUCT_TRAITS_BEGIN(SelectionColor)
99 IPC_STRUCT_TRAITS_MEMBER(r)
100 IPC_STRUCT_TRAITS_MEMBER(g)
101 IPC_STRUCT_TRAITS_MEMBER(b)
102 IPC_STRUCT_TRAITS_MEMBER(a)
103 IPC_STRUCT_TRAITS_END()
105 IPC_ENUM_TRAITS(blink::WebNavigationPolicy)
106 IPC_ENUM_TRAITS(blink::WebNavigationType)
108 IPC_STRUCT_TRAITS_BEGIN(NavigationPolicyParams)
109 IPC_STRUCT_TRAITS_MEMBER(render_view_id)
110 IPC_STRUCT_TRAITS_MEMBER(cookie)
111 IPC_STRUCT_TRAITS_MEMBER(url)
112 IPC_STRUCT_TRAITS_MEMBER(httpMethod)
113 IPC_STRUCT_TRAITS_MEMBER(referrer)
114 IPC_STRUCT_TRAITS_MEMBER(policy)
115 IPC_STRUCT_TRAITS_MEMBER(type)
116 IPC_STRUCT_TRAITS_MEMBER(should_replace_current_entry)
117 IPC_STRUCT_TRAITS_MEMBER(is_main_frame)
118 IPC_STRUCT_TRAITS_MEMBER(is_redirect)
119 IPC_STRUCT_TRAITS_END()
121 IPC_ENUM_TRAITS(blink::WebViewMode)
124 IPC_MESSAGE_CONTROL2(WrtMsg_ParseUrl,
125 int, // result: request_id
128 IPC_MESSAGE_CONTROL2(WrtMsg_ParseUrlResponse,
129 int, // result: request_id
132 IPC_MESSAGE_CONTROL1(WrtMsg_SendWrtMessage,
133 Ewk_Wrt_Message_Data /* data */);
135 IPC_SYNC_MESSAGE_ROUTED1_1(EwkHostMsg_WrtSyncMessage,
136 Ewk_Wrt_Message_Data /* data */,
137 std::string /*result*/);
139 IPC_MESSAGE_ROUTED1(EwkHostMsg_WrtMessage,
140 Ewk_Wrt_Message_Data /* data */);
142 IPC_MESSAGE_CONTROL2(EwkViewHostMsg_HitTestReply,
143 int, /* render_view_id */
146 IPC_MESSAGE_CONTROL3(EwkViewHostMsg_HitTestAsyncReply,
147 int, /* render_view_id */
149 int64_t /* request id */)
151 IPC_MESSAGE_ROUTED2(EwkViewMsg_SetCSP,
152 std::string, /* policy */
153 Ewk_CSP_Header_Type /* header type */)
155 IPC_SYNC_MESSAGE_ROUTED0_2(EwkHostMsg_GetContentSecurityPolicy,
156 std::string, /* policy */
157 Ewk_CSP_Header_Type /* header type */)
159 IPC_MESSAGE_ROUTED3(EwkViewMsg_Scale,
160 double, /* scale factor */
164 IPC_MESSAGE_ROUTED1(EwkHostMsg_DidPrintPagesToPdf,
165 DidPrintPagesParams /* pdf document parameters */)
167 IPC_MESSAGE_CONTROL0(EflViewMsg_ClearCache)
168 IPC_MESSAGE_CONTROL1(EflViewMsg_SetCache,
171 IPC_MESSAGE_ROUTED3(EwkViewMsg_PrintToPdf,
174 base::FilePath /* file name to save pdf*/)
176 IPC_MESSAGE_ROUTED1(EwkViewMsg_GetMHTMLData,
177 int /* callback id */)
179 IPC_MESSAGE_ROUTED3(EwkViewMsg_DoHitTest,
180 int, /* horizontal position */
181 int, /* vertical position */
182 Ewk_Hit_Test_Mode /* mode */)
184 IPC_MESSAGE_ROUTED4(EwkViewMsg_DoHitTestAsync,
185 int, /* horizontal position */
186 int, /* vertical position */
187 Ewk_Hit_Test_Mode, /* mode */
188 int64_t /* request id */)
190 // Tells the renderer to clear the cache.
191 IPC_MESSAGE_ROUTED0(EwkViewMsg_UseSettingsFont)
192 IPC_MESSAGE_ROUTED0(EwkViewMsg_SetBrowserFont)
193 IPC_MESSAGE_ROUTED0(EwkViewMsg_SuspendScheduledTask)
194 IPC_MESSAGE_ROUTED0(EwkViewMsg_ResumeScheduledTasks)
196 IPC_MESSAGE_ROUTED0(EwkViewMsg_GetSelectionStyle)
198 IPC_MESSAGE_ROUTED2(EwkViewMsg_SetScroll,
199 int, /* horizontal position */
200 int /* vertical position */)
202 IPC_MESSAGE_ROUTED1(EwkViewMsg_PlainTextGet,
203 int /* callback id */)
205 IPC_MESSAGE_ROUTED1(EwkViewMsg_SelectionTextStyleState,
206 SelectionStylePrams /* params */)
208 IPC_MESSAGE_ROUTED1(EwkSettingsMsg_UpdateWebKitPreferencesEfl, WebPreferencesEfl)
210 IPC_MESSAGE_ROUTED2(EwkHostMsg_HandleTapGestureWithContext,
212 bool /* is_editable_content */)
214 IPC_MESSAGE_ROUTED2(EwkHostMsg_PlainTextGetContents,
215 std::string, /* contentText */
216 int /* callback id */)
218 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeContentsSize,
222 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeMaxScrollOffset,
226 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeScrollOffset,
230 IPC_MESSAGE_ROUTED2(EwkHostMsg_ReadMHTMLData,
231 std::string, /* Mhtml text */
232 int /* callback id */)
234 IPC_MESSAGE_ROUTED1(EwkHostMsg_DidChangePageScaleFactor,
235 double /* page scale factor */)
237 IPC_MESSAGE_ROUTED1(EwkViewMsg_SetDrawsTransparentBackground,
240 // Notifies the browser to form submit
241 IPC_MESSAGE_ROUTED1(EwkHostMsg_FormSubmit, GURL)
243 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppIconUrlGet,
244 int /* callback id */)
246 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppIconUrlGet,
247 std::string, /* icon url */
248 int /* callback id */)
250 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppIconUrlsGet,
251 int /* callback id */)
253 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppIconUrlsGet,
254 StringMap, /* icon urls */
255 int /* callback id */)
257 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppCapableGet,
258 int /* calback id */)
260 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppCapableGet,
262 int /* calback id */)
264 IPC_SYNC_MESSAGE_CONTROL1_1(EwkHostMsg_DecideNavigationPolicy,
265 NavigationPolicyParams,
268 IPC_MESSAGE_ROUTED1(ViewMsg_SetViewMode,
269 blink::WebViewMode /* view_mode */)
271 IPC_MESSAGE_ROUTED1(ViewMsg_SetTextZoomFactor,
272 float /*font zoom factor*/)
274 IPC_MESSAGE_ROUTED1(EwkFrameMsg_LoadNotFoundErrorPage,
275 std::string /* error url */)
277 IPC_MESSAGE_ROUTED1(EwkFrameMsg_MoveToNextOrPreviousSelectElement,
279 IPC_MESSAGE_ROUTED0(EwkFrameMsg_RequestSelectCollectionInformation);
280 IPC_MESSAGE_ROUTED4(EwkHostMsg_RequestSelectCollectionInformationUpdateACK,
281 int /* formElementCount */,
282 int /* currentNodeIndex */,
283 bool /* prevState */,
284 bool /* nextState */)