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 "ipc/ipc_channel_handle.h"
13 #include "ipc/ipc_message_macros.h"
14 #include "ipc_message_start_ewk.h"
15 #include "private/ewk_hit_test_private.h"
16 #include "private/ewk_wrt_private.h"
17 #include "public/ewk_hit_test_internal.h"
18 #include "public/ewk_view.h"
19 #include "public/ewk_view_internal.h"
20 #include "third_party/blink/public/web/web_navigation_policy.h"
21 #include "third_party/blink/public/web/web_navigation_type.h"
23 typedef std::map<std::string, std::string> StringMap;
24 typedef std::map<std::string, bool> ExtensibleApiMap;
26 #define IPC_MESSAGE_START EwkMsgStart
28 IPC_STRUCT_TRAITS_BEGIN(Ewk_Wrt_Message_Data)
29 IPC_STRUCT_TRAITS_MEMBER(type)
30 IPC_STRUCT_TRAITS_MEMBER(value)
31 IPC_STRUCT_TRAITS_MEMBER(id)
32 IPC_STRUCT_TRAITS_MEMBER(reference_id)
33 IPC_STRUCT_TRAITS_END()
35 IPC_STRUCT_TRAITS_BEGIN(WebPreferencesEfl)
36 IPC_STRUCT_TRAITS_MEMBER(shrinks_viewport_content_to_fit)
37 IPC_STRUCT_TRAITS_MEMBER(javascript_can_open_windows_automatically_ewk)
38 IPC_STRUCT_TRAITS_MEMBER(link_effect_enabled)
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(EwkViewMsg_PlainTextGet,
158 int /* callback id */)
160 IPC_MESSAGE_ROUTED1(EwkSettingsMsg_UpdateWebKitPreferencesEfl, WebPreferencesEfl)
162 IPC_MESSAGE_ROUTED2(EwkHostMsg_HandleTapGestureWithContext,
164 bool /* is_editable_content */)
166 IPC_MESSAGE_ROUTED0(EwkHostMsg_PlayLinkEffect)
168 IPC_MESSAGE_ROUTED2(EwkHostMsg_PlainTextGetContents,
169 std::string, /* contentText */
170 int /* callback id */)
172 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeContentsSize,
176 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeMaxScrollOffset,
180 IPC_MESSAGE_ROUTED2(EwkHostMsg_DidChangeScrollOffset,
184 IPC_MESSAGE_ROUTED2(EwkHostMsg_ReadMHTMLData,
185 std::string, /* Mhtml text */
186 int /* callback id */)
188 IPC_MESSAGE_ROUTED1(EwkViewMsg_SetDrawsTransparentBackground,
191 // Notifies the browser to form submit
192 IPC_MESSAGE_ROUTED1(EwkHostMsg_FormSubmit, GURL)
194 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppIconUrlGet,
195 int /* callback id */)
197 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppIconUrlGet,
198 std::string, /* icon url */
199 int /* callback id */)
201 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppIconUrlsGet,
202 int /* callback id */)
204 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppIconUrlsGet,
205 StringMap, /* icon urls */
206 int /* callback id */)
208 IPC_MESSAGE_ROUTED1(EwkViewMsg_WebAppCapableGet,
209 int /* calback id */)
211 IPC_MESSAGE_ROUTED2(EwkHostMsg_WebAppCapableGet,
213 int /* calback id */)
215 IPC_SYNC_MESSAGE_CONTROL1_1(EwkHostMsg_DecideNavigationPolicy,
216 NavigationPolicyParams,
219 // FIXME: error: ‘WebNavigationTypeOther’ is not a member of ‘blink’
220 #if !defined(EWK_BRINGUP) // FIXME: m67 bringup
221 IPC_MESSAGE_ROUTED1(ViewMsg_SetViewMode,
222 blink::WebViewMode /* view_mode */)
225 IPC_MESSAGE_ROUTED1(ViewMsg_SetTextZoomFactor,
226 float /*font zoom factor*/)
228 IPC_MESSAGE_ROUTED1(EwkFrameMsg_LoadNotFoundErrorPage,
229 std::string /* error url */)
231 IPC_MESSAGE_ROUTED1(EwkFrameMsg_MoveToNextOrPreviousSelectElement,
233 IPC_MESSAGE_ROUTED0(EwkFrameMsg_RequestSelectCollectionInformation)
234 IPC_MESSAGE_ROUTED4(EwkHostMsg_RequestSelectCollectionInformationUpdateACK,
235 int /* formElementCount */,
236 int /* currentNodeIndex */,
237 bool /* prevState */,
238 bool /* nextState */)
240 IPC_MESSAGE_CONTROL1(EwkProcessMsg_UpdateTizenExtensible,
241 ExtensibleApiMap /* Extensible APIs */)
242 IPC_MESSAGE_CONTROL2(EwkProcessMsg_SetExtensibleAPI,
243 std::string /* api name */,
246 IPC_MESSAGE_ROUTED0(EwkHostMsg_DidNotAllowScript)