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 // Tells the guest to focus or defocus itself. | |
31 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_SetFocus, | |
32 int /* instance_id */, | |
33 bool /* enable */) | |
34 | |
35 // Message payload includes: | |
36 // 1. A blob that should be cast to WebInputEvent | |
37 // 2. An optional boolean value indicating if a RawKeyDown event is associated | |
38 // to a keyboard shortcut of the browser. | |
39 IPC_SYNC_MESSAGE_ROUTED0_2(BrowserPluginHostMsg_HandleInputEvent, | |
40 bool /* handled */, | |
41 WebCursor /* cursor */) | |
42 | |
43 // An ACK to the guest process letting it know that the embedder has handled | |
44 // the previous frame and is ready for the next frame. If the guest sent the | |
45 // embedder a bitmap that does not match the size of the BrowserPlugin's | |
46 // container, the BrowserPlugin requests a new size as well. | |
47 IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_UpdateRect_ACK, | |
48 int /* instance_id */, | |
49 int /* message_id */, | |
50 gfx::Size /* repaint_view_size */) | |
51 | |
52 // A BrowserPlugin sends this to the browser process when it wants to navigate | |
53 // to a given src URL. If a guest WebContents already exists, it will navigate | |
54 // that WebContents. If not, it will create the WebContents, associate it with | |
55 // the BrowserPlugin's browser-side BrowserPluginHost as a guest, and navigate | |
56 // it to the requested URL. | |
57 IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_NavigateOrCreateGuest, | |
58 int /* instance_id*/, | |
59 long long /* frame_id */, | |
60 std::string /* src */) | |
61 | |
62 // When a BrowserPlugin has been removed from the embedder's DOM, it informs | |
63 // the browser process to cleanup the guest. | |
64 IPC_MESSAGE_ROUTED1(BrowserPluginHostMsg_PluginDestroyed, | |
65 int /* instance_id */) | |
66 | |
67 // ----------------------------------------------------------------------------- | |
68 // These messages are from the guest renderer to the browser process | |
69 | |
70 IPC_STRUCT_BEGIN(BrowserPluginHostMsg_ResizeGuest_Params) | |
71 // A handle to the new buffer to use to transport damage to the | |
72 // embedder renderer process. | |
73 IPC_STRUCT_MEMBER(TransportDIB::Id, damage_buffer_id) | |
74 // The new width of the plugin container. | |
75 IPC_STRUCT_MEMBER(int, width) | |
76 // The new height of the plugin container. | |
77 IPC_STRUCT_MEMBER(int, height) | |
78 // Indicates whether the embedder is currently waiting on a ACK from the | |
79 // guest for a previous resize request. | |
80 IPC_STRUCT_MEMBER(bool, resize_pending) | |
81 // Indicates the scale factor of the embedder WebView. | |
82 IPC_STRUCT_MEMBER(float, scale_factor) | |
83 IPC_STRUCT_END() | |
84 | |
85 // A embedder sends this message to the browser when it wants | |
86 // to resize a guest plugin container so that the guest is relaid out | |
87 // according to the new size. | |
88 IPC_SYNC_MESSAGE_ROUTED2_0(BrowserPluginHostMsg_ResizeGuest, | |
89 int /* instance_id*/, | |
90 BrowserPluginHostMsg_ResizeGuest_Params) | |
91 | |
92 // ----------------------------------------------------------------------------- | |
93 // These messages are from the browser process to the embedder. | |
94 | |
95 // When the guest navigates, the browser process informs the embedder through | |
96 // the BrowserPluginMsg_DidNavigate message. | |
97 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_DidNavigate, | |
98 int /* instance_id */, | |
99 GURL /* url */) | |
100 | |
101 // When the guest crashes, the browser process informs the embedder through this | |
102 // message. | |
103 IPC_MESSAGE_CONTROL1(BrowserPluginMsg_GuestCrashed, | |
104 int /* instance_id */) | |
105 | |
106 IPC_STRUCT_BEGIN(BrowserPluginMsg_UpdateRect_Params) | |
107 // The position and size of the bitmap. | |
108 IPC_STRUCT_MEMBER(gfx::Rect, bitmap_rect) | |
109 | |
110 // The scroll offset. Only one of these can be non-zero, and if they are | |
111 // both zero, then it means there is no scrolling and the scroll_rect is | |
112 // ignored. | |
113 IPC_STRUCT_MEMBER(int, dx) | |
114 IPC_STRUCT_MEMBER(int, dy) | |
115 | |
116 // The rectangular region to scroll. | |
117 IPC_STRUCT_MEMBER(gfx::Rect, scroll_rect) | |
118 | |
119 // The scroll offset of the render view. | |
120 IPC_STRUCT_MEMBER(gfx::Point, scroll_offset) | |
121 | |
122 // The regions of the bitmap (in view coords) that contain updated pixels. | |
123 // In the case of scrolling, this includes the scroll damage rect. | |
124 IPC_STRUCT_MEMBER(std::vector<gfx::Rect>, copy_rects) | |
125 | |
126 // The size of the RenderView when this message was generated. This is | |
127 // included so the host knows how large the view is from the perspective of | |
128 // the renderer process. This is necessary in case a resize operation is in | |
129 // progress. If auto-resize is enabled, this should update the corresponding | |
130 // view size. | |
131 IPC_STRUCT_MEMBER(gfx::Size, view_size) | |
132 | |
133 // All the above coordinates are in DIP. This is the scale factor needed | |
134 // to convert them to pixels. | |
135 IPC_STRUCT_MEMBER(float, scale_factor) | |
136 | |
137 // Is this UpdateRect an ACK to a resize request? | |
138 IPC_STRUCT_MEMBER(bool, is_resize_ack) | |
139 IPC_STRUCT_END() | |
140 | |
141 // When the user tabs to the end of the tab stops of a guest, the browser | |
142 // process informs the embedder to tab out of the browser plugin. | |
143 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_AdvanceFocus, | |
144 int /* instance_id */, | |
145 bool /* reverse */) | |
146 | |
147 // The guest has damage it wants to convey to the embedder so that it can | |
148 // update its backing store. | |
149 IPC_MESSAGE_CONTROL3(BrowserPluginMsg_UpdateRect, | |
150 int /* instance_id */, | |
151 int /* message_id */, | |
152 BrowserPluginMsg_UpdateRect_Params) | |
OLD | NEW |