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/cache_params_efl.h"
9 #include "common/hit_test_params.h"
10 #include "common/navigation_policy_params.h"
11 #include "common/print_pages_params.h"
12 #include "common/web_preferences_efl.h"
13 #include "ipc/ipc_channel_handle.h"
14 #include "ipc/ipc_message_macros.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_internal.h"
19 #include "public/ewk_view_internal.h"
20 #include "public/ewk_hit_test_internal.h"
21 #include "public/ewk_view.h"
22 #include "third_party/blink/public/web/web_navigation_policy.h"
23 #include "third_party/blink/public/web/web_navigation_type.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(WebPreferencesEfl)
38 IPC_STRUCT_TRAITS_MEMBER(shrinks_viewport_content_to_fit)
39 IPC_STRUCT_TRAITS_MEMBER(javascript_can_open_windows_automatically_ewk)
40 IPC_STRUCT_TRAITS_END()
42 IPC_STRUCT_TRAITS_BEGIN(Hit_Test_Params::Node_Data)
43 IPC_STRUCT_TRAITS_MEMBER(tagName)
44 IPC_STRUCT_TRAITS_MEMBER(nodeValue)
45 IPC_STRUCT_TRAITS_MEMBER(attributes)
46 IPC_STRUCT_TRAITS_END()
48 IPC_STRUCT_TRAITS_BEGIN(Hit_Test_Params::Image_Data)
49 IPC_STRUCT_TRAITS_MEMBER(fileNameExtension)
50 IPC_STRUCT_TRAITS_MEMBER(imageBitmap)
51 IPC_STRUCT_TRAITS_END()
53 IPC_STRUCT_TRAITS_BEGIN(Hit_Test_Params)
54 IPC_STRUCT_TRAITS_MEMBER(context)
55 IPC_STRUCT_TRAITS_MEMBER(linkURI)
56 IPC_STRUCT_TRAITS_MEMBER(linkTitle)
57 IPC_STRUCT_TRAITS_MEMBER(linkLabel)
58 IPC_STRUCT_TRAITS_MEMBER(imageURI)
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 #if !defined(EWK_BRINGUP) // FIXME: m85 bringup
71 IPC_STRUCT_TRAITS_MEMBER(metafile_data_handle)
73 IPC_STRUCT_TRAITS_MEMBER(data_size)
74 IPC_STRUCT_TRAITS_MEMBER(document_cookie)
75 IPC_STRUCT_TRAITS_MEMBER(filename)
76 IPC_STRUCT_TRAITS_END()
78 IPC_STRUCT_TRAITS_BEGIN(CacheParamsEfl)
79 IPC_STRUCT_TRAITS_MEMBER(cache_total_capacity)
80 IPC_STRUCT_TRAITS_MEMBER(cache_min_dead_capacity)
81 IPC_STRUCT_TRAITS_MEMBER(cache_max_dead_capacity)
82 IPC_STRUCT_TRAITS_END()
84 IPC_STRUCT_TRAITS_BEGIN(SelectionStylePrams)
85 IPC_STRUCT_TRAITS_MEMBER(underline_state)
86 IPC_STRUCT_TRAITS_MEMBER(italic_state)
87 IPC_STRUCT_TRAITS_MEMBER(bold_state)
88 IPC_STRUCT_TRAITS_MEMBER(bg_color)
89 IPC_STRUCT_TRAITS_MEMBER(color)
90 IPC_STRUCT_TRAITS_MEMBER(font_size)
91 IPC_STRUCT_TRAITS_MEMBER(order_list_state)
92 IPC_STRUCT_TRAITS_MEMBER(un_order_list_state)
93 IPC_STRUCT_TRAITS_MEMBER(text_align_center_state)
94 IPC_STRUCT_TRAITS_MEMBER(text_align_left_state)
95 IPC_STRUCT_TRAITS_MEMBER(text_align_right_state)
96 IPC_STRUCT_TRAITS_MEMBER(text_align_full_state)
97 IPC_STRUCT_TRAITS_MEMBER(has_composition)
98 IPC_STRUCT_TRAITS_END()
100 IPC_STRUCT_TRAITS_BEGIN(SelectionColor)
101 IPC_STRUCT_TRAITS_MEMBER(r)
102 IPC_STRUCT_TRAITS_MEMBER(g)
103 IPC_STRUCT_TRAITS_MEMBER(b)
104 IPC_STRUCT_TRAITS_MEMBER(a)
105 IPC_STRUCT_TRAITS_END()
107 IPC_ENUM_TRAITS(blink::WebNavigationPolicy)
108 IPC_ENUM_TRAITS(blink::WebNavigationType)
110 IPC_STRUCT_TRAITS_BEGIN(NavigationPolicyParams)
111 IPC_STRUCT_TRAITS_MEMBER(render_view_id)
112 IPC_STRUCT_TRAITS_MEMBER(cookie)
113 IPC_STRUCT_TRAITS_MEMBER(url)
114 IPC_STRUCT_TRAITS_MEMBER(httpMethod)
115 IPC_STRUCT_TRAITS_MEMBER(referrer)
116 IPC_STRUCT_TRAITS_MEMBER(policy)
117 IPC_STRUCT_TRAITS_MEMBER(type)
118 IPC_STRUCT_TRAITS_MEMBER(should_replace_current_entry)
119 IPC_STRUCT_TRAITS_MEMBER(is_main_frame)
120 IPC_STRUCT_TRAITS_MEMBER(is_redirect)
121 IPC_STRUCT_TRAITS_END()
122 #if !defined(EWK_BRINGUP) // FIXME: m67 bringup
123 IPC_ENUM_TRAITS(blink::WebViewMode)
126 IPC_MESSAGE_CONTROL2(WrtMsg_ParseUrl,
127 int, // result: request_id
130 IPC_MESSAGE_CONTROL2(WrtMsg_ParseUrlResponse,
131 int, // result: request_id
134 IPC_MESSAGE_CONTROL1(WrtMsg_SendWrtMessage,
135 Ewk_Wrt_Message_Data /* data */)
137 IPC_SYNC_MESSAGE_ROUTED1_1(EwkHostMsg_WrtSyncMessage,
138 Ewk_Wrt_Message_Data /* data */,
139 std::string /*result*/)
141 IPC_MESSAGE_ROUTED1(EwkHostMsg_WrtMessage,
142 Ewk_Wrt_Message_Data /* data */)
144 IPC_MESSAGE_CONTROL2(EwkViewHostMsg_HitTestReply,
145 int, /* render_view_id */
148 IPC_MESSAGE_CONTROL3(EwkViewHostMsg_HitTestAsyncReply,
149 int, /* render_view_id */
151 int64_t /* request id */)
153 IPC_MESSAGE_ROUTED2(EwkViewMsg_SetCSP,
154 std::string, /* policy */
155 Ewk_CSP_Header_Type /* header type */)
157 IPC_SYNC_MESSAGE_ROUTED0_2(EwkHostMsg_GetContentSecurityPolicy,
158 std::string, /* policy */
159 Ewk_CSP_Header_Type /* header type */)
161 IPC_MESSAGE_ROUTED3(EwkViewMsg_Scale,
162 double, /* scale factor */
166 IPC_MESSAGE_ROUTED1(EwkHostMsg_DidPrintPagesToPdf,
167 DidPrintPagesParams /* pdf document parameters */)
169 IPC_MESSAGE_CONTROL0(EflViewMsg_ClearCache)
170 IPC_MESSAGE_CONTROL1(EflViewMsg_SetCache,
173 IPC_MESSAGE_ROUTED3(EwkViewMsg_PrintToPdf,
176 base::FilePath /* file name to save pdf*/)
178 IPC_MESSAGE_ROUTED1(EwkViewMsg_GetMHTMLData,
179 int /* callback id */)
181 IPC_MESSAGE_ROUTED3(EwkViewMsg_DoHitTest,
182 int, /* horizontal position */
183 int, /* vertical position */
184 Ewk_Hit_Test_Mode /* mode */)
186 IPC_MESSAGE_ROUTED4(EwkViewMsg_DoHitTestAsync,
187 int, /* horizontal position */
188 int, /* vertical position */
189 Ewk_Hit_Test_Mode, /* mode */
190 int64_t /* request id */)
192 // Tells the renderer to clear the cache.
193 IPC_MESSAGE_ROUTED0(EwkViewMsg_UseSettingsFont)
194 IPC_MESSAGE_ROUTED0(EwkViewMsg_SetBrowserFont)
195 IPC_MESSAGE_ROUTED0(EwkViewMsg_SuspendScheduledTask)
196 IPC_MESSAGE_ROUTED0(EwkViewMsg_ResumeScheduledTasks)
198 IPC_MESSAGE_ROUTED0(EwkViewMsg_GetSelectionStyle)
200 IPC_MESSAGE_ROUTED2(EwkViewMsg_SetScroll,
201 int, /* horizontal position */
202 int /* vertical position */)
204 IPC_MESSAGE_ROUTED1(EwkViewMsg_PlainTextGet,
205 int /* callback id */)
207 IPC_MESSAGE_ROUTED1(EwkViewMsg_SelectionTextStyleState,
208 SelectionStylePrams /* params */)
210 IPC_MESSAGE_ROUTED1(EwkSettingsMsg_UpdateWebKitPreferencesEfl, WebPreferencesEfl)
212 IPC_MESSAGE_ROUTED2(EwkHostMsg_HandleTapGestureWithContext,
214 bool /* is_editable_content */)
216 IPC_MESSAGE_ROUTED2(EwkHostMsg_PlainTextGetContents,
217 std::string, /* contentText */
218 int /* callback id */)
220 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeContentsSize,
224 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeMaxScrollOffset,
228 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeScrollOffset,
232 IPC_MESSAGE_ROUTED2(EwkHostMsg_ReadMHTMLData,
233 std::string, /* Mhtml text */
234 int /* callback id */)
236 IPC_MESSAGE_ROUTED1(EwkHostMsg_DidChangePageScaleFactor,
237 double /* page scale factor */)
239 IPC_MESSAGE_ROUTED1(EwkViewMsg_SetDrawsTransparentBackground,
242 // Notifies the browser to form submit
243 IPC_MESSAGE_ROUTED1(EwkHostMsg_FormSubmit, GURL)
245 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppIconUrlGet,
246 int /* callback id */)
248 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppIconUrlGet,
249 std::string, /* icon url */
250 int /* callback id */)
252 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppIconUrlsGet,
253 int /* callback id */)
255 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppIconUrlsGet,
256 StringMap, /* icon urls */
257 int /* callback id */)
259 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppCapableGet,
260 int /* calback id */)
262 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppCapableGet,
264 int /* calback id */)
266 IPC_SYNC_MESSAGE_CONTROL1_1(EwkHostMsg_DecideNavigationPolicy,
267 NavigationPolicyParams,
270 // FIXME: error: ‘WebNavigationTypeOther’ is not a member of ‘blink’
271 #if !defined(EWK_BRINGUP) // FIXME: m67 bringup
272 IPC_MESSAGE_ROUTED1(ViewMsg_SetViewMode,
273 blink::WebViewMode /* view_mode */)
276 IPC_MESSAGE_ROUTED1(ViewMsg_SetTextZoomFactor,
277 float /*font zoom factor*/)
279 IPC_MESSAGE_ROUTED1(EwkFrameMsg_LoadNotFoundErrorPage,
280 std::string /* error url */)
282 IPC_MESSAGE_ROUTED1(EwkFrameMsg_MoveToNextOrPreviousSelectElement,
284 IPC_MESSAGE_ROUTED0(EwkFrameMsg_RequestSelectCollectionInformation)
285 IPC_MESSAGE_ROUTED4(EwkHostMsg_RequestSelectCollectionInformationUpdateACK,
286 int /* formElementCount */,
287 int /* currentNodeIndex */,
288 bool /* prevState */,
289 bool /* nextState */)
291 IPC_MESSAGE_ROUTED0(EwkHostMsg_DidNotAllowScript)