Chromium Code Reviews| 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/process.h" | 10 #include "base/process.h" |
| 11 #include "content/common/browser_plugin_info.h" | |
| 11 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 12 #include "content/public/common/common_param_traits.h" | 13 #include "content/public/common/common_param_traits.h" |
| 13 #include "ipc/ipc_channel_handle.h" | 14 #include "ipc/ipc_channel_handle.h" |
| 14 #include "ipc/ipc_message_macros.h" | 15 #include "ipc/ipc_message_macros.h" |
| 15 #include "ipc/ipc_message_utils.h" | 16 #include "ipc/ipc_message_utils.h" |
| 16 #include "ui/gfx/rect.h" | 17 #include "ui/gfx/rect.h" |
| 17 #include "ui/gfx/size.h" | 18 #include "ui/gfx/size.h" |
| 18 #include "webkit/glue/webcursor.h" | 19 #include "webkit/glue/webcursor.h" |
| 19 | 20 |
| 20 #undef IPC_MESSAGE_EXPORT | 21 #undef IPC_MESSAGE_EXPORT |
| 21 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 22 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
| 22 | 23 |
| 23 #define IPC_MESSAGE_START BrowserPluginMsgStart | 24 #define IPC_MESSAGE_START BrowserPluginMsgStart |
| 24 | 25 |
| 25 // Browser plugin messages | 26 // Browser plugin messages |
| 26 | 27 |
| 27 // ----------------------------------------------------------------------------- | 28 // ----------------------------------------------------------------------------- |
| 28 // These messages are from the embedder to the browser process. | 29 // These messages are from the embedder to the browser process. |
| 29 | 30 |
| 31 IPC_STRUCT_TRAITS_BEGIN(BrowserPluginHostMsg_Surface_Params) | |
| 32 IPC_STRUCT_TRAITS_MEMBER(gpu_process_id) | |
| 33 IPC_STRUCT_TRAITS_MEMBER(client_id) | |
| 34 IPC_STRUCT_TRAITS_MEMBER(context_id) | |
| 35 IPC_STRUCT_TRAITS_MEMBER(texture_id[0]) | |
| 36 IPC_STRUCT_TRAITS_MEMBER(texture_id[1]) | |
| 37 IPC_STRUCT_TRAITS_MEMBER(sync_point) | |
| 38 IPC_STRUCT_TRAITS_END() | |
| 39 | |
| 40 IPC_STRUCT_TRAITS_BEGIN(BrowserPlugin_SwapInfo) | |
| 41 IPC_STRUCT_TRAITS_MEMBER(route_id) | |
| 42 IPC_STRUCT_TRAITS_MEMBER(gpu_host_id) | |
| 43 IPC_STRUCT_TRAITS_END() | |
| 44 | |
| 30 // Tells the guest to focus or defocus itself. | 45 // Tells the guest to focus or defocus itself. |
| 31 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_SetFocus, | 46 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_SetFocus, |
| 32 int /* instance_id */, | 47 int /* instance_id */, |
| 33 bool /* enable */) | 48 bool /* enable */) |
| 34 | 49 |
| 35 // Message payload includes: | 50 // Message payload includes: |
| 36 // 1. A blob that should be cast to WebInputEvent | 51 // 1. A blob that should be cast to WebInputEvent |
| 37 // 2. An optional boolean value indicating if a RawKeyDown event is associated | 52 // 2. An optional boolean value indicating if a RawKeyDown event is associated |
| 38 // to a keyboard shortcut of the browser. | 53 // to a keyboard shortcut of the browser. |
| 39 IPC_SYNC_MESSAGE_ROUTED0_2(BrowserPluginHostMsg_HandleInputEvent, | 54 IPC_SYNC_MESSAGE_ROUTED0_2(BrowserPluginHostMsg_HandleInputEvent, |
| 40 bool /* handled */, | 55 bool /* handled */, |
| 41 WebCursor /* cursor */) | 56 WebCursor /* cursor */) |
| 42 | 57 |
| 43 // An ACK to the guest process letting it know that the embedder has handled | 58 // 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 | 59 // 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 | 60 // embedder a bitmap that does not match the size of the BrowserPlugin's |
| 46 // container, the BrowserPlugin requests a new size as well. | 61 // container, the BrowserPlugin requests a new size as well. |
| 47 IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_UpdateRect_ACK, | 62 IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_UpdateRect_ACK, |
| 48 int /* instance_id */, | 63 int /* instance_id */, |
| 49 int /* message_id */, | 64 int /* message_id */, |
| 50 gfx::Size /* repaint_view_size */) | 65 gfx::Size /* repaint_view_size */) |
| 51 | 66 |
| 52 // A BrowserPlugin sends this to the browser process when it wants to navigate | 67 // 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 | 68 // 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 | 69 // that WebContents. If not, it will create the WebContents, associate it with |
| 55 // the BrowserPlugin's browser-side BrowserPluginHost as a guest, and navigate | 70 // the BrowserPlugin's browser-side BrowserPluginHost as a guest, and navigate |
| 56 // it to the requested URL. | 71 // it to the requested URL. |
| 57 IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_NavigateOrCreateGuest, | 72 IPC_MESSAGE_ROUTED4(BrowserPluginHostMsg_NavigateOrCreateGuest, |
| 58 int /* instance_id*/, | 73 int /* instance_id*/, |
| 59 long long /* frame_id */, | 74 long long /* frame_id */, |
| 60 std::string /* src */) | 75 std::string /* src */, |
| 76 BrowserPluginHostMsg_Surface_Params /* surface params */) | |
|
scshunt
2012/08/12 01:42:45
Do we need to send surface parameters with every g
scshunt
2012/08/17 17:30:28
A: Yes we do, since we want a new surface for cros
| |
| 77 | |
| 78 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_BuffersSwappedACK, | |
| 79 BrowserPlugin_SwapInfo /* info */, | |
| 80 uint32 /* sync_point */) | |
| 61 | 81 |
| 62 // When a BrowserPlugin has been removed from the embedder's DOM, it informs | 82 // When a BrowserPlugin has been removed from the embedder's DOM, it informs |
| 63 // the browser process to cleanup the guest. | 83 // the browser process to cleanup the guest. |
| 64 IPC_MESSAGE_ROUTED1(BrowserPluginHostMsg_PluginDestroyed, | 84 IPC_MESSAGE_ROUTED1(BrowserPluginHostMsg_PluginDestroyed, |
| 65 int /* instance_id */) | 85 int /* instance_id */) |
| 66 | 86 |
| 67 // ----------------------------------------------------------------------------- | 87 // ----------------------------------------------------------------------------- |
| 68 // These messages are from the guest renderer to the browser process | 88 // These messages are from the guest renderer to the browser process |
| 69 | 89 |
| 70 IPC_STRUCT_BEGIN(BrowserPluginHostMsg_ResizeGuest_Params) | 90 IPC_STRUCT_BEGIN(BrowserPluginHostMsg_ResizeGuest_Params) |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 129 // progress. If auto-resize is enabled, this should update the corresponding | 149 // progress. If auto-resize is enabled, this should update the corresponding |
| 130 // view size. | 150 // view size. |
| 131 IPC_STRUCT_MEMBER(gfx::Size, view_size) | 151 IPC_STRUCT_MEMBER(gfx::Size, view_size) |
| 132 | 152 |
| 133 // All the above coordinates are in DIP. This is the scale factor needed | 153 // All the above coordinates are in DIP. This is the scale factor needed |
| 134 // to convert them to pixels. | 154 // to convert them to pixels. |
| 135 IPC_STRUCT_MEMBER(float, scale_factor) | 155 IPC_STRUCT_MEMBER(float, scale_factor) |
| 136 | 156 |
| 137 // Is this UpdateRect an ACK to a resize request? | 157 // Is this UpdateRect an ACK to a resize request? |
| 138 IPC_STRUCT_MEMBER(bool, is_resize_ack) | 158 IPC_STRUCT_MEMBER(bool, is_resize_ack) |
| 159 | |
| 160 // Do we need to reply to it | |
| 161 IPC_STRUCT_MEMBER(bool, needs_ack) | |
| 139 IPC_STRUCT_END() | 162 IPC_STRUCT_END() |
| 140 | 163 |
| 141 // When the user tabs to the end of the tab stops of a guest, the browser | 164 // 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. | 165 // process informs the embedder to tab out of the browser plugin. |
| 143 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_AdvanceFocus, | 166 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_AdvanceFocus, |
| 144 int /* instance_id */, | 167 int /* instance_id */, |
| 145 bool /* reverse */) | 168 bool /* reverse */) |
| 146 | 169 |
| 170 IPC_MESSAGE_CONTROL3(BrowserPluginMsg_BuffersSwapped, | |
| 171 int /* instance_id */, | |
| 172 uint64 /* surface_handle */, | |
| 173 BrowserPlugin_SwapInfo /* info */) | |
| 174 | |
| 175 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_SurfaceResize, | |
| 176 int /* instance_id */, | |
| 177 gfx::Size /* size */) | |
| 178 | |
| 147 // The guest has damage it wants to convey to the embedder so that it can | 179 // The guest has damage it wants to convey to the embedder so that it can |
| 148 // update its backing store. | 180 // update its backing store. |
| 149 IPC_MESSAGE_CONTROL3(BrowserPluginMsg_UpdateRect, | 181 IPC_MESSAGE_CONTROL3(BrowserPluginMsg_UpdateRect, |
| 150 int /* instance_id */, | 182 int /* instance_id */, |
| 151 int /* message_id */, | 183 int /* message_id */, |
| 152 BrowserPluginMsg_UpdateRect_Params) | 184 BrowserPluginMsg_UpdateRect_Params) |
| OLD | NEW |