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.h"
19 #include "public/ewk_view.h"
20 #include "third_party/blink/public/web/web_navigation_policy.h"
21 #include "third_party/blink/public/web/web_navigation_type.h"
22 //#include "third_party/blink/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(isEditable)
59 IPC_STRUCT_TRAITS_MEMBER(mode)
60 IPC_STRUCT_TRAITS_MEMBER(nodeData)
61 IPC_STRUCT_TRAITS_MEMBER(imageData)
62 IPC_STRUCT_TRAITS_END()
64 IPC_ENUM_TRAITS(Ewk_CSP_Header_Type)
66 IPC_ENUM_TRAITS(Ewk_Hit_Test_Mode)
68 IPC_STRUCT_TRAITS_BEGIN(DidPrintPagesParams)
69 IPC_STRUCT_TRAITS_MEMBER(metafile_data_handle)
70 IPC_STRUCT_TRAITS_MEMBER(data_size)
71 IPC_STRUCT_TRAITS_MEMBER(document_cookie)
72 IPC_STRUCT_TRAITS_MEMBER(filename)
73 IPC_STRUCT_TRAITS_END()
75 IPC_STRUCT_TRAITS_BEGIN(CacheParamsEfl)
76 IPC_STRUCT_TRAITS_MEMBER(cache_total_capacity)
77 IPC_STRUCT_TRAITS_MEMBER(cache_min_dead_capacity)
78 IPC_STRUCT_TRAITS_MEMBER(cache_max_dead_capacity)
79 IPC_STRUCT_TRAITS_END()
81 IPC_STRUCT_TRAITS_BEGIN(SelectionStylePrams)
82 IPC_STRUCT_TRAITS_MEMBER(underline_state)
83 IPC_STRUCT_TRAITS_MEMBER(italic_state)
84 IPC_STRUCT_TRAITS_MEMBER(bold_state)
85 IPC_STRUCT_TRAITS_MEMBER(bg_color)
86 IPC_STRUCT_TRAITS_MEMBER(color)
87 IPC_STRUCT_TRAITS_MEMBER(font_size)
88 IPC_STRUCT_TRAITS_MEMBER(order_list_state)
89 IPC_STRUCT_TRAITS_MEMBER(un_order_list_state)
90 IPC_STRUCT_TRAITS_MEMBER(text_align_center_state)
91 IPC_STRUCT_TRAITS_MEMBER(text_align_left_state)
92 IPC_STRUCT_TRAITS_MEMBER(text_align_right_state)
93 IPC_STRUCT_TRAITS_MEMBER(text_align_full_state)
94 IPC_STRUCT_TRAITS_MEMBER(has_composition)
95 IPC_STRUCT_TRAITS_END()
97 IPC_STRUCT_TRAITS_BEGIN(SelectionColor)
98 IPC_STRUCT_TRAITS_MEMBER(r)
99 IPC_STRUCT_TRAITS_MEMBER(g)
100 IPC_STRUCT_TRAITS_MEMBER(b)
101 IPC_STRUCT_TRAITS_MEMBER(a)
102 IPC_STRUCT_TRAITS_END()
104 IPC_ENUM_TRAITS(blink::WebNavigationPolicy)
105 IPC_ENUM_TRAITS(blink::WebNavigationType)
107 IPC_STRUCT_TRAITS_BEGIN(NavigationPolicyParams)
108 IPC_STRUCT_TRAITS_MEMBER(render_view_id)
109 IPC_STRUCT_TRAITS_MEMBER(cookie)
110 IPC_STRUCT_TRAITS_MEMBER(url)
111 IPC_STRUCT_TRAITS_MEMBER(httpMethod)
112 IPC_STRUCT_TRAITS_MEMBER(referrer)
113 IPC_STRUCT_TRAITS_MEMBER(policy)
114 IPC_STRUCT_TRAITS_MEMBER(type)
115 IPC_STRUCT_TRAITS_MEMBER(should_replace_current_entry)
116 IPC_STRUCT_TRAITS_MEMBER(is_main_frame)
117 IPC_STRUCT_TRAITS_MEMBER(is_redirect)
118 IPC_STRUCT_TRAITS_END()
119 #if !defined(EWK_BRINGUP) // FIXME: m67 bringup
120 IPC_ENUM_TRAITS(blink::WebViewMode)
123 IPC_MESSAGE_CONTROL2(WrtMsg_ParseUrl,
124 int, // result: request_id
127 IPC_MESSAGE_CONTROL2(WrtMsg_ParseUrlResponse,
128 int, // result: request_id
131 IPC_MESSAGE_CONTROL1(WrtMsg_SendWrtMessage,
132 Ewk_Wrt_Message_Data /* data */);
134 IPC_SYNC_MESSAGE_ROUTED1_1(EwkHostMsg_WrtSyncMessage,
135 Ewk_Wrt_Message_Data /* data */,
136 std::string /*result*/);
138 IPC_MESSAGE_ROUTED1(EwkHostMsg_WrtMessage,
139 Ewk_Wrt_Message_Data /* data */);
141 IPC_MESSAGE_CONTROL2(EwkViewHostMsg_HitTestReply,
142 int, /* render_view_id */
145 IPC_MESSAGE_CONTROL3(EwkViewHostMsg_HitTestAsyncReply,
146 int, /* render_view_id */
148 int64_t /* request id */)
150 IPC_MESSAGE_ROUTED2(EwkViewMsg_SetCSP,
151 std::string, /* policy */
152 Ewk_CSP_Header_Type /* header type */)
154 IPC_SYNC_MESSAGE_ROUTED0_2(EwkHostMsg_GetContentSecurityPolicy,
155 std::string, /* policy */
156 Ewk_CSP_Header_Type /* header type */)
158 IPC_MESSAGE_ROUTED3(EwkViewMsg_Scale,
159 double, /* scale factor */
163 IPC_MESSAGE_ROUTED1(EwkHostMsg_DidPrintPagesToPdf,
164 DidPrintPagesParams /* pdf document parameters */)
166 IPC_MESSAGE_CONTROL0(EflViewMsg_ClearCache)
167 IPC_MESSAGE_CONTROL1(EflViewMsg_SetCache,
170 IPC_MESSAGE_ROUTED3(EwkViewMsg_PrintToPdf,
173 base::FilePath /* file name to save pdf*/)
175 IPC_MESSAGE_ROUTED1(EwkViewMsg_GetMHTMLData,
176 int /* callback id */)
178 IPC_MESSAGE_ROUTED3(EwkViewMsg_DoHitTest,
179 int, /* horizontal position */
180 int, /* vertical position */
181 Ewk_Hit_Test_Mode /* mode */)
183 IPC_MESSAGE_ROUTED4(EwkViewMsg_DoHitTestAsync,
184 int, /* horizontal position */
185 int, /* vertical position */
186 Ewk_Hit_Test_Mode, /* mode */
187 int64_t /* request id */)
189 // Tells the renderer to clear the cache.
190 IPC_MESSAGE_ROUTED0(EwkViewMsg_UseSettingsFont)
191 IPC_MESSAGE_ROUTED0(EwkViewMsg_SetBrowserFont)
192 IPC_MESSAGE_ROUTED0(EwkViewMsg_SuspendScheduledTask)
193 IPC_MESSAGE_ROUTED0(EwkViewMsg_ResumeScheduledTasks)
195 IPC_MESSAGE_ROUTED0(EwkViewMsg_GetSelectionStyle)
197 IPC_MESSAGE_ROUTED2(EwkViewMsg_SetScroll,
198 int, /* horizontal position */
199 int /* vertical position */)
201 IPC_MESSAGE_ROUTED1(EwkViewMsg_PlainTextGet,
202 int /* callback id */)
204 IPC_MESSAGE_ROUTED1(EwkViewMsg_SelectionTextStyleState,
205 SelectionStylePrams /* params */)
207 IPC_MESSAGE_ROUTED1(EwkSettingsMsg_UpdateWebKitPreferencesEfl, WebPreferencesEfl)
209 IPC_MESSAGE_ROUTED2(EwkHostMsg_HandleTapGestureWithContext,
211 bool /* is_editable_content */)
213 IPC_MESSAGE_ROUTED2(EwkHostMsg_PlainTextGetContents,
214 std::string, /* contentText */
215 int /* callback id */)
217 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeContentsSize,
221 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeMaxScrollOffset,
225 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeScrollOffset,
229 IPC_MESSAGE_ROUTED2(EwkHostMsg_ReadMHTMLData,
230 std::string, /* Mhtml text */
231 int /* callback id */)
233 IPC_MESSAGE_ROUTED1(EwkHostMsg_DidChangePageScaleFactor,
234 double /* page scale factor */)
236 IPC_MESSAGE_ROUTED1(EwkViewMsg_SetDrawsTransparentBackground,
239 // Notifies the browser to form submit
240 IPC_MESSAGE_ROUTED1(EwkHostMsg_FormSubmit, GURL)
242 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppIconUrlGet,
243 int /* callback id */)
245 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppIconUrlGet,
246 std::string, /* icon url */
247 int /* callback id */)
249 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppIconUrlsGet,
250 int /* callback id */)
252 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppIconUrlsGet,
253 StringMap, /* icon urls */
254 int /* callback id */)
256 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppCapableGet,
257 int /* calback id */)
259 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppCapableGet,
261 int /* calback id */)
263 IPC_SYNC_MESSAGE_CONTROL1_1(EwkHostMsg_DecideNavigationPolicy,
264 NavigationPolicyParams,
267 // FIXME: error: ‘WebNavigationTypeOther’ is not a member of ‘blink’
268 #if !defined(EWK_BRINGUP) // FIXME: m67 bringup
269 IPC_MESSAGE_ROUTED1(ViewMsg_SetViewMode,
270 blink::WebViewMode /* view_mode */)
273 IPC_MESSAGE_ROUTED1(ViewMsg_SetTextZoomFactor,
274 float /*font zoom factor*/)
276 IPC_MESSAGE_ROUTED1(EwkFrameMsg_LoadNotFoundErrorPage,
277 std::string /* error url */)
279 IPC_MESSAGE_ROUTED1(EwkFrameMsg_MoveToNextOrPreviousSelectElement,
281 IPC_MESSAGE_ROUTED0(EwkFrameMsg_RequestSelectCollectionInformation);
282 IPC_MESSAGE_ROUTED4(EwkHostMsg_RequestSelectCollectionInformationUpdateACK,
283 int /* formElementCount */,
284 int /* currentNodeIndex */,
285 bool /* prevState */,
286 bool /* nextState */)