1 // Copyright (c) 2012 The Chromium Authors. 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.
8 #include "xwalk/runtime/common/android/xwalk_hit_test_data.h"
9 #include "content/public/common/common_param_traits.h"
10 #include "ipc/ipc_channel_handle.h"
11 #include "ipc/ipc_message_macros.h"
12 #include "ipc/ipc_platform_file.h"
14 // Singly-included section for enums and custom IPC traits.
15 #ifndef XWALK_RUNTIME_COMMON_ANDROID_XWALK_RENDER_VIEW_MESSAGES_H_
16 #define XWALK_RUNTIME_COMMON_ANDROID_XWALK_RENDER_VIEW_MESSAGES_H_
20 // TODO(upstream): - add enums and custom IPC traits here when needed.
24 #endif // XWALK_RUNTIME_COMMON_ANDROID_XWALK_RENDER_VIEW_MESSAGES_H_
26 IPC_STRUCT_TRAITS_BEGIN(xwalk::XWalkHitTestData)
27 IPC_STRUCT_TRAITS_MEMBER(type)
28 IPC_STRUCT_TRAITS_MEMBER(extra_data_for_type)
29 IPC_STRUCT_TRAITS_MEMBER(href)
30 IPC_STRUCT_TRAITS_MEMBER(anchor_text)
31 IPC_STRUCT_TRAITS_MEMBER(img_src)
32 IPC_STRUCT_TRAITS_END()
34 #define IPC_MESSAGE_START AndroidWebViewMsgStart
36 //-----------------------------------------------------------------------------
37 // RenderView messages
38 // These are messages sent from the browser to the renderer process.
40 // Tells the renderer to drop all WebCore memory cache.
41 IPC_MESSAGE_CONTROL0(XWalkViewMsg_ClearCache) // NOLINT(*)
43 // Request for the renderer to determine if the document contains any image
44 // elements. The id should be passed in the response message so the response
45 // can be associated with the request.
46 IPC_MESSAGE_ROUTED1(XWalkViewMsg_DocumentHasImages, // NOLINT(*)
49 // Do hit test at the given webview coordinate. "Webview" coordinates are
50 // physical pixel values with the 0,0 at the top left of the current displayed
51 // view (ie 0,0 is not the top left of the page if the page is scrolled).
52 IPC_MESSAGE_ROUTED2(XWalkViewMsg_DoHitTest, // NOLINT(*)
56 // Enables receiving pictures from the renderer on every new frame.
57 IPC_MESSAGE_ROUTED1(XWalkViewMsg_EnableCapturePictureCallback, // NOLINT(*)
60 // Requests a new picture with the latest renderer contents synchronously.
61 // This message blocks the browser process on the renderer until complete.
62 IPC_SYNC_MESSAGE_ROUTED0_0(XWalkViewMsg_CapturePictureSync) // NOLINT(*)
64 // Sets the zoom level for text only. Used in layout modes other than
66 IPC_MESSAGE_ROUTED1(XWalkViewMsg_SetTextZoomLevel, // NOLINT(*)
67 double /* zoom_level */)
69 // Resets WebKit WebView scrolling and scale state. We need to send this
70 // message whenever we want to guarantee that page's scale will be
71 // recalculated by WebKit.
72 IPC_MESSAGE_ROUTED0(XWalkViewMsg_ResetScrollAndScaleState) // NOLINT(*)
74 // Sets the initial page scale. This overrides initial scale set by
75 // the meta viewport tag.
76 IPC_MESSAGE_ROUTED1(XWalkViewMsg_SetInitialPageScale, // NOLINT(*)
77 double /* page_scale_factor */)
79 // Set the Javascript online property for network availability change.
80 IPC_MESSAGE_CONTROL1(XWalkViewMsg_SetJsOnlineProperty, bool /* network_up */) // NOLINT(*)
82 // Set the white list for Cross-Origin access.
83 IPC_MESSAGE_CONTROL2(XWalkViewMsg_SetOriginAccessWhitelist, // NOLINT(*)
84 std::string /* base url */,
85 std::string /* match pattern content*/)
87 //-----------------------------------------------------------------------------
88 // RenderView messages
89 // These are messages sent from the renderer to the browser process.
91 // Response to XWalkViewMsg_DocumentHasImages request.
92 IPC_MESSAGE_ROUTED2(XWalkViewHostMsg_DocumentHasImagesResponse, // NOLINT(*)
94 bool /* has_images */)
96 // Response to XWalkViewMsg_DoHitTest.
97 IPC_MESSAGE_ROUTED1(XWalkViewHostMsg_UpdateHitTestData, // NOLINT(*)
98 xwalk::XWalkHitTestData)
100 // Sent whenever the page scale factor (as seen by RenderView) is changed.
101 IPC_MESSAGE_ROUTED1(XWalkViewHostMsg_PageScaleFactorChanged, // NOLINT(*)
102 float /* page_scale_factor */)
104 // Notification that a new picture becomes available. It is only sent if
105 // XWalkViewMsg_EnableCapturePictureCallback was previously enabled.
106 IPC_MESSAGE_ROUTED0(XWalkViewHostMsg_PictureUpdated) // NOLINT(*)
108 // Sent by the renderer when accelerated compositing is enabled, allowing the
109 // browser to perform synchronous input event filtering.
110 IPC_MESSAGE_ROUTED1(XWalkViewHostMsg_DidActivateAcceleratedCompositing, // NOLINT(*)
111 int /* input_handler_id */)