1 // Copyright 2015-2016 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/hit_test_params.h"
9 #include "common/navigation_policy_params.h"
10 #include "common/print_pages_params.h"
11 #include "common/web_preferences_efl.h"
12 #include "content/public/common/common_param_traits.h"
13 #include "content/public/common/common_param_traits_macros.h"
14 #include "ipc/ipc_channel_handle.h"
15 #include "ipc/ipc_message_macros.h"
16 #include "ipc_message_start_ewk.h"
17 #include "private/ewk_hit_test_private.h"
18 #include "private/ewk_wrt_private.h"
19 #include "public/ewk_hit_test_internal.h"
20 #include "public/ewk_view.h"
21 #include "public/ewk_view_internal.h"
22 #include "third_party/blink/public/web/web_navigation_policy.h"
23 #include "third_party/blink/public/web/web_navigation_type.h"
25 typedef std::map<std::string, std::string> StringMap;
26 typedef std::map<std::string, bool> ExtensibleApiMap;
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_MEMBER(link_effect_enabled)
41 IPC_STRUCT_TRAITS_END()
43 IPC_STRUCT_TRAITS_BEGIN(Hit_Test_Params::Node_Data)
44 IPC_STRUCT_TRAITS_MEMBER(tagName)
45 IPC_STRUCT_TRAITS_MEMBER(nodeValue)
46 IPC_STRUCT_TRAITS_MEMBER(attributes)
47 IPC_STRUCT_TRAITS_END()
49 IPC_STRUCT_TRAITS_BEGIN(Hit_Test_Params::Image_Data)
50 IPC_STRUCT_TRAITS_MEMBER(fileNameExtension)
51 IPC_STRUCT_TRAITS_MEMBER(imageBitmap)
52 IPC_STRUCT_TRAITS_END()
54 IPC_STRUCT_TRAITS_BEGIN(Hit_Test_Params)
55 IPC_STRUCT_TRAITS_MEMBER(context)
56 IPC_STRUCT_TRAITS_MEMBER(linkURI)
57 IPC_STRUCT_TRAITS_MEMBER(linkTitle)
58 IPC_STRUCT_TRAITS_MEMBER(linkLabel)
59 IPC_STRUCT_TRAITS_MEMBER(imageURI)
60 IPC_STRUCT_TRAITS_MEMBER(isEditable)
61 IPC_STRUCT_TRAITS_MEMBER(mode)
62 IPC_STRUCT_TRAITS_MEMBER(nodeData)
63 IPC_STRUCT_TRAITS_MEMBER(imageData)
64 IPC_STRUCT_TRAITS_END()
66 IPC_ENUM_TRAITS(Ewk_CSP_Header_Type)
68 IPC_ENUM_TRAITS(Ewk_Hit_Test_Mode)
70 IPC_STRUCT_TRAITS_BEGIN(DidPrintPagesParams)
71 IPC_STRUCT_TRAITS_MEMBER(metafile_data_handle)
72 IPC_STRUCT_TRAITS_MEMBER(data_size)
73 IPC_STRUCT_TRAITS_MEMBER(document_cookie)
74 IPC_STRUCT_TRAITS_MEMBER(filename)
75 IPC_STRUCT_TRAITS_END()
77 IPC_ENUM_TRAITS(blink::WebNavigationPolicy)
78 IPC_ENUM_TRAITS(blink::WebNavigationType)
80 IPC_STRUCT_TRAITS_BEGIN(NavigationPolicyParams)
81 IPC_STRUCT_TRAITS_MEMBER(render_frame_id)
82 IPC_STRUCT_TRAITS_MEMBER(cookie)
83 IPC_STRUCT_TRAITS_MEMBER(url)
84 IPC_STRUCT_TRAITS_MEMBER(httpMethod)
85 IPC_STRUCT_TRAITS_MEMBER(referrer)
86 IPC_STRUCT_TRAITS_MEMBER(policy)
87 IPC_STRUCT_TRAITS_MEMBER(type)
88 IPC_STRUCT_TRAITS_MEMBER(should_replace_current_entry)
89 IPC_STRUCT_TRAITS_MEMBER(is_main_frame)
90 IPC_STRUCT_TRAITS_MEMBER(is_redirect)
91 IPC_STRUCT_TRAITS_END()
92 #if !defined(EWK_BRINGUP) // FIXME: m67 bringup
93 IPC_ENUM_TRAITS(blink::WebViewMode)
96 IPC_MESSAGE_CONTROL2(WrtMsg_ParseUrl,
97 int, // result: request_id
100 IPC_MESSAGE_CONTROL2(WrtMsg_ParseUrlResponse,
101 int, // result: request_id
104 IPC_MESSAGE_CONTROL1(WrtMsg_SendWrtMessage,
105 Ewk_Wrt_Message_Data /* data */)
107 IPC_SYNC_MESSAGE_ROUTED1_1(EwkHostMsg_WrtSyncMessage,
108 Ewk_Wrt_Message_Data /* data */,
109 std::string /*result*/)
111 IPC_MESSAGE_ROUTED1(EwkHostMsg_WrtMessage,
112 Ewk_Wrt_Message_Data /* data */)
114 IPC_MESSAGE_CONTROL2(EwkViewHostMsg_HitTestReply,
115 int, /* render_view_id */
118 IPC_MESSAGE_CONTROL3(EwkViewHostMsg_HitTestAsyncReply,
119 int, /* render_view_id */
121 int64_t /* request id */)
123 IPC_MESSAGE_ROUTED0(EwkHostMsg_DidCreateDocumentElement)
125 IPC_MESSAGE_ROUTED1(EwkHostMsg_DidPrintPagesToPdf,
126 DidPrintPagesParams /* pdf document parameters */)
128 IPC_MESSAGE_CONTROL0(EflViewMsg_ClearCache)
129 IPC_MESSAGE_CONTROL1(EflViewMsg_SetCache, int64_t /* cache_total_capacity */)
130 IPC_MESSAGE_ROUTED3(EwkViewMsg_PrintToPdf,
133 base::FilePath /* file name to save pdf*/)
135 IPC_MESSAGE_ROUTED1(EwkViewMsg_GetMHTMLData,
136 int /* callback id */)
138 IPC_MESSAGE_ROUTED3(EwkViewMsg_DoHitTest,
139 int, /* horizontal position */
140 int, /* vertical position */
141 Ewk_Hit_Test_Mode /* mode */)
143 IPC_MESSAGE_ROUTED4(EwkViewMsg_DoHitTestAsync,
144 int, /* horizontal position */
145 int, /* vertical position */
146 Ewk_Hit_Test_Mode, /* mode */
147 int64_t /* request id */)
149 // Tells the renderer to clear the cache.
150 IPC_MESSAGE_ROUTED0(EwkViewMsg_UseSettingsFont)
151 IPC_MESSAGE_ROUTED0(EwkViewMsg_SetBrowserFont)
152 IPC_MESSAGE_ROUTED0(EwkViewMsg_SuspendScheduledTask)
153 IPC_MESSAGE_ROUTED0(EwkViewMsg_ResumeScheduledTasks)
155 IPC_MESSAGE_ROUTED2(EwkViewMsg_SetScroll,
156 int, /* horizontal position */
157 int /* vertical position */)
159 IPC_MESSAGE_ROUTED1(EwkFrameMsg_GetPlainText, int /* callback id */)
161 IPC_MESSAGE_ROUTED1(EwkSettingsMsg_UpdateWebKitPreferencesEfl, WebPreferencesEfl)
163 IPC_MESSAGE_ROUTED2(EwkHostMsg_HandleTapGestureWithContext,
165 bool /* is_editable_content */)
167 IPC_MESSAGE_ROUTED0(EwkHostMsg_PlayLinkEffect)
169 IPC_MESSAGE_ROUTED2(EwkHostMsg_PlainTextGetContents,
170 std::string, /* contentText */
171 int /* callback id */)
173 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeContentsSize,
177 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeMaxScrollOffset,
181 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeScrollOffset,
185 IPC_MESSAGE_ROUTED2(EwkHostMsg_ReadMHTMLData,
186 std::string, /* Mhtml text */
187 int /* callback id */)
189 IPC_MESSAGE_ROUTED1(EwkViewMsg_SetDrawsTransparentBackground,
192 // Notifies the browser to form submit
193 IPC_MESSAGE_ROUTED1(EwkHostMsg_FormSubmit, GURL)
195 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppIconUrlGet,
196 int /* callback id */)
198 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppIconUrlGet,
199 std::string, /* icon url */
200 int /* callback id */)
202 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppIconUrlsGet,
203 int /* callback id */)
205 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppIconUrlsGet,
206 StringMap, /* icon urls */
207 int /* callback id */)
209 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppCapableGet,
210 int /* calback id */)
212 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppCapableGet,
214 int /* calback id */)
216 #if defined(TIZEN_VIDEO_HOLE)
217 IPC_MESSAGE_ROUTED1(EwkViewMsg_SetVideoHole, bool /* Enable */)
220 IPC_SYNC_MESSAGE_CONTROL1_1(EwkHostMsg_DecideNavigationPolicy,
221 NavigationPolicyParams,
224 // FIXME: error: ‘WebNavigationTypeOther’ is not a member of ‘blink’
225 #if !defined(EWK_BRINGUP) // FIXME: m67 bringup
226 IPC_MESSAGE_ROUTED1(ViewMsg_SetViewMode,
227 blink::WebViewMode /* view_mode */)
230 IPC_MESSAGE_ROUTED1(ViewMsg_SetTextZoomFactor,
231 float /*font zoom factor*/)
233 IPC_MESSAGE_ROUTED1(EwkFrameMsg_LoadNotFoundErrorPage,
234 std::string /* error url */)
236 IPC_MESSAGE_ROUTED1(EwkFrameMsg_MoveToNextOrPreviousSelectElement,
238 IPC_MESSAGE_ROUTED0(EwkFrameMsg_RequestSelectCollectionInformation)
239 IPC_MESSAGE_ROUTED4(EwkHostMsg_RequestSelectCollectionInformationUpdateACK,
240 int /* formElementCount */,
241 int /* currentNodeIndex */,
242 bool /* prevState */,
243 bool /* nextState */)
245 IPC_MESSAGE_CONTROL1(EwkProcessMsg_UpdateTizenExtensible,
246 ExtensibleApiMap /* Extensible APIs */)
247 IPC_MESSAGE_CONTROL2(EwkProcessMsg_SetExtensibleAPI,
248 std::string /* api name */,
251 IPC_MESSAGE_ROUTED0(EwkHostMsg_DidNotAllowScript)