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(EwkViewMsg_PlainTextGet,
160 int /* callback id */)
162 IPC_MESSAGE_ROUTED1(EwkSettingsMsg_UpdateWebKitPreferencesEfl, WebPreferencesEfl)
164 IPC_MESSAGE_ROUTED2(EwkHostMsg_HandleTapGestureWithContext,
166 bool /* is_editable_content */)
168 IPC_MESSAGE_ROUTED0(EwkHostMsg_PlayLinkEffect)
170 IPC_MESSAGE_ROUTED2(EwkHostMsg_PlainTextGetContents,
171 std::string, /* contentText */
172 int /* callback id */)
174 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeContentsSize,
178 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeMaxScrollOffset,
182 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeScrollOffset,
186 IPC_MESSAGE_ROUTED2(EwkHostMsg_ReadMHTMLData,
187 std::string, /* Mhtml text */
188 int /* callback id */)
190 IPC_MESSAGE_ROUTED1(EwkViewMsg_SetDrawsTransparentBackground,
193 // Notifies the browser to form submit
194 IPC_MESSAGE_ROUTED1(EwkHostMsg_FormSubmit, GURL)
196 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppIconUrlGet,
197 int /* callback id */)
199 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppIconUrlGet,
200 std::string, /* icon url */
201 int /* callback id */)
203 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppIconUrlsGet,
204 int /* callback id */)
206 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppIconUrlsGet,
207 StringMap, /* icon urls */
208 int /* callback id */)
210 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppCapableGet,
211 int /* calback id */)
213 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppCapableGet,
215 int /* calback id */)
217 IPC_SYNC_MESSAGE_CONTROL1_1(EwkHostMsg_DecideNavigationPolicy,
218 NavigationPolicyParams,
221 // FIXME: error: ‘WebNavigationTypeOther’ is not a member of ‘blink’
222 #if !defined(EWK_BRINGUP) // FIXME: m67 bringup
223 IPC_MESSAGE_ROUTED1(ViewMsg_SetViewMode,
224 blink::WebViewMode /* view_mode */)
227 IPC_MESSAGE_ROUTED1(ViewMsg_SetTextZoomFactor,
228 float /*font zoom factor*/)
230 IPC_MESSAGE_ROUTED1(EwkFrameMsg_LoadNotFoundErrorPage,
231 std::string /* error url */)
233 IPC_MESSAGE_ROUTED1(EwkFrameMsg_MoveToNextOrPreviousSelectElement,
235 IPC_MESSAGE_ROUTED0(EwkFrameMsg_RequestSelectCollectionInformation)
236 IPC_MESSAGE_ROUTED4(EwkHostMsg_RequestSelectCollectionInformationUpdateACK,
237 int /* formElementCount */,
238 int /* currentNodeIndex */,
239 bool /* prevState */,
240 bool /* nextState */)
242 IPC_MESSAGE_CONTROL1(EwkProcessMsg_UpdateTizenExtensible,
243 ExtensibleApiMap /* Extensible APIs */)
244 IPC_MESSAGE_CONTROL2(EwkProcessMsg_SetExtensibleAPI,
245 std::string /* api name */,
248 IPC_MESSAGE_ROUTED0(EwkHostMsg_DidNotAllowScript)