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.
6 #include "xwalk/runtime/common/android/xwalk_hit_test_data.h"
7 #include "content/public/common/common_param_traits.h"
8 #include "ipc/ipc_channel_handle.h"
9 #include "ipc/ipc_message_macros.h"
10 #include "ipc/ipc_platform_file.h"
12 // Singly-included section for enums and custom IPC traits.
13 #ifndef XWALK_RUNTIME_COMMON_ANDROID_XWALK_RENDER_VIEW_MESSAGES_H_
14 #define XWALK_RUNTIME_COMMON_ANDROID_XWALK_RENDER_VIEW_MESSAGES_H_
18 // TODO(upstream): - add enums and custom IPC traits here when needed.
22 #endif // XWALK_RUNTIME_COMMON_ANDROID_XWALK_RENDER_VIEW_MESSAGES_H_
24 IPC_STRUCT_TRAITS_BEGIN(xwalk::XWalkHitTestData)
25 IPC_STRUCT_TRAITS_MEMBER(type)
26 IPC_STRUCT_TRAITS_MEMBER(extra_data_for_type)
27 IPC_STRUCT_TRAITS_MEMBER(href)
28 IPC_STRUCT_TRAITS_MEMBER(anchor_text)
29 IPC_STRUCT_TRAITS_MEMBER(img_src)
30 IPC_STRUCT_TRAITS_END()
32 #define IPC_MESSAGE_START AndroidWebViewMsgStart
34 //-----------------------------------------------------------------------------
35 // RenderView messages
36 // These are messages sent from the browser to the renderer process.
38 // Tells the renderer to drop all WebCore memory cache.
39 IPC_MESSAGE_CONTROL0(XWalkViewMsg_ClearCache)
41 // Request for the renderer to determine if the document contains any image
42 // elements. The id should be passed in the response message so the response
43 // can be associated with the request.
44 IPC_MESSAGE_ROUTED1(XWalkViewMsg_DocumentHasImages,
47 // Do hit test at the given webview coordinate. "Webview" coordinates are
48 // physical pixel values with the 0,0 at the top left of the current displayed
49 // view (ie 0,0 is not the top left of the page if the page is scrolled).
50 IPC_MESSAGE_ROUTED2(XWalkViewMsg_DoHitTest,
54 // Enables receiving pictures from the renderer on every new frame.
55 IPC_MESSAGE_ROUTED1(XWalkViewMsg_EnableCapturePictureCallback,
58 // Requests a new picture with the latest renderer contents synchronously.
59 // This message blocks the browser process on the renderer until complete.
60 IPC_SYNC_MESSAGE_ROUTED0_0(XWalkViewMsg_CapturePictureSync)
62 // Sets the zoom level for text only. Used in layout modes other than
64 IPC_MESSAGE_ROUTED1(XWalkViewMsg_SetTextZoomLevel,
65 double /* zoom_level */)
67 // Resets WebKit WebView scrolling and scale state. We need to send this
68 // message whenever we want to guarantee that page's scale will be
69 // recalculated by WebKit.
70 IPC_MESSAGE_ROUTED0(XWalkViewMsg_ResetScrollAndScaleState)
72 // Sets the initial page scale. This overrides initial scale set by
73 // the meta viewport tag.
74 IPC_MESSAGE_ROUTED1(XWalkViewMsg_SetInitialPageScale,
75 double /* page_scale_factor */)
77 // Set the Javascript online property for network availability change.
78 IPC_MESSAGE_CONTROL1(XWalkViewMsg_SetJsOnlineProperty, bool /* network_up */)
80 //-----------------------------------------------------------------------------
81 // RenderView messages
82 // These are messages sent from the renderer to the browser process.
84 // Response to XWalkViewMsg_DocumentHasImages request.
85 IPC_MESSAGE_ROUTED2(XWalkViewHostMsg_DocumentHasImagesResponse,
87 bool /* has_images */)
89 // Response to XWalkViewMsg_DoHitTest.
90 IPC_MESSAGE_ROUTED1(XWalkViewHostMsg_UpdateHitTestData,
91 xwalk::XWalkHitTestData)
93 // Sent whenever the page scale factor (as seen by RenderView) is changed.
94 IPC_MESSAGE_ROUTED1(XWalkViewHostMsg_PageScaleFactorChanged,
95 float /* page_scale_factor */)
97 // Notification that a new picture becomes available. It is only sent if
98 // XWalkViewMsg_EnableCapturePictureCallback was previously enabled.
99 IPC_MESSAGE_ROUTED0(XWalkViewHostMsg_PictureUpdated)
101 // Sent by the renderer when accelerated compositing is enabled, allowing the
102 // browser to perform synchronous input event filtering.
103 IPC_MESSAGE_ROUTED1(XWalkViewHostMsg_DidActivateAcceleratedCompositing,
104 int /* input_handler_id */)