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/error_params.h"
11 #include "common/cache_params_efl.h"
12 #include "common/navigation_policy_params.h"
13 #include "common/web_view_settings.h"
14 #include "ipc/ipc_message_macros.h"
15 #include "ipc/ipc_channel_handle.h"
16 #include "private/ewk_hit_test_private.h"
17 #include "private/ewk_text_style_private.h"
18 #include "private/ewk_wrt_private.h"
19 #include "public/ewk_hit_test.h"
20 #include "public/ewk_view.h"
21 #include "third_party/WebKit/public/web/WebNavigationPolicy.h"
22 #include "third_party/WebKit/public/web/WebNavigationType.h"
23 #include "third_party/WebKit/public/web/WebViewModeEnums.h"
24 #include "ipc_message_start_ewk.h"
26 typedef std::map<std::string, std::string> StringMap;
28 #define IPC_MESSAGE_START EwkMsgStart
30 IPC_STRUCT_TRAITS_BEGIN(Ewk_Wrt_Message_Data)
31 IPC_STRUCT_TRAITS_MEMBER(type)
32 IPC_STRUCT_TRAITS_MEMBER(value)
33 IPC_STRUCT_TRAITS_MEMBER(id)
34 IPC_STRUCT_TRAITS_MEMBER(reference_id)
35 IPC_STRUCT_TRAITS_END()
37 IPC_STRUCT_TRAITS_BEGIN(WebViewSettings)
38 IPC_STRUCT_TRAITS_MEMBER(javascript_can_open_windows)
39 IPC_STRUCT_TRAITS_MEMBER(link_effect_enabled)
40 IPC_STRUCT_TRAITS_END()
42 IPC_STRUCT_TRAITS_BEGIN(ErrorParams)
43 IPC_STRUCT_TRAITS_MEMBER(url)
44 IPC_STRUCT_TRAITS_MEMBER(is_main_frame)
45 IPC_STRUCT_TRAITS_MEMBER(code)
46 IPC_STRUCT_TRAITS_MEMBER(description)
47 IPC_STRUCT_TRAITS_MEMBER(domain)
48 IPC_STRUCT_TRAITS_END()
50 IPC_STRUCT_TRAITS_BEGIN(Hit_Test_Params::Node_Data)
51 IPC_STRUCT_TRAITS_MEMBER(tagName)
52 IPC_STRUCT_TRAITS_MEMBER(nodeValue)
53 IPC_STRUCT_TRAITS_MEMBER(attributes)
54 IPC_STRUCT_TRAITS_END()
56 IPC_STRUCT_TRAITS_BEGIN(Hit_Test_Params::Image_Data)
57 IPC_STRUCT_TRAITS_MEMBER(fileNameExtension)
58 IPC_STRUCT_TRAITS_MEMBER(imageBitmap)
59 IPC_STRUCT_TRAITS_END()
61 IPC_STRUCT_TRAITS_BEGIN(Hit_Test_Params)
62 IPC_STRUCT_TRAITS_MEMBER(context)
63 IPC_STRUCT_TRAITS_MEMBER(linkURI)
64 IPC_STRUCT_TRAITS_MEMBER(linkTitle)
65 IPC_STRUCT_TRAITS_MEMBER(linkLabel)
66 IPC_STRUCT_TRAITS_MEMBER(imageURI)
67 IPC_STRUCT_TRAITS_MEMBER(mediaURI)
68 IPC_STRUCT_TRAITS_MEMBER(isEditable)
69 IPC_STRUCT_TRAITS_MEMBER(mode)
70 IPC_STRUCT_TRAITS_MEMBER(nodeData)
71 IPC_STRUCT_TRAITS_MEMBER(imageData)
72 IPC_STRUCT_TRAITS_END()
74 IPC_ENUM_TRAITS(Ewk_CSP_Header_Type)
76 IPC_ENUM_TRAITS(Ewk_Hit_Test_Mode)
78 IPC_STRUCT_TRAITS_BEGIN(DidPrintPagesParams)
79 IPC_STRUCT_TRAITS_MEMBER(metafile_data_handle)
80 IPC_STRUCT_TRAITS_MEMBER(data_size)
81 IPC_STRUCT_TRAITS_MEMBER(document_cookie)
82 IPC_STRUCT_TRAITS_MEMBER(filename)
83 IPC_STRUCT_TRAITS_END()
85 IPC_STRUCT_TRAITS_BEGIN(CacheParamsEfl)
86 IPC_STRUCT_TRAITS_MEMBER(cache_total_capacity)
87 IPC_STRUCT_TRAITS_MEMBER(cache_min_dead_capacity)
88 IPC_STRUCT_TRAITS_MEMBER(cache_max_dead_capacity)
89 IPC_STRUCT_TRAITS_END()
91 IPC_STRUCT_TRAITS_BEGIN(SelectionStylePrams)
92 IPC_STRUCT_TRAITS_MEMBER(underline_state)
93 IPC_STRUCT_TRAITS_MEMBER(italic_state)
94 IPC_STRUCT_TRAITS_MEMBER(bold_state)
95 IPC_STRUCT_TRAITS_MEMBER(bg_color)
96 IPC_STRUCT_TRAITS_MEMBER(color)
97 IPC_STRUCT_TRAITS_MEMBER(font_size)
98 IPC_STRUCT_TRAITS_MEMBER(order_list_state)
99 IPC_STRUCT_TRAITS_MEMBER(un_order_list_state)
100 IPC_STRUCT_TRAITS_MEMBER(text_align_center_state)
101 IPC_STRUCT_TRAITS_MEMBER(text_align_left_state)
102 IPC_STRUCT_TRAITS_MEMBER(text_align_right_state)
103 IPC_STRUCT_TRAITS_MEMBER(text_align_full_state)
104 IPC_STRUCT_TRAITS_MEMBER(has_composition)
105 IPC_STRUCT_TRAITS_END()
107 IPC_STRUCT_TRAITS_BEGIN(SelectionColor)
108 IPC_STRUCT_TRAITS_MEMBER(r)
109 IPC_STRUCT_TRAITS_MEMBER(g)
110 IPC_STRUCT_TRAITS_MEMBER(b)
111 IPC_STRUCT_TRAITS_MEMBER(a)
112 IPC_STRUCT_TRAITS_END()
114 IPC_ENUM_TRAITS(blink::WebNavigationPolicy)
115 IPC_ENUM_TRAITS(blink::WebNavigationType)
117 IPC_STRUCT_TRAITS_BEGIN(NavigationPolicyParams)
118 IPC_STRUCT_TRAITS_MEMBER(render_view_id)
119 IPC_STRUCT_TRAITS_MEMBER(cookie)
120 IPC_STRUCT_TRAITS_MEMBER(url)
121 IPC_STRUCT_TRAITS_MEMBER(httpMethod)
122 IPC_STRUCT_TRAITS_MEMBER(referrer)
123 IPC_STRUCT_TRAITS_MEMBER(policy)
124 IPC_STRUCT_TRAITS_MEMBER(type)
125 IPC_STRUCT_TRAITS_MEMBER(should_replace_current_entry)
126 IPC_STRUCT_TRAITS_MEMBER(is_main_frame)
127 IPC_STRUCT_TRAITS_MEMBER(is_redirect)
128 IPC_STRUCT_TRAITS_END()
130 IPC_ENUM_TRAITS(blink::WebViewMode)
133 IPC_MESSAGE_CONTROL2(WrtMsg_ParseUrl,
134 int, // result: request_id
137 IPC_MESSAGE_CONTROL2(WrtMsg_ParseUrlResponse,
138 int, // result: request_id
141 IPC_MESSAGE_CONTROL1(WrtMsg_SendWrtMessage,
142 Ewk_Wrt_Message_Data /* data */);
144 IPC_SYNC_MESSAGE_ROUTED1_1(EwkHostMsg_WrtSyncMessage,
145 Ewk_Wrt_Message_Data /* data */,
146 std::string /*result*/);
148 IPC_MESSAGE_ROUTED1(EwkHostMsg_WrtMessage,
149 Ewk_Wrt_Message_Data /* data */);
151 IPC_MESSAGE_CONTROL2(EwkViewHostMsg_HitTestReply,
152 int, /* render_view_id */
155 IPC_MESSAGE_CONTROL3(EwkViewHostMsg_HitTestAsyncReply,
156 int, /* render_view_id */
158 int64_t /* request id */)
160 IPC_MESSAGE_ROUTED1(EwkViewMsg_DidFailLoadWithError,
161 ErrorParams /* error */)
163 IPC_MESSAGE_ROUTED2(EwkViewMsg_SetCSP,
164 std::string, /* policy */
165 Ewk_CSP_Header_Type /* header type */)
167 IPC_SYNC_MESSAGE_ROUTED0_2(EwkHostMsg_GetContentSecurityPolicy,
168 std::string, /* policy */
169 Ewk_CSP_Header_Type /* header type */)
171 IPC_MESSAGE_ROUTED3(EwkViewMsg_Scale,
172 double, /* scale factor */
176 IPC_MESSAGE_ROUTED1(EwkHostMsg_DidPrintPagesToPdf,
177 DidPrintPagesParams /* pdf document parameters */)
179 IPC_MESSAGE_CONTROL0(EflViewMsg_ClearCache)
180 IPC_MESSAGE_CONTROL1(EflViewMsg_SetCache,
183 // Tells the renderer to dump as much memory as it can, perhaps because we
184 // have memory pressure or the renderer is (or will be) paged out. This
185 // should only result in purging objects we can recalculate, e.g. caches or
186 // JS garbage, not in purging irreplaceable objects.
187 IPC_MESSAGE_CONTROL0(EwkViewMsg_PurgeMemory)
189 IPC_MESSAGE_ROUTED3(EwkViewMsg_PrintToPdf,
192 base::FilePath /* file name to save pdf*/)
194 IPC_MESSAGE_ROUTED1(EwkViewMsg_GetMHTMLData,
195 int /* callback id */)
197 IPC_MESSAGE_ROUTED3(EwkViewMsg_DoHitTest,
198 int, /* horizontal position */
199 int, /* vertical position */
200 Ewk_Hit_Test_Mode /* mode */)
202 IPC_MESSAGE_ROUTED4(EwkViewMsg_DoHitTestAsync,
203 int, /* horizontal position */
204 int, /* vertical position */
205 Ewk_Hit_Test_Mode, /* mode */
206 int64_t /* request id */)
208 // Tells the renderer to clear the cache.
209 IPC_MESSAGE_ROUTED0(EwkViewMsg_UseSettingsFont)
210 IPC_MESSAGE_ROUTED0(EwkViewMsg_SetBrowserFont)
211 IPC_MESSAGE_ROUTED0(EwkViewMsg_SuspendScheduledTask)
212 IPC_MESSAGE_ROUTED0(EwkViewMsg_ResumeScheduledTasks)
214 IPC_MESSAGE_ROUTED0(EwkViewMsg_GetSelectionStyle)
216 IPC_MESSAGE_ROUTED2(EwkViewMsg_SetScroll,
217 int, /* horizontal position */
218 int /* vertical position */)
220 IPC_MESSAGE_ROUTED1(EwkViewMsg_PlainTextGet,
221 int /* callback id */)
223 IPC_MESSAGE_ROUTED1(EwkViewMsg_SelectionTextStyleState,
224 SelectionStylePrams /* params */)
226 IPC_MESSAGE_ROUTED1(EflViewMsg_UpdateSettings, WebViewSettings)
228 IPC_MESSAGE_ROUTED2(EwkHostMsg_HandleTapGestureWithContext,
230 bool /* is_editable_content */)
232 IPC_MESSAGE_ROUTED2(EwkHostMsg_PlainTextGetContents,
233 std::string, /* contentText */
234 int /* callback id */)
236 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeContentsSize,
240 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeMaxScrollOffset,
244 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeScrollOffset,
248 IPC_MESSAGE_ROUTED2(EwkHostMsg_ReadMHTMLData,
249 std::string, /* Mhtml text */
250 int /* callback id */)
252 IPC_MESSAGE_ROUTED1(EwkHostMsg_DidChangePageScaleFactor,
253 double /* page scale factor */)
255 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangePageScaleRange,
256 double, /* minimum page scale factor */
257 double /* maximum page scale factor */)
259 IPC_MESSAGE_ROUTED1(EwkViewMsg_SetDrawsTransparentBackground,
262 // Notifies the browser to form submit
263 IPC_MESSAGE_ROUTED1(EwkHostMsg_FormSubmit, GURL)
265 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppIconUrlGet,
266 int /* callback id */)
268 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppIconUrlGet,
269 std::string, /* icon url */
270 int /* callback id */)
272 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppIconUrlsGet,
273 int /* callback id */)
275 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppIconUrlsGet,
276 StringMap, /* icon urls */
277 int /* callback id */)
279 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppCapableGet,
280 int /* calback id */)
282 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppCapableGet,
284 int /* calback id */)
286 IPC_SYNC_MESSAGE_CONTROL1_1(EwkHostMsg_DecideNavigationPolicy,
287 NavigationPolicyParams,
290 IPC_MESSAGE_ROUTED1(ViewMsg_SetViewMode,
291 blink::WebViewMode /* view_mode */)
293 IPC_MESSAGE_ROUTED1(EwkFrameMsg_LoadNotFoundErrorPage,
294 std::string /* error url */)
296 IPC_MESSAGE_ROUTED1(EwkFrameMsg_MoveToNextOrPreviousSelectElement,
298 IPC_MESSAGE_ROUTED0(EwkFrameMsg_RequestSelectCollectionInformation);
299 IPC_MESSAGE_ROUTED4(EwkHostMsg_RequestSelectCollectionInformationUpdateACK,
300 int /* formElementCount */,
301 int /* currentNodeIndex */,
302 bool /* prevState */,
303 bool /* nextState */)