| OLD | NEW |
| 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/memory/shared_memory.h" | |
| 11 #include "base/process/process.h" | 10 #include "base/process/process.h" |
| 12 #include "base/values.h" | 11 #include "base/values.h" |
| 13 #include "cc/output/compositor_frame.h" | |
| 14 #include "cc/output/compositor_frame_ack.h" | |
| 15 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 16 #include "content/common/content_param_traits.h" | 13 #include "content/common/content_param_traits.h" |
| 17 #include "content/common/cursors/webcursor.h" | 14 #include "content/common/cursors/webcursor.h" |
| 18 #include "content/common/edit_command.h" | 15 #include "content/common/edit_command.h" |
| 19 #include "content/common/frame_param_macros.h" | 16 #include "content/common/frame_param_macros.h" |
| 20 #include "content/public/common/browser_plugin_permission_type.h" | 17 #include "content/public/common/browser_plugin_permission_type.h" |
| 21 #include "content/public/common/common_param_traits.h" | 18 #include "content/public/common/common_param_traits.h" |
| 22 #include "content/public/common/drop_data.h" | 19 #include "content/public/common/drop_data.h" |
| 23 #include "ipc/ipc_channel_handle.h" | 20 #include "ipc/ipc_channel_handle.h" |
| 24 #include "ipc/ipc_message_macros.h" | 21 #include "ipc/ipc_message_macros.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 42 | 39 |
| 43 IPC_STRUCT_BEGIN(BrowserPluginHostMsg_AutoSize_Params) | 40 IPC_STRUCT_BEGIN(BrowserPluginHostMsg_AutoSize_Params) |
| 44 IPC_STRUCT_MEMBER(bool, enable) | 41 IPC_STRUCT_MEMBER(bool, enable) |
| 45 IPC_STRUCT_MEMBER(gfx::Size, max_size) | 42 IPC_STRUCT_MEMBER(gfx::Size, max_size) |
| 46 IPC_STRUCT_MEMBER(gfx::Size, min_size) | 43 IPC_STRUCT_MEMBER(gfx::Size, min_size) |
| 47 IPC_STRUCT_END() | 44 IPC_STRUCT_END() |
| 48 | 45 |
| 49 IPC_STRUCT_BEGIN(BrowserPluginHostMsg_ResizeGuest_Params) | 46 IPC_STRUCT_BEGIN(BrowserPluginHostMsg_ResizeGuest_Params) |
| 50 // Indicates whether the parameters have been populated or not. | 47 // Indicates whether the parameters have been populated or not. |
| 51 IPC_STRUCT_MEMBER(bool, size_changed) | 48 IPC_STRUCT_MEMBER(bool, size_changed) |
| 52 // The sequence number used to uniquely identify the damage buffer for the | |
| 53 // current container size. | |
| 54 IPC_STRUCT_MEMBER(uint32, damage_buffer_sequence_id) | |
| 55 // The handle to use to map the damage buffer in the browser process. | |
| 56 IPC_STRUCT_MEMBER(base::SharedMemoryHandle, damage_buffer_handle) | |
| 57 // The size of the damage buffer. | |
| 58 IPC_STRUCT_MEMBER(size_t, damage_buffer_size) | |
| 59 // The new rect of the guest view area. | 49 // The new rect of the guest view area. |
| 60 IPC_STRUCT_MEMBER(gfx::Rect, view_rect) | 50 IPC_STRUCT_MEMBER(gfx::Rect, view_rect) |
| 61 // Indicates the scale factor of the embedder WebView. | 51 // Indicates the scale factor of the embedder WebView. |
| 62 IPC_STRUCT_MEMBER(float, scale_factor) | 52 IPC_STRUCT_MEMBER(float, scale_factor) |
| 63 // Indicates a request for a full repaint of the page. | 53 // Indicates a request for a full repaint of the page. |
| 64 // This is required for switching from compositing to the software | 54 // This is required for switching from compositing to the software |
| 65 // rendering path. | 55 // rendering path. |
| 66 IPC_STRUCT_MEMBER(bool, repaint) | 56 IPC_STRUCT_MEMBER(bool, repaint) |
| 67 IPC_STRUCT_END() | 57 IPC_STRUCT_END() |
| 68 | 58 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 80 resize_guest_params) | 70 resize_guest_params) |
| 81 IPC_STRUCT_END() | 71 IPC_STRUCT_END() |
| 82 | 72 |
| 83 IPC_STRUCT_BEGIN(BrowserPluginMsg_Attach_ACK_Params) | 73 IPC_STRUCT_BEGIN(BrowserPluginMsg_Attach_ACK_Params) |
| 84 IPC_STRUCT_MEMBER(std::string, storage_partition_id) | 74 IPC_STRUCT_MEMBER(std::string, storage_partition_id) |
| 85 IPC_STRUCT_MEMBER(bool, persist_storage) | 75 IPC_STRUCT_MEMBER(bool, persist_storage) |
| 86 IPC_STRUCT_MEMBER(std::string, name) | 76 IPC_STRUCT_MEMBER(std::string, name) |
| 87 IPC_STRUCT_END() | 77 IPC_STRUCT_END() |
| 88 | 78 |
| 89 IPC_STRUCT_BEGIN(BrowserPluginMsg_UpdateRect_Params) | 79 IPC_STRUCT_BEGIN(BrowserPluginMsg_UpdateRect_Params) |
| 90 // The sequence number of the damage buffer used by the browser process. | |
| 91 IPC_STRUCT_MEMBER(uint32, damage_buffer_sequence_id) | |
| 92 | |
| 93 // The position and size of the bitmap. | |
| 94 IPC_STRUCT_MEMBER(gfx::Rect, bitmap_rect) | |
| 95 | |
| 96 // The scroll delta. Only one of the delta components can be non-zero, and if | |
| 97 // they are both zero, then it means there is no scrolling and the scroll_rect | |
| 98 // is ignored. | |
| 99 IPC_STRUCT_MEMBER(gfx::Vector2d, scroll_delta) | |
| 100 | |
| 101 // The rectangular region to scroll. | |
| 102 IPC_STRUCT_MEMBER(gfx::Rect, scroll_rect) | |
| 103 | |
| 104 // The scroll offset of the render view. | |
| 105 IPC_STRUCT_MEMBER(gfx::Point, scroll_offset) | |
| 106 | |
| 107 // The regions of the bitmap (in view coords) that contain updated pixels. | |
| 108 // In the case of scrolling, this includes the scroll damage rect. | |
| 109 IPC_STRUCT_MEMBER(std::vector<gfx::Rect>, copy_rects) | |
| 110 | |
| 111 // The size of the RenderView when this message was generated. This is | 80 // The size of the RenderView when this message was generated. This is |
| 112 // included so the host knows how large the view is from the perspective of | 81 // included so the host knows how large the view is from the perspective of |
| 113 // the renderer process. This is necessary in case a resize operation is in | 82 // the renderer process. This is necessary in case a resize operation is in |
| 114 // progress. If auto-resize is enabled, this should update the corresponding | 83 // progress. If auto-resize is enabled, this should update the corresponding |
| 115 // view size. | 84 // view size. |
| 116 IPC_STRUCT_MEMBER(gfx::Size, view_size) | 85 IPC_STRUCT_MEMBER(gfx::Size, view_size) |
| 117 | 86 |
| 118 // All the above coordinates are in DIP. This is the scale factor needed | 87 // All the above coordinates are in DIP. This is the scale factor needed |
| 119 // to convert them to pixels. | 88 // to convert them to pixels. |
| 120 IPC_STRUCT_MEMBER(float, scale_factor) | 89 IPC_STRUCT_MEMBER(float, scale_factor) |
| 121 | 90 |
| 122 // Is this UpdateRect an ACK to a resize request? | 91 // Is this UpdateRect an ACK to a resize request? |
| 123 IPC_STRUCT_MEMBER(bool, is_resize_ack) | 92 IPC_STRUCT_MEMBER(bool, is_resize_ack) |
| 124 | |
| 125 // Used in HW accelerated case to switch between sending an UpdateRect_ACK | |
| 126 // with the new size or just resizing. | |
| 127 IPC_STRUCT_MEMBER(bool, needs_ack) | |
| 128 IPC_STRUCT_END() | 93 IPC_STRUCT_END() |
| 129 | 94 |
| 130 // Browser plugin messages | 95 // Browser plugin messages |
| 131 | 96 |
| 132 // ----------------------------------------------------------------------------- | 97 // ----------------------------------------------------------------------------- |
| 133 // These messages are from the embedder to the browser process. | 98 // These messages are from the embedder to the browser process. |
| 134 | 99 |
| 135 // This message is sent to the browser process to request an instance ID. | 100 // This message is sent to the browser process to request an instance ID. |
| 136 // |request_id| is used by BrowserPluginEmbedder to route the response back | 101 // |request_id| is used by BrowserPluginEmbedder to route the response back |
| 137 // to its origin. | 102 // to its origin. |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_SetFocus, | 160 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_SetFocus, |
| 196 int /* instance_id */, | 161 int /* instance_id */, |
| 197 bool /* enable */) | 162 bool /* enable */) |
| 198 | 163 |
| 199 // Sends an input event to the guest. | 164 // Sends an input event to the guest. |
| 200 IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_HandleInputEvent, | 165 IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_HandleInputEvent, |
| 201 int /* instance_id */, | 166 int /* instance_id */, |
| 202 gfx::Rect /* guest_window_rect */, | 167 gfx::Rect /* guest_window_rect */, |
| 203 IPC::WebInputEventPointer /* event */) | 168 IPC::WebInputEventPointer /* event */) |
| 204 | 169 |
| 205 // An ACK to the guest process letting it know that the embedder has handled | |
| 206 // the previous frame and is ready for the next frame. If the guest sent the | |
| 207 // embedder a bitmap that does not match the size of the BrowserPlugin's | |
| 208 // container, the BrowserPlugin requests a new size as well. | |
| 209 IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_UpdateRect_ACK, | |
| 210 int /* instance_id */, | |
| 211 BrowserPluginHostMsg_AutoSize_Params /* auto_size_params */, | |
| 212 BrowserPluginHostMsg_ResizeGuest_Params /* resize_guest_params */) | |
| 213 | |
| 214 // A BrowserPlugin sends this to BrowserPluginEmbedder (browser process) when it | 170 // A BrowserPlugin sends this to BrowserPluginEmbedder (browser process) when it |
| 215 // wants to navigate to a given src URL. If a guest WebContents already exists, | 171 // wants to navigate to a given src URL. If a guest WebContents already exists, |
| 216 // it will navigate that WebContents. If not, it will create the WebContents, | 172 // it will navigate that WebContents. If not, it will create the WebContents, |
| 217 // associate it with the BrowserPluginGuest, and navigate it to the requested | 173 // associate it with the BrowserPluginGuest, and navigate it to the requested |
| 218 // URL. | 174 // URL. |
| 219 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_NavigateGuest, | 175 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_NavigateGuest, |
| 220 int /* instance_id*/, | 176 int /* instance_id*/, |
| 221 std::string /* src */) | 177 std::string /* src */) |
| 222 | 178 |
| 223 IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_CopyFromCompositingSurfaceAck, | 179 IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_CopyFromCompositingSurfaceAck, |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 // See comment about BrowserPluginMsg_BuffersSwapped and | 321 // See comment about BrowserPluginMsg_BuffersSwapped and |
| 366 // BrowserPluginMsg_CompositorFrameSwapped for how these related | 322 // BrowserPluginMsg_CompositorFrameSwapped for how these related |
| 367 // to the FrameHostMsg variants. | 323 // to the FrameHostMsg variants. |
| 368 IPC_MESSAGE_ROUTED1(BrowserPluginHostMsg_BuffersSwappedACK, | 324 IPC_MESSAGE_ROUTED1(BrowserPluginHostMsg_BuffersSwappedACK, |
| 369 FrameHostMsg_BuffersSwappedACK_Params /* params */) | 325 FrameHostMsg_BuffersSwappedACK_Params /* params */) |
| 370 | 326 |
| 371 // Acknowledge that we presented an ubercomp frame. | 327 // Acknowledge that we presented an ubercomp frame. |
| 372 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_CompositorFrameSwappedACK, | 328 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_CompositorFrameSwappedACK, |
| 373 int /* instance_id */, | 329 int /* instance_id */, |
| 374 FrameHostMsg_CompositorFrameSwappedACK_Params /* params */) | 330 FrameHostMsg_CompositorFrameSwappedACK_Params /* params */) |
| OLD | NEW |