OLD | NEW |
---|---|
(Empty) | |
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. | |
4 | |
5 // Multiply-included message header, no traditional include guard. | |
6 | |
7 #include <string> | |
8 | |
9 #include "base/basictypes.h" | |
10 #include "base/process.h" | |
11 #include "content/common/content_export.h" | |
12 #include "content/public/common/common_param_traits.h" | |
13 #include "ipc/ipc_channel_handle.h" | |
14 #include "ipc/ipc_message_macros.h" | |
15 #include "ipc/ipc_message_utils.h" | |
16 #include "ui/gfx/rect.h" | |
17 #include "ui/gfx/size.h" | |
18 #include "webkit/glue/webcursor.h" | |
19 | |
20 #undef IPC_MESSAGE_EXPORT | |
21 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | |
22 | |
23 #define IPC_MESSAGE_START BrowserPluginMsgStart | |
24 | |
25 // Browser plugin messages | |
26 | |
27 // ----------------------------------------------------------------------------- | |
28 // These messages are from the embedder to the browser process. | |
29 | |
30 IPC_STRUCT_BEGIN(BrowserPluginHostMsg_PostMessage_Params) | |
31 // The serialized script value. | |
32 IPC_STRUCT_MEMBER(string16, data) | |
33 | |
34 // This is the routing ID of the source frame in the source process. The | |
35 // browser replaces it with the routing ID of the equivalent (swapped out) | |
36 // frame in the destination process. | |
Charlie Reis
2012/08/03 18:06:02
This comment seems stale, since you appear to be i
Fady Samuel
2012/08/03 19:34:43
Yup, postMessage really requires both renderer and
| |
37 IPC_STRUCT_MEMBER(int, source_routing_id) | |
38 | |
39 // The origin of the source frame. | |
40 IPC_STRUCT_MEMBER(string16, source_origin) | |
41 | |
42 // The origin for the message's target. | |
43 IPC_STRUCT_MEMBER(string16, target_origin) | |
44 IPC_STRUCT_END() | |
45 | |
46 IPC_MESSAGE_ROUTED1(BrowserPluginHostMsg_RouteMessageEvent, | |
47 BrowserPluginHostMsg_PostMessage_Params) | |
48 | |
49 // Tells the guest to focus or defocus itself. | |
50 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_SetFocus, | |
51 int /* instance_id */, | |
52 bool /* enable */) | |
53 | |
54 // Message payload includes: | |
55 // 1. A blob that should be cast to WebInputEvent | |
56 // 2. An optional boolean value indicating if a RawKeyDown event is associated | |
57 // to a keyboard shortcut of the browser. | |
58 IPC_SYNC_MESSAGE_ROUTED0_2(BrowserPluginHostMsg_HandleInputEvent, | |
59 bool /* handled */, | |
60 WebCursor /* cursor */) | |
61 | |
62 // An ACK to the guest process letting it know that the embedder has handled | |
63 // the previous frame and is ready for the next frame. If the guest sent the | |
64 // embedder a bitmap that does not match the size of the BrowserPlugin's | |
65 // container, the BrowserPlugin requests a new size as well. | |
66 IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_UpdateRect_ACK, | |
67 int /* instance_id */, | |
68 int /* message_id */, | |
69 gfx::Size /* repaint_view_size */) | |
70 | |
71 // A BrowserPlugin sends this to the browser process when it wants to navigate | |
72 // to a given src URL. If a guest WebContents already exists, it will navigate | |
73 // that WebContents. If not, it will create the WebContents, associate it with | |
74 // the BrowserPlugin's browser-side BrowserPluginHost as a guest, and navigate | |
75 // it to the requested URL. | |
76 IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_NavigateOrCreateGuest, | |
77 int /* instance_id*/, | |
78 long long /* frame_id */, | |
79 std::string /* src */) | |
80 | |
81 // When a BrowserPlugin has been removed from the embedder's DOM, it informs | |
82 // the browser process to cleanup the guest. | |
83 IPC_MESSAGE_ROUTED1(BrowserPluginHostMsg_PluginDestroyed, | |
84 int /* instance_id */) | |
85 | |
86 // ----------------------------------------------------------------------------- | |
87 // These messages are from the guest renderer to the browser process | |
88 | |
89 // A embedder sends this message to the browser when it wants | |
90 // to resize a guest plugin container so that the guest is relaid out | |
91 // according to the new size. | |
92 IPC_SYNC_MESSAGE_ROUTED5_0(BrowserPluginHostMsg_ResizeGuest, | |
93 int /* instance_id*/, | |
94 TransportDIB::Id /* damage_buffer_id */, | |
95 int /* width */, | |
96 int /* height */, | |
97 bool /* resize_pending */) | |
98 | |
99 // ----------------------------------------------------------------------------- | |
100 // These messages are from the browser process to the embedder. | |
101 | |
102 // When the guest navigates, the browser process informs the embedder through | |
103 // the BrowserPluginMsg_DidNavigate message. | |
104 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_DidNavigate, | |
105 int /* instance_id */, | |
106 GURL /* url */) | |
107 | |
108 // When the guest crashes, the browser process informs the embedder through this | |
109 // message. | |
110 IPC_MESSAGE_CONTROL1(BrowserPluginMsg_GuestCrashed, | |
111 int /* instance_id */) | |
112 | |
113 IPC_STRUCT_BEGIN(BrowserPluginMsg_UpdateRect_Params) | |
114 // The position and size of the bitmap. | |
115 IPC_STRUCT_MEMBER(gfx::Rect, bitmap_rect) | |
116 | |
117 // The scroll offset. Only one of these can be non-zero, and if they are | |
118 // both zero, then it means there is no scrolling and the scroll_rect is | |
119 // ignored. | |
120 IPC_STRUCT_MEMBER(int, dx) | |
121 IPC_STRUCT_MEMBER(int, dy) | |
122 | |
123 // The rectangular region to scroll. | |
124 IPC_STRUCT_MEMBER(gfx::Rect, scroll_rect) | |
125 | |
126 // The scroll offset of the render view. | |
127 IPC_STRUCT_MEMBER(gfx::Point, scroll_offset) | |
128 | |
129 // The regions of the bitmap (in view coords) that contain updated pixels. | |
130 // In the case of scrolling, this includes the scroll damage rect. | |
131 IPC_STRUCT_MEMBER(std::vector<gfx::Rect>, copy_rects) | |
132 | |
133 // The size of the RenderView when this message was generated. This is | |
134 // included so the host knows how large the view is from the perspective of | |
135 // the renderer process. This is necessary in case a resize operation is in | |
136 // progress. If auto-resize is enabled, this should update the corresponding | |
137 // view size. | |
138 IPC_STRUCT_MEMBER(gfx::Size, view_size) | |
139 | |
140 // All the above coordinates are in DIP. This is the scale factor needed | |
141 // to convert them to pixels. | |
142 IPC_STRUCT_MEMBER(float, scale_factor) | |
143 | |
144 // Is this UpdateRect an ACK to a resize request? | |
145 IPC_STRUCT_MEMBER(bool, is_resize_ack) | |
146 IPC_STRUCT_END() | |
147 | |
148 // When the user tabs to the end of the tab stops of a guest, the browser | |
149 // process informs the embedder to tab out of the browser plugin. | |
150 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_AdvanceFocus, | |
151 int /* instance_id */, | |
152 bool /* reverse */) | |
153 | |
154 // The guest has damage it wants to convey to the embedder so that it can | |
155 // update its backing store. | |
156 IPC_MESSAGE_CONTROL3(BrowserPluginMsg_UpdateRect, | |
157 int /* instance_id */, | |
158 int /* message_id */, | |
159 BrowserPluginMsg_UpdateRect_Params) | |
OLD | NEW |