Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: content/common/browser_plugin_messages.h

Issue 11361052: Browser Plugin: Implement autosize (Embedder-side code) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: BrowserPluginHostMsg_AutoSize_Params had an int instead of bool for enable: fixed Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Multiply-included message header, no traditional include guard. 5 // Multiply-included message header, no traditional include guard.
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/process.h" 10 #include "base/process.h"
(...skipping 11 matching lines...) Expand all
22 #include "webkit/glue/webcursor.h" 22 #include "webkit/glue/webcursor.h"
23 #include "webkit/glue/webdropdata.h" 23 #include "webkit/glue/webdropdata.h"
24 24
25 #undef IPC_MESSAGE_EXPORT 25 #undef IPC_MESSAGE_EXPORT
26 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT 26 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT
27 27
28 #define IPC_MESSAGE_START BrowserPluginMsgStart 28 #define IPC_MESSAGE_START BrowserPluginMsgStart
29 29
30 IPC_ENUM_TRAITS(WebKit::WebDragStatus) 30 IPC_ENUM_TRAITS(WebKit::WebDragStatus)
31 31
32 IPC_STRUCT_BEGIN(BrowserPluginHostMsg_AutoSize_Params)
33 IPC_STRUCT_MEMBER(bool, enable)
34 IPC_STRUCT_MEMBER(int, max_height)
35 IPC_STRUCT_MEMBER(int, max_width)
36 IPC_STRUCT_MEMBER(int, min_height)
37 IPC_STRUCT_MEMBER(int, min_width)
38 IPC_STRUCT_END()
39
40 IPC_STRUCT_BEGIN(BrowserPluginHostMsg_CreateGuest_Params)
41 IPC_STRUCT_MEMBER(std::string, storage_partition_id)
42 IPC_STRUCT_MEMBER(bool, persist_storage)
43 IPC_STRUCT_MEMBER(bool, focused)
44 IPC_STRUCT_MEMBER(bool, visible)
45 IPC_STRUCT_MEMBER(BrowserPluginHostMsg_AutoSize_Params, auto_size)
46 IPC_STRUCT_END()
47
48 IPC_STRUCT_BEGIN(BrowserPluginHostMsg_ResizeGuest_Params)
49 // An identifier to the new buffer to use to transport damage to the embedder
50 // renderer process.
51 IPC_STRUCT_MEMBER(TransportDIB::Id, damage_buffer_id)
52 #if defined(OS_MACOSX)
53 // On OSX, a handle to the new buffer is used to map the transport dib since
54 // we don't let browser manage the dib.
55 IPC_STRUCT_MEMBER(TransportDIB::Handle, damage_buffer_handle)
56 #endif
57 #if defined(OS_WIN)
58 // The size of the damage buffer because this information is not available
59 // on Windows.
60 IPC_STRUCT_MEMBER(int, damage_buffer_size)
61 #endif
62 // The new width of the plugin container.
63 IPC_STRUCT_MEMBER(int, width)
64 // The new height of the plugin container.
65 IPC_STRUCT_MEMBER(int, height)
66 // Indicates whether the embedder is currently waiting on a ACK from the
67 // guest for a previous resize request.
68 IPC_STRUCT_MEMBER(bool, resize_pending)
69 // Indicates the scale factor of the embedder WebView.
70 IPC_STRUCT_MEMBER(float, scale_factor)
71 IPC_STRUCT_END()
72
73 IPC_STRUCT_BEGIN(BrowserPluginMsg_LoadCommit_Params)
74 // The current URL of the guest.
75 IPC_STRUCT_MEMBER(GURL, url)
76 // Indicates whether the navigation was on the top-level frame.
77 IPC_STRUCT_MEMBER(bool, is_top_level)
78 // Chrome's process ID for the guest.
79 IPC_STRUCT_MEMBER(int, process_id)
80 // The index of the current navigation entry after this navigation was
81 // committed.
82 IPC_STRUCT_MEMBER(int, current_entry_index)
83 // The number of navigation entries after this navigation was committed.
84 IPC_STRUCT_MEMBER(int, entry_count)
85 IPC_STRUCT_END()
86
87 IPC_STRUCT_BEGIN(BrowserPluginMsg_UpdateRect_Params)
88 // The position and size of the bitmap.
89 IPC_STRUCT_MEMBER(gfx::Rect, bitmap_rect)
90
91 // The scroll offset. Only one of these can be non-zero, and if they are
92 // both zero, then it means there is no scrolling and the scroll_rect is
93 // ignored.
94 IPC_STRUCT_MEMBER(int, dx)
95 IPC_STRUCT_MEMBER(int, dy)
96
97 // The rectangular region to scroll.
98 IPC_STRUCT_MEMBER(gfx::Rect, scroll_rect)
99
100 // The scroll offset of the render view.
101 IPC_STRUCT_MEMBER(gfx::Point, scroll_offset)
102
103 // The regions of the bitmap (in view coords) that contain updated pixels.
104 // In the case of scrolling, this includes the scroll damage rect.
105 IPC_STRUCT_MEMBER(std::vector<gfx::Rect>, copy_rects)
106
107 // The size of the RenderView when this message was generated. This is
108 // included so the host knows how large the view is from the perspective of
109 // the renderer process. This is necessary in case a resize operation is in
110 // progress. If auto-resize is enabled, this should update the corresponding
111 // view size.
112 IPC_STRUCT_MEMBER(gfx::Size, view_size)
113
114 // All the above coordinates are in DIP. This is the scale factor needed
115 // to convert them to pixels.
116 IPC_STRUCT_MEMBER(float, scale_factor)
117
118 // Is this UpdateRect an ACK to a resize request?
119 IPC_STRUCT_MEMBER(bool, is_resize_ack)
120 IPC_STRUCT_END()
121
32 // Browser plugin messages 122 // Browser plugin messages
33 123
34 // ----------------------------------------------------------------------------- 124 // -----------------------------------------------------------------------------
35 // These messages are from the embedder to the browser process. 125 // These messages are from the embedder to the browser process.
36 126
127 // This message is sent to the browser process to enable or disable autosize
128 // mode.
129 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_SetAutoSize,
130 int /* instance_id */,
131 BrowserPluginHostMsg_AutoSize_Params)
132
133
37 // This message is sent to the browser process to create the browser plugin 134 // This message is sent to the browser process to create the browser plugin
38 // embedder and helper. It is sent once prior to sending the first 135 // embedder and helper. It is sent once prior to sending the first
39 // BrowserPluginHostMsg_NavigateGuest message. 136 // BrowserPluginHostMsg_NavigateGuest message.
40 IPC_MESSAGE_ROUTED5(BrowserPluginHostMsg_CreateGuest, 137 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_CreateGuest,
41 int /* instance_id */, 138 int /* instance_id */,
42 std::string /* storage_partition_id */, 139 BrowserPluginHostMsg_CreateGuest_Params /* params */)
43 bool /* persist_storage */,
44 bool /* focused */,
45 bool /* visible */)
46 140
47 // Tells the browser process to terminate the guest associated with the 141 // Tells the browser process to terminate the guest associated with the
48 // browser plugin associated with the provided |instance_id|. 142 // browser plugin associated with the provided |instance_id|.
49 IPC_MESSAGE_ROUTED1(BrowserPluginHostMsg_TerminateGuest, 143 IPC_MESSAGE_ROUTED1(BrowserPluginHostMsg_TerminateGuest,
50 int /* instance_id */) 144 int /* instance_id */)
51 145
52 // Tells the guest to navigate to an entry |relative_index| away from the 146 // Tells the guest to navigate to an entry |relative_index| away from the
53 // current navigation entry. 147 // current navigation entry.
54 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_Go, 148 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_Go,
55 int /* instance_id */, 149 int /* instance_id */,
(...skipping 22 matching lines...) Expand all
78 172
79 // An ACK to the guest process letting it know that the embedder has handled 173 // An ACK to the guest process letting it know that the embedder has handled
80 // the previous frame and is ready for the next frame. If the guest sent the 174 // the previous frame and is ready for the next frame. If the guest sent the
81 // embedder a bitmap that does not match the size of the BrowserPlugin's 175 // embedder a bitmap that does not match the size of the BrowserPlugin's
82 // container, the BrowserPlugin requests a new size as well. 176 // container, the BrowserPlugin requests a new size as well.
83 IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_UpdateRect_ACK, 177 IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_UpdateRect_ACK,
84 int /* instance_id */, 178 int /* instance_id */,
85 int /* message_id */, 179 int /* message_id */,
86 gfx::Size /* repaint_view_size */) 180 gfx::Size /* repaint_view_size */)
87 181
88 IPC_STRUCT_BEGIN(BrowserPluginHostMsg_ResizeGuest_Params)
89 // An identifier to the new buffer to use to transport damage to the embedder
90 // renderer process.
91 IPC_STRUCT_MEMBER(TransportDIB::Id, damage_buffer_id)
92 #if defined(OS_MACOSX)
93 // On OSX, a handle to the new buffer is used to map the transport dib since
94 // we don't let browser manage the dib.
95 IPC_STRUCT_MEMBER(TransportDIB::Handle, damage_buffer_handle)
96 #endif
97 #if defined(OS_WIN)
98 // The size of the damage buffer because this information is not available
99 // on Windows.
100 IPC_STRUCT_MEMBER(int, damage_buffer_size)
101 #endif
102 // The new width of the plugin container.
103 IPC_STRUCT_MEMBER(int, width)
104 // The new height of the plugin container.
105 IPC_STRUCT_MEMBER(int, height)
106 // Indicates whether the embedder is currently waiting on a ACK from the
107 // guest for a previous resize request.
108 IPC_STRUCT_MEMBER(bool, resize_pending)
109 // Indicates the scale factor of the embedder WebView.
110 IPC_STRUCT_MEMBER(float, scale_factor)
111 IPC_STRUCT_END()
112
113 // A BrowserPlugin sends this to BrowserPluginEmbedder (browser process) when it 182 // A BrowserPlugin sends this to BrowserPluginEmbedder (browser process) when it
114 // wants to navigate to a given src URL. If a guest WebContents already exists, 183 // wants to navigate to a given src URL. If a guest WebContents already exists,
115 // it will navigate that WebContents. If not, it will create the WebContents, 184 // it will navigate that WebContents. If not, it will create the WebContents,
116 // associate it with the BrowserPluginGuest, and navigate it to the requested 185 // associate it with the BrowserPluginGuest, and navigate it to the requested
117 // URL. 186 // URL.
118 IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_NavigateGuest, 187 IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_NavigateGuest,
119 int /* instance_id*/, 188 int /* instance_id*/,
120 std::string /* src */, 189 std::string /* src */,
121 BrowserPluginHostMsg_ResizeGuest_Params /* resize_params */) 190 BrowserPluginHostMsg_ResizeGuest_Params /* resize_params */)
122 191
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 std::string /* type */) 244 std::string /* type */)
176 245
177 // When the guest redirects a navigation, the browser process informs the 246 // When the guest redirects a navigation, the browser process informs the
178 // embedder through the BrowserPluginMsg_LoadRedirect message. 247 // embedder through the BrowserPluginMsg_LoadRedirect message.
179 IPC_MESSAGE_CONTROL4(BrowserPluginMsg_LoadRedirect, 248 IPC_MESSAGE_CONTROL4(BrowserPluginMsg_LoadRedirect,
180 int /* instance_id */, 249 int /* instance_id */,
181 GURL /* old_url */, 250 GURL /* old_url */,
182 GURL /* new_url */, 251 GURL /* new_url */,
183 bool /* is_top_level */) 252 bool /* is_top_level */)
184 253
185 IPC_STRUCT_BEGIN(BrowserPluginMsg_LoadCommit_Params)
186 // The current URL of the guest.
187 IPC_STRUCT_MEMBER(GURL, url)
188 // Indicates whether the navigation was on the top-level frame.
189 IPC_STRUCT_MEMBER(bool, is_top_level)
190 // Chrome's process ID for the guest.
191 IPC_STRUCT_MEMBER(int, process_id)
192 // The index of the current navigation entry after this navigation was
193 // committed.
194 IPC_STRUCT_MEMBER(int, current_entry_index)
195 // The number of navigation entries after this navigation was committed.
196 IPC_STRUCT_MEMBER(int, entry_count)
197 IPC_STRUCT_END()
198
199 // When the guest commits a navigation, the browser process informs 254 // When the guest commits a navigation, the browser process informs
200 // the embedder through the BrowserPluginMsg_DidCommit message. 255 // the embedder through the BrowserPluginMsg_DidCommit message.
201 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_LoadCommit, 256 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_LoadCommit,
202 int /* instance_id */, 257 int /* instance_id */,
203 BrowserPluginMsg_LoadCommit_Params) 258 BrowserPluginMsg_LoadCommit_Params)
204 259
205 // When the guest page has completed loading (including subframes), the browser 260 // When the guest page has completed loading (including subframes), the browser
206 // process informs the embedder through the BrowserPluginMsg_LoadStop message. 261 // process informs the embedder through the BrowserPluginMsg_LoadStop message.
207 IPC_MESSAGE_CONTROL1(BrowserPluginMsg_LoadStop, 262 IPC_MESSAGE_CONTROL1(BrowserPluginMsg_LoadStop,
208 int /* instance_id */) 263 int /* instance_id */)
209 264
210 // When the guest crashes, the browser process informs the embedder through this 265 // When the guest crashes, the browser process informs the embedder through this
211 // message. 266 // message.
212 IPC_MESSAGE_CONTROL3(BrowserPluginMsg_GuestGone, 267 IPC_MESSAGE_CONTROL3(BrowserPluginMsg_GuestGone,
213 int /* instance_id */, 268 int /* instance_id */,
214 int /* process_id */, 269 int /* process_id */,
215 int /* This is really base::TerminationStatus */) 270 int /* This is really base::TerminationStatus */)
216 271
217 IPC_STRUCT_BEGIN(BrowserPluginMsg_UpdateRect_Params)
218 // The position and size of the bitmap.
219 IPC_STRUCT_MEMBER(gfx::Rect, bitmap_rect)
220
221 // The scroll offset. Only one of these can be non-zero, and if they are
222 // both zero, then it means there is no scrolling and the scroll_rect is
223 // ignored.
224 IPC_STRUCT_MEMBER(int, dx)
225 IPC_STRUCT_MEMBER(int, dy)
226
227 // The rectangular region to scroll.
228 IPC_STRUCT_MEMBER(gfx::Rect, scroll_rect)
229
230 // The scroll offset of the render view.
231 IPC_STRUCT_MEMBER(gfx::Vector2d, scroll_offset)
232
233 // The regions of the bitmap (in view coords) that contain updated pixels.
234 // In the case of scrolling, this includes the scroll damage rect.
235 IPC_STRUCT_MEMBER(std::vector<gfx::Rect>, copy_rects)
236
237 // The size of the RenderView when this message was generated. This is
238 // included so the host knows how large the view is from the perspective of
239 // the renderer process. This is necessary in case a resize operation is in
240 // progress. If auto-resize is enabled, this should update the corresponding
241 // view size.
242 IPC_STRUCT_MEMBER(gfx::Size, view_size)
243
244 // All the above coordinates are in DIP. This is the scale factor needed
245 // to convert them to pixels.
246 IPC_STRUCT_MEMBER(float, scale_factor)
247
248 // Is this UpdateRect an ACK to a resize request?
249 IPC_STRUCT_MEMBER(bool, is_resize_ack)
250 IPC_STRUCT_END()
251
252 // When the user tabs to the end of the tab stops of a guest, the browser 272 // When the user tabs to the end of the tab stops of a guest, the browser
253 // process informs the embedder to tab out of the browser plugin. 273 // process informs the embedder to tab out of the browser plugin.
254 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_AdvanceFocus, 274 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_AdvanceFocus,
255 int /* instance_id */, 275 int /* instance_id */,
256 bool /* reverse */) 276 bool /* reverse */)
257 277
258 // When the guest starts/stops listening to touch events, it needs to notify the 278 // When the guest starts/stops listening to touch events, it needs to notify the
259 // plugin in the embedder about it. 279 // plugin in the embedder about it.
260 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_ShouldAcceptTouchEvents, 280 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_ShouldAcceptTouchEvents,
261 int /* instance_id */, 281 int /* instance_id */,
262 bool /* accept */) 282 bool /* accept */)
263 283
264 // The guest has damage it wants to convey to the embedder so that it can 284 // The guest has damage it wants to convey to the embedder so that it can
265 // update its backing store. 285 // update its backing store.
266 IPC_MESSAGE_CONTROL3(BrowserPluginMsg_UpdateRect, 286 IPC_MESSAGE_CONTROL3(BrowserPluginMsg_UpdateRect,
267 int /* instance_id */, 287 int /* instance_id */,
268 int /* message_id */, 288 int /* message_id */,
269 BrowserPluginMsg_UpdateRect_Params) 289 BrowserPluginMsg_UpdateRect_Params)
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/renderer/browser_plugin/browser_plugin.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698