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 | |
Charlie Reis
2012/08/01 23:20:51
nit: End with period. Same below.
Fady Samuel
2012/08/02 18:32:47
Done.
| |
29 | |
30 IPC_STRUCT_BEGIN(BrowserPluginHostMsg_PostMessage_Params) | |
Charlie Reis
2012/08/01 23:20:51
Why does this need to be duplicated from ViewMsg_P
Fady Samuel
2012/08/02 18:32:47
Short answer: Badness happens when I try to access
Charlie Reis
2012/08/03 18:06:02
Ok. I'm guessing we'll need to tweak the paramete
| |
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. | |
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 renderer sends this to the browser process when it wants to | |
72 // create a browser plugin. The browser will a guest renderer process | |
Charlie Reis
2012/08/01 23:20:51
nit: The browser will create
The comment makes th
Fady Samuel
2012/08/02 18:32:47
Agreed, this is very confusing and this is not a g
Charlie Reis
2012/08/03 18:06:02
The comment is much better, thanks. I'd recommend
| |
73 // if necessary. | |
74 IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_NavigateFromEmbedder, | |
75 int /* instance_id*/, | |
76 long long /* frame_id */, | |
77 std::string /* src */) | |
78 | |
79 // When a BrowserPlugin has been removed from the embedder's DOM, it informs | |
80 // the browser process to cleanup the guest. | |
81 IPC_MESSAGE_ROUTED1(BrowserPluginHostMsg_PluginDestroyed, | |
82 int /* instance_id */) | |
83 | |
84 // ----------------------------------------------------------------------------- | |
85 // These messages are from the guest renderer to the browser process | |
86 | |
87 // A embedder sends this message to the browser when it wants | |
88 // to resize a guest plugin container so that the guest is relaid out | |
89 // according to the new size. | |
90 IPC_SYNC_MESSAGE_ROUTED5_0(BrowserPluginHostMsg_ResizeGuest, | |
91 int /* instance_id*/, | |
92 TransportDIB::Id /* damage_buffer_id */, | |
93 int /* width */, | |
94 int /* height */, | |
95 bool /* resize_pending */) | |
96 | |
97 // ----------------------------------------------------------------------------- | |
98 // These messages are from the browser process to the embedder. | |
99 | |
100 // When the guest navigates, the browser process informs the embedder through | |
101 // the BrowserPluginMsg_UpdateURL message. | |
Charlie Reis
2012/08/01 23:20:51
Why does the embedder need to know? Just to expos
Fady Samuel
2012/08/02 18:32:47
Mihai wrote a small browser demo with the browser
| |
102 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_UpdateURL, | |
103 int /* instance_id */, | |
104 GURL /* url */) | |
105 | |
106 // When the guest crashes, the browser process informs the embedder through this | |
107 // message. | |
108 IPC_MESSAGE_CONTROL1(BrowserPluginMsg_GuestCrashed, | |
109 int /* instance_id */) | |
110 | |
111 IPC_STRUCT_BEGIN(BrowserPluginMsg_UpdateRect_Params) | |
112 // The position and size of the bitmap. | |
113 IPC_STRUCT_MEMBER(gfx::Rect, bitmap_rect) | |
114 | |
115 // The scroll offset. Only one of these can be non-zero, and if they are | |
116 // both zero, then it means there is no scrolling and the scroll_rect is | |
117 // ignored. | |
118 IPC_STRUCT_MEMBER(int, dx) | |
119 IPC_STRUCT_MEMBER(int, dy) | |
120 | |
121 // The rectangular region to scroll. | |
122 IPC_STRUCT_MEMBER(gfx::Rect, scroll_rect) | |
123 | |
124 // The scroll offset of the render view. | |
125 IPC_STRUCT_MEMBER(gfx::Point, scroll_offset) | |
126 | |
127 // The regions of the bitmap (in view coords) that contain updated pixels. | |
128 // In the case of scrolling, this includes the scroll damage rect. | |
129 IPC_STRUCT_MEMBER(std::vector<gfx::Rect>, copy_rects) | |
130 | |
131 // The size of the RenderView when this message was generated. This is | |
132 // included so the host knows how large the view is from the perspective of | |
133 // the renderer process. This is necessary in case a resize operation is in | |
134 // progress. If auto-resize is enabled, this should update the corresponding | |
135 // view size. | |
136 IPC_STRUCT_MEMBER(gfx::Size, view_size) | |
137 | |
138 // All the above coordinates are in DIP. This is the scale factor needed | |
139 // to convert them to pixels. | |
140 IPC_STRUCT_MEMBER(float, scale_factor) | |
141 | |
142 // Is this UpdateRect an ACK to a resize request? | |
143 IPC_STRUCT_MEMBER(bool, is_resize_ack) | |
144 IPC_STRUCT_END() | |
145 | |
146 // When the user tabs to the end of the tab stops of a guest, the browser | |
147 // process informs the embedder to tab out of the browser plugin. | |
148 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_AdvanceFocus, | |
149 int /* instance_id */, | |
150 bool /* reverse */) | |
151 | |
152 // The guest has damage it wants to convey to the embedder so that it can | |
153 // update its backing store. | |
154 IPC_MESSAGE_CONTROL3(BrowserPluginMsg_UpdateRect, | |
155 int /* instance_id */, | |
156 int /* message_id */, | |
157 BrowserPluginMsg_UpdateRect_Params) | |
OLD | NEW |