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(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_ENUM_TRAITS(blink::WebNavigationPolicy)
76 IPC_ENUM_TRAITS(blink::WebNavigationType)
78 IPC_STRUCT_TRAITS_BEGIN(NavigationPolicyParams)
79 IPC_STRUCT_TRAITS_MEMBER(render_frame_id)
80 IPC_STRUCT_TRAITS_MEMBER(cookie)
81 IPC_STRUCT_TRAITS_MEMBER(url)
82 IPC_STRUCT_TRAITS_MEMBER(httpMethod)
83 IPC_STRUCT_TRAITS_MEMBER(referrer)
84 IPC_STRUCT_TRAITS_MEMBER(policy)
85 IPC_STRUCT_TRAITS_MEMBER(type)
86 IPC_STRUCT_TRAITS_MEMBER(should_replace_current_entry)
87 IPC_STRUCT_TRAITS_MEMBER(is_main_frame)
88 IPC_STRUCT_TRAITS_MEMBER(is_redirect)
89 IPC_STRUCT_TRAITS_END()
90 #if !defined(EWK_BRINGUP) // FIXME: m67 bringup
91 IPC_ENUM_TRAITS(blink::WebViewMode)
94 IPC_MESSAGE_CONTROL2(WrtMsg_ParseUrl,
95 int, // result: request_id
98 IPC_MESSAGE_CONTROL2(WrtMsg_ParseUrlResponse,
99 int, // result: request_id
102 IPC_MESSAGE_CONTROL1(WrtMsg_SendWrtMessage,
103 Ewk_Wrt_Message_Data /* data */)
105 IPC_SYNC_MESSAGE_ROUTED1_1(EwkHostMsg_WrtSyncMessage,
106 Ewk_Wrt_Message_Data /* data */,
107 std::string /*result*/)
109 IPC_MESSAGE_ROUTED1(EwkHostMsg_WrtMessage,
110 Ewk_Wrt_Message_Data /* data */)
112 IPC_MESSAGE_CONTROL2(EwkViewHostMsg_HitTestReply,
113 int, /* render_view_id */
116 IPC_MESSAGE_CONTROL3(EwkViewHostMsg_HitTestAsyncReply,
117 int, /* render_view_id */
119 int64_t /* request id */)
121 IPC_MESSAGE_ROUTED0(EwkHostMsg_DidCreateDocumentElement)
123 IPC_MESSAGE_ROUTED1(EwkHostMsg_DidPrintPagesToPdf,
124 DidPrintPagesParams /* pdf document parameters */)
126 IPC_MESSAGE_CONTROL0(EflViewMsg_ClearCache)
127 IPC_MESSAGE_CONTROL1(EflViewMsg_SetCache, int64_t /* cache_total_capacity */)
128 IPC_MESSAGE_ROUTED3(EwkViewMsg_PrintToPdf,
131 base::FilePath /* file name to save pdf*/)
133 IPC_MESSAGE_ROUTED1(EwkViewMsg_GetMHTMLData,
134 int /* callback id */)
136 IPC_MESSAGE_ROUTED3(EwkViewMsg_DoHitTest,
137 int, /* horizontal position */
138 int, /* vertical position */
139 Ewk_Hit_Test_Mode /* mode */)
141 IPC_MESSAGE_ROUTED4(EwkViewMsg_DoHitTestAsync,
142 int, /* horizontal position */
143 int, /* vertical position */
144 Ewk_Hit_Test_Mode, /* mode */
145 int64_t /* request id */)
147 // Tells the renderer to clear the cache.
148 IPC_MESSAGE_ROUTED0(EwkViewMsg_UseSettingsFont)
149 IPC_MESSAGE_ROUTED0(EwkViewMsg_SetBrowserFont)
150 IPC_MESSAGE_ROUTED0(EwkViewMsg_SuspendScheduledTask)
151 IPC_MESSAGE_ROUTED0(EwkViewMsg_ResumeScheduledTasks)
153 IPC_MESSAGE_ROUTED2(EwkViewMsg_SetScroll,
154 int, /* horizontal position */
155 int /* vertical position */)
157 IPC_MESSAGE_ROUTED1(EwkFrameMsg_GetPlainText, int /* callback id */)
159 IPC_MESSAGE_ROUTED1(EwkSettingsMsg_UpdateWebKitPreferencesEfl, WebPreferencesEfl)
161 IPC_MESSAGE_ROUTED2(EwkHostMsg_HandleTapGestureWithContext,
163 bool /* is_editable_content */)
165 IPC_MESSAGE_ROUTED0(EwkHostMsg_PlayLinkEffect)
167 IPC_MESSAGE_ROUTED4(EwkHostMsg_AddEdgeEffectForUIF,
173 IPC_MESSAGE_ROUTED2(EwkHostMsg_PlainTextGetContents,
174 std::string, /* contentText */
175 int /* callback id */)
177 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeContentsSize,
181 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeMaxScrollOffset,
185 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeScrollOffset,
189 IPC_MESSAGE_ROUTED2(EwkHostMsg_ReadMHTMLData,
190 std::string, /* Mhtml text */
191 int /* callback id */)
193 IPC_MESSAGE_ROUTED1(EwkViewMsg_SetDrawsTransparentBackground,
196 // Notifies the browser to form submit
197 IPC_MESSAGE_ROUTED1(EwkHostMsg_FormSubmit, GURL)
199 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppIconUrlGet,
200 int /* callback id */)
202 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppIconUrlGet,
203 std::string, /* icon url */
204 int /* callback id */)
206 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppIconUrlsGet,
207 int /* callback id */)
209 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppIconUrlsGet,
210 StringMap, /* icon urls */
211 int /* callback id */)
213 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppCapableGet,
214 int /* calback id */)
216 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppCapableGet,
218 int /* calback id */)
220 #if defined(TIZEN_VIDEO_HOLE)
221 IPC_MESSAGE_ROUTED1(EwkViewMsg_SetVideoHole, bool /* Enable */)
224 IPC_SYNC_MESSAGE_CONTROL1_1(EwkHostMsg_DecideNavigationPolicy,
225 NavigationPolicyParams,
228 // FIXME: error: ‘WebNavigationTypeOther’ is not a member of ‘blink’
229 #if !defined(EWK_BRINGUP) // FIXME: m67 bringup
230 IPC_MESSAGE_ROUTED1(ViewMsg_SetViewMode,
231 blink::WebViewMode /* view_mode */)
234 IPC_MESSAGE_ROUTED1(ViewMsg_SetTextZoomFactor,
235 float /*font zoom factor*/)
237 IPC_MESSAGE_ROUTED1(EwkFrameMsg_LoadNotFoundErrorPage,
238 std::string /* error url */)
240 IPC_MESSAGE_ROUTED1(EwkFrameMsg_MoveToNextOrPreviousSelectElement,
242 IPC_MESSAGE_ROUTED0(EwkFrameMsg_RequestSelectCollectionInformation)
243 IPC_MESSAGE_ROUTED4(EwkHostMsg_RequestSelectCollectionInformationUpdateACK,
244 int /* formElementCount */,
245 int /* currentNodeIndex */,
246 bool /* prevState */,
247 bool /* nextState */)
249 IPC_MESSAGE_CONTROL1(EwkProcessMsg_UpdateTizenExtensible,
250 ExtensibleApiMap /* Extensible APIs */)
251 IPC_MESSAGE_CONTROL2(EwkProcessMsg_SetExtensibleAPI,
252 std::string /* api name */,
255 IPC_MESSAGE_ROUTED0(EwkHostMsg_DidNotAllowScript)