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 "android_webview/common/aw_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"
11 #include "third_party/skia/include/core/SkColor.h"
12 #include "ui/gfx/geometry/point_f.h"
13 #include "ui/gfx/geometry/size_f.h"
15 // Singly-included section for enums and custom IPC traits.
16 #ifndef ANDROID_WEBVIEW_COMMON_RENDER_VIEW_MESSAGES_H_
17 #define ANDROID_WEBVIEW_COMMON_RENDER_VIEW_MESSAGES_H_
21 // TODO - add enums and custom IPC traits here when needed.
25 #endif // ANDROID_WEBVIEW_COMMON_RENDER_VIEW_MESSAGES_H_
27 IPC_STRUCT_TRAITS_BEGIN(android_webview::AwHitTestData
)
28 IPC_STRUCT_TRAITS_MEMBER(type
)
29 IPC_STRUCT_TRAITS_MEMBER(extra_data_for_type
)
30 IPC_STRUCT_TRAITS_MEMBER(href
)
31 IPC_STRUCT_TRAITS_MEMBER(anchor_text
)
32 IPC_STRUCT_TRAITS_MEMBER(img_src
)
33 IPC_STRUCT_TRAITS_END()
35 #define IPC_MESSAGE_START AndroidWebViewMsgStart
37 //-----------------------------------------------------------------------------
38 // RenderView messages
39 // These are messages sent from the browser to the renderer process.
41 // Tells the renderer to drop all WebCore memory cache.
42 IPC_MESSAGE_CONTROL0(AwViewMsg_ClearCache
)
44 // Request for the renderer to determine if the document contains any image
45 // elements. The id should be passed in the response message so the response
46 // can be associated with the request.
47 IPC_MESSAGE_ROUTED1(AwViewMsg_DocumentHasImages
,
50 // Do hit test at the given webview coordinate. "Webview" coordinates are
51 // physical pixel values with the 0,0 at the top left of the current displayed
52 // view (ie 0,0 is not the top left of the page if the page is scrolled).
53 IPC_MESSAGE_ROUTED2(AwViewMsg_DoHitTest
,
54 gfx::PointF
/* touch_center */,
55 gfx::SizeF
/* touch_area */)
57 // Sets the zoom factor for text only. Used in layout modes other than
59 IPC_MESSAGE_ROUTED1(AwViewMsg_SetTextZoomFactor
,
60 float /* zoom_factor */)
62 // Resets WebKit WebView scrolling and scale state. We need to send this
63 // message whenever we want to guarantee that page's scale will be
64 // recalculated by WebKit.
65 IPC_MESSAGE_ROUTED0(AwViewMsg_ResetScrollAndScaleState
)
67 // Sets the initial page scale. This overrides initial scale set by
68 // the meta viewport tag.
69 IPC_MESSAGE_ROUTED1(AwViewMsg_SetInitialPageScale
,
70 double /* page_scale_factor */)
72 // Sets the base background color for this view.
73 IPC_MESSAGE_ROUTED1(AwViewMsg_SetBackgroundColor
,
76 IPC_MESSAGE_CONTROL1(AwViewMsg_SetJsOnlineProperty
,
77 bool /* network_up */)
79 //-----------------------------------------------------------------------------
80 // RenderView messages
81 // These are messages sent from the renderer to the browser process.
83 // Response to AwViewMsg_DocumentHasImages request.
84 IPC_MESSAGE_ROUTED2(AwViewHostMsg_DocumentHasImagesResponse
,
86 bool /* has_images */)
88 // Response to AwViewMsg_DoHitTest.
89 IPC_MESSAGE_ROUTED1(AwViewHostMsg_UpdateHitTestData
,
90 android_webview::AwHitTestData
)
92 // Sent whenever the page scale factor (as seen by RenderView) is changed.
93 IPC_MESSAGE_ROUTED1(AwViewHostMsg_PageScaleFactorChanged
,
94 float /* page_scale_factor */)
96 // Sent whenever the contents size (as seen by RenderView) is changed.
97 IPC_MESSAGE_ROUTED1(AwViewHostMsg_OnContentsSizeChanged
,
98 gfx::Size
/* contents_size */)
100 // Sent immediately before a top level navigation is initiated within Blink.
101 // There are some exlusions, the most important ones are it is not sent
102 // when creating a popup window, and not sent for application initiated
103 // navigations. See AwContentRendererClient::HandleNavigation for all
104 // cornercases. This is sent before updating the NavigationController state
105 // or creating a URLRequest for the main frame resource.
106 IPC_SYNC_MESSAGE_CONTROL2_1(AwViewHostMsg_ShouldOverrideUrlLoading
,
107 int /* render_frame_id id */,
108 base::string16
/* in - url */,
109 bool /* out - result */)
111 // Sent when a subframe is created.
112 IPC_MESSAGE_CONTROL2(AwViewHostMsg_SubFrameCreated
,
113 int /* parent_render_frame_id */,
114 int /* child_render_frame_id */)