browser_plugin_messages.h revision eb525c5499e34cc9c4b825d6d9e75bb07cc06ace
15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Multiply-included message header, no traditional include guard.
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <string>
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/basictypes.h"
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/process.h"
112a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "base/shared_memory.h"
122a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "base/values.h"
13c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)#include "cc/output/compositor_frame.h"
14c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)#include "cc/output/compositor_frame_ack.h"
152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "content/common/browser_plugin/browser_plugin_message_enums.h"
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "content/common/content_export.h"
175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "content/common/content_param_traits.h"
18868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)#include "content/common/edit_command.h"
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "content/public/common/common_param_traits.h"
20eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch#include "content/public/common/drop_data.h"
215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ipc/ipc_channel_handle.h"
225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ipc/ipc_message_macros.h"
235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ipc/ipc_message_utils.h"
247d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#include "third_party/WebKit/public/web/WebDragOperation.h"
257d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#include "third_party/WebKit/public/web/WebDragStatus.h"
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/gfx/point.h"
275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/gfx/rect.h"
285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/gfx/size.h"
29868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)#include "webkit/common/cursors/webcursor.h"
305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#undef IPC_MESSAGE_EXPORT
325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define IPC_MESSAGE_EXPORT CONTENT_EXPORT
335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define IPC_MESSAGE_START BrowserPluginMsgStart
355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
362a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
372a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_ENUM_TRAITS(BrowserPluginPermissionType)
385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_ENUM_TRAITS(WebKit::WebDragStatus)
395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_BEGIN(BrowserPluginHostMsg_AutoSize_Params)
415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(bool, enable)
425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(gfx::Size, max_size)
435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(gfx::Size, min_size)
445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_END()
455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
462a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_STRUCT_BEGIN(BrowserPluginHostMsg_ResizeGuest_Params)
472a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // The sequence number used to uniquely identify the damage buffer for the
482a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // current container size.
492a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_MEMBER(uint32, damage_buffer_sequence_id)
502a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // The handle to use to map the damage buffer in the browser process.
512a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_MEMBER(base::SharedMemoryHandle, damage_buffer_handle)
522a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // The size of the damage buffer.
532a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_MEMBER(size_t, damage_buffer_size)
5490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)  // The new rect of the guest view area.
5590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)  IPC_STRUCT_MEMBER(gfx::Rect, view_rect)
562a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Indicates the scale factor of the embedder WebView.
572a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_MEMBER(float, scale_factor)
582a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Indicates a request for a full repaint of the page.
592a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // This is required for switching from compositing to the software
602a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // rendering path.
612a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_MEMBER(bool, repaint)
622a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_STRUCT_END()
632a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
64c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)IPC_STRUCT_BEGIN(BrowserPluginHostMsg_Attach_Params)
65868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  IPC_STRUCT_MEMBER(int, browser_plugin_instance_id)
665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(std::string, storage_partition_id)
675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(bool, persist_storage)
685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(bool, focused)
695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(bool, visible)
702a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_MEMBER(std::string, name)
712a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_MEMBER(std::string, src)
722a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_MEMBER(BrowserPluginHostMsg_AutoSize_Params, auto_size_params)
732a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_MEMBER(BrowserPluginHostMsg_ResizeGuest_Params,
742a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    resize_guest_params)
755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_END()
765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
77c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)IPC_STRUCT_BEGIN(BrowserPluginMsg_Attach_ACK_Params)
78c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  IPC_STRUCT_MEMBER(std::string, storage_partition_id)
79c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  IPC_STRUCT_MEMBER(bool, persist_storage)
80c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)  IPC_STRUCT_MEMBER(std::string, name)
81c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)IPC_STRUCT_END()
82c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
83eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen MurdochIPC_STRUCT_BEGIN(BrowserPluginMsg_BuffersSwapped_Params)
84eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  IPC_STRUCT_MEMBER(gfx::Size, size)
85eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  IPC_STRUCT_MEMBER(gfx::Rect, damage_rect)
86eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  IPC_STRUCT_MEMBER(std::string, mailbox_name)
87eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  IPC_STRUCT_MEMBER(int, route_id)
88eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  IPC_STRUCT_MEMBER(int, host_id)
89eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen MurdochIPC_STRUCT_END()
90eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch
915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_BEGIN(BrowserPluginMsg_LoadCommit_Params)
925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The current URL of the guest.
935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(GURL, url)
945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Indicates whether the navigation was on the top-level frame.
955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(bool, is_top_level)
965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_END()
975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_BEGIN(BrowserPluginMsg_UpdateRect_Params)
992a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // The sequence number of the damage buffer used by the browser process.
1002a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_MEMBER(uint32, damage_buffer_sequence_id)
1012a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The position and size of the bitmap.
1035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(gfx::Rect, bitmap_rect)
1045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1052a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // The scroll delta.  Only one of the delta components can be non-zero, and if
1062a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // they are both zero, then it means there is no scrolling and the scroll_rect
1072a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // is ignored.
1082a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_MEMBER(gfx::Vector2d, scroll_delta)
1095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The rectangular region to scroll.
1115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(gfx::Rect, scroll_rect)
1125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The scroll offset of the render view.
1145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(gfx::Point, scroll_offset)
1155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The regions of the bitmap (in view coords) that contain updated pixels.
1175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // In the case of scrolling, this includes the scroll damage rect.
1185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(std::vector<gfx::Rect>, copy_rects)
1195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // The size of the RenderView when this message was generated.  This is
1215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // included so the host knows how large the view is from the perspective of
1225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // the renderer process.  This is necessary in case a resize operation is in
1235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // progress. If auto-resize is enabled, this should update the corresponding
1245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // view size.
1255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(gfx::Size, view_size)
1265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // All the above coordinates are in DIP. This is the scale factor needed
1285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // to convert them to pixels.
1295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(float, scale_factor)
1305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  // Is this UpdateRect an ACK to a resize request?
1325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  IPC_STRUCT_MEMBER(bool, is_resize_ack)
1332a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1342a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // Used in HW accelerated case to switch between sending an UpdateRect_ACK
1352a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // with the new size or just resizing.
1362a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  IPC_STRUCT_MEMBER(bool, needs_ack)
1375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_STRUCT_END()
1385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Browser plugin messages
1405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// -----------------------------------------------------------------------------
1425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// These messages are from the embedder to the browser process.
1435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1442a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// This message is sent to the browser process to request an instance ID.
1452a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// |request_id| is used by BrowserPluginEmbedder to route the response back
1462a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// to its origin.
1472a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_ROUTED1(BrowserPluginHostMsg_AllocateInstanceID,
1482a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    int /* request_id */)
1492a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
150c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// This message is sent from BrowserPlugin to BrowserPluginGuest to issue an
151c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// edit command.
152c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_ExecuteEditCommand,
153c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)                     int /* instance_id */,
154c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)                     std::string /* command */)
155c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
156868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// This message must be sent just before sending a key event.
157868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_SetEditCommandsForNextKeyEvent,
158868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)                    int /* instance_id */,
159868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)                    std::vector<content::EditCommand> /* edit_commands */)
160868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
1615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// This message is sent to the browser process to enable or disable autosize
1625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// mode.
1632a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_ROUTED3(
1645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    BrowserPluginHostMsg_SetAutoSize,
1655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    int /* instance_id */,
1665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    BrowserPluginHostMsg_AutoSize_Params /* auto_size_params */,
1675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    BrowserPluginHostMsg_ResizeGuest_Params /* resize_guest_params */)
1685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1692a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// This message is sent to the browser process to indicate that a BrowserPlugin
1702a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// has taken ownership of the lifetime of the guest of the given |instance_id|.
171c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// |params| is the state of the BrowserPlugin taking ownership of
172c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// the guest. If a guest doesn't already exist with the given |instance_id|,
173c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// a new one will be created.
174eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen MurdochIPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_Attach,
1752a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    int /* instance_id */,
176eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch                    BrowserPluginHostMsg_Attach_Params /* params */,
177eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch                    base::DictionaryValue /* extra_params */)
1782a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the browser process to terminate the guest associated with the
1805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// browser plugin associated with the provided |instance_id|.
1815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(BrowserPluginHostMsg_TerminateGuest,
1825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    int /* instance_id */)
1835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the guest to focus or defocus itself.
1855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_SetFocus,
1865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    int /* instance_id */,
1875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    bool /* enable */)
1885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tell the guest to stop loading.
1905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(BrowserPluginHostMsg_Stop,
1915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    int /* instance_id */)
1925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1932a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Tell the guest to reload.
1945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(BrowserPluginHostMsg_Reload,
1955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    int /* instance_id */)
1965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1972a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Sends an input event to the guest.
1982a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_HandleInputEvent,
1992a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    int /* instance_id */,
2002a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    gfx::Rect /* guest_window_rect */,
2012a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    IPC::WebInputEventPointer /* event */)
2025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// An ACK to the guest process letting it know that the embedder has handled
2045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// the previous frame and is ready for the next frame. If the guest sent the
2055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// embedder a bitmap that does not match the size of the BrowserPlugin's
2065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// container, the BrowserPlugin requests a new size as well.
2075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_UpdateRect_ACK,
2082a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    int /* instance_id */,
2092a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    BrowserPluginHostMsg_AutoSize_Params /* auto_size_params */,
2102a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    BrowserPluginHostMsg_ResizeGuest_Params /* resize_guest_params */)
2115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// A BrowserPlugin sends this to BrowserPluginEmbedder (browser process) when it
2135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// wants to navigate to a given src URL. If a guest WebContents already exists,
2145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// it will navigate that WebContents. If not, it will create the WebContents,
2155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// associate it with the BrowserPluginGuest, and navigate it to the requested
2165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// URL.
2172a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_NavigateGuest,
2185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    int /* instance_id*/,
2192a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    std::string /* src */)
2202a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
2212a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Acknowledge that we presented a HW buffer and provide a sync point
2222a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// to specify the location in the command stream when the compositor
2232a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// is no longer using it.
2242a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_ROUTED5(BrowserPluginHostMsg_BuffersSwappedACK,
2252a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    int /* instance_id */,
2262a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    int /* route_id */,
2272a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    int /* gpu_host_id */,
2282a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    std::string /* mailbox_name */,
2292a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    uint32 /* sync_point */)
2305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
231c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// Acknowledge that we presented an ubercomp frame.
232c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)IPC_MESSAGE_ROUTED4(BrowserPluginHostMsg_CompositorFrameACK,
233c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)                    int /* instance_id */,
234c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)                    int /* route_id */,
235c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)                    int /* renderer_host_id */,
236c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)                    cc::CompositorFrameAck /* ack */)
237c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
2385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// When a BrowserPlugin has been removed from the embedder's DOM, it informs
2395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// the browser process to cleanup the guest.
2405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED1(BrowserPluginHostMsg_PluginDestroyed,
2415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    int /* instance_id */)
2425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the guest it has been shown or hidden.
2445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_SetVisibility,
2455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    int /* instance_id */,
2465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    bool /* visible */)
2475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Tells the guest that a drag event happened on the plugin.
2495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_ROUTED5(BrowserPluginHostMsg_DragStatusUpdate,
2505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    int /* instance_id */,
2515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    WebKit::WebDragStatus /* drag_status */,
252eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch                    content::DropData /* drop_data */,
2535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    WebKit::WebDragOperationsMask /* operation_mask */,
2545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    gfx::Point /* plugin_location */)
2555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2562a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Response to BrowserPluginMsg_PluginAtPositionRequest, returns the browser
2572a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// plugin instace id and the coordinates (local to the plugin).
2582a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_PluginAtPositionResponse,
2592a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    int /* instance_id */,
2602a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    int /* request_id */,
2612a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    gfx::Point /* position */)
2622a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
2632a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Sets the name of the guest window to the provided |name|.
2642a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_SetName,
2652a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    int /* instance_id */,
2662a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    std::string /* name */)
2672a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
2682a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Tells the guest that its request for an API permission has been allowed or
2692a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// denied.
2702a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Note that |allow| = true does not readily mean that the guest will be granted
2712a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// permission, since a security check in the embedder might follow. For example
2722a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// for media access permission, the guest will be granted permission only if its
2732a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// embedder also has access.
2742a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_ROUTED4(BrowserPluginHostMsg_RespondPermission,
2752a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    int /* instance_id */,
2762a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    BrowserPluginPermissionType /* permission_type */,
2772a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    int /* request_id */,
2782a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    bool /* allow */)
2792a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
2802a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Sends a PointerLock Lock ACK to the BrowserPluginGuest.
2812a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_LockMouse_ACK,
2822a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    int /* instance_id */,
2832a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    bool /* succeeded */)
2842a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
2852a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Sends a PointerLock Unlock ACK to the BrowserPluginGuest.
2862a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_ROUTED1(BrowserPluginHostMsg_UnlockMouse_ACK, int /* instance_id */)
2872a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
28890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)// Sent when plugin's position has changed without UpdateRect.
28990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_UpdateGeometry,
29090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                    int /* instance_id */,
29190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)                    gfx::Rect /* view_rect */)
29290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
2935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// -----------------------------------------------------------------------------
2945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// These messages are from the guest renderer to the browser process
2955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// A embedder sends this message to the browser when it wants
2975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// to resize a guest plugin container so that the guest is relaid out
2985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// according to the new size.
2992a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_ResizeGuest,
3002a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    int /* instance_id*/,
3012a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    BrowserPluginHostMsg_ResizeGuest_Params)
3025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// -----------------------------------------------------------------------------
3045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// These messages are from the browser process to the embedder.
3055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3062a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// This message is sent from the browser process to the embedder render process
3072a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// in response to a request to allocate an instance ID. The |request_id| is used
3082a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// to route the response to the requestor.
3092a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_ROUTED2(BrowserPluginMsg_AllocateInstanceID_ACK,
3102a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    int /* request_id */,
3112a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    int /* instance_id */)
3122a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
313c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)IPC_MESSAGE_CONTROL2(BrowserPluginMsg_AddMessageToConsole,
314c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)                     int /* instance_id */,
3157d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)                     base::DictionaryValue /* message_info */)
316c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
317c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// This message is sent in response to a completed attachment of a guest
318c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// to a BrowserPlugin. This message carries information about the guest
319c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// that is used to update the attributes of the browser plugin.
320c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)IPC_MESSAGE_CONTROL2(BrowserPluginMsg_Attach_ACK,
321c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)                     int /* instance_id */,
322c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)                     BrowserPluginMsg_Attach_ACK_Params /* params */)
323c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
324c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// When the guest's window requests to close, the embedder is informed through
325c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)// the BrowserPluginMsg_Close message.
326c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)IPC_MESSAGE_CONTROL1(BrowserPluginMsg_Close,
327c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)                     int /* instance_id */)
328c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
3295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Once the swapped out guest RenderView has been created in the embedder render
3305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// process, the browser process informs the embedder of its routing ID.
3315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL2(BrowserPluginMsg_GuestContentWindowReady,
3325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int /* instance_id */,
3335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int /* source_routing_id */)
3345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// If the guest fails to commit a page load then it will inform the
3365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// embedder through the BrowserPluginMsg_LoadAbort. A description
3375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// of the error will be stored in |type|.  The list of known error
3385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// types can be found in net/base/net_error_list.h.
3395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL4(BrowserPluginMsg_LoadAbort,
3405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int /* instance_id */,
3415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     GURL /* url */,
3425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     bool /* is_top_level */,
3435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     std::string /* type */)
3445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// When the guest commits a navigation, the browser process informs
3462a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// the embedder through the BrowserPluginMsg_LoadCommit message.
3475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL2(BrowserPluginMsg_LoadCommit,
3485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int /* instance_id */,
3495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     BrowserPluginMsg_LoadCommit_Params)
3505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// When the guest crashes, the browser process informs the embedder through this
3525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// message.
3535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL3(BrowserPluginMsg_GuestGone,
3545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int /* instance_id */,
3555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int /* process_id */,
3565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int /* This is really base::TerminationStatus */)
3575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3582a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// When the guest is unresponsive, the browser process informs the embedder
3592a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// through this message.
3602a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL2(BrowserPluginMsg_GuestUnresponsive,
3612a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     int /* instance_id */,
3622a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     int /* process_id */)
3632a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
3642a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// When the guest begins responding again, the browser process informs the
3652a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// embedder through this message.
3662a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL2(BrowserPluginMsg_GuestResponsive,
3672a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     int /* instance_id */,
3682a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     int /* process_id */)
3692a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
3705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// When the user tabs to the end of the tab stops of a guest, the browser
3715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// process informs the embedder to tab out of the browser plugin.
3725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL2(BrowserPluginMsg_AdvanceFocus,
3735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int /* instance_id */,
3745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     bool /* reverse */)
3755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// When the guest starts/stops listening to touch events, it needs to notify the
3775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// plugin in the embedder about it.
3785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL2(BrowserPluginMsg_ShouldAcceptTouchEvents,
3795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int /* instance_id */,
3805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     bool /* accept */)
3815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Inform the embedder of the cursor the guest wishes to display.
3835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)IPC_MESSAGE_CONTROL2(BrowserPluginMsg_SetCursor,
3845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int /* instance_id */,
3855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     WebCursor /* cursor */)
3865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// The guest has damage it wants to convey to the embedder so that it can
3885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// update its backing store.
3892a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL2(BrowserPluginMsg_UpdateRect,
3905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     int /* instance_id */,
3915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                     BrowserPluginMsg_UpdateRect_Params)
3922a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
3932a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Requests the renderer to find out if a browser plugin is at position
3942a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// (|x|, |y|) within the embedder.
3952a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// The response message is BrowserPluginHostMsg_PluginAtPositionResponse.
3962a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// The |request_id| uniquely identifies a request from an embedder.
3972a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_ROUTED2(BrowserPluginMsg_PluginAtPositionRequest,
3982a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    int /* request_id */,
3992a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    gfx::Point /* position */)
4002a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
4012a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Informs BrowserPlugin of a new name set for the top-level guest frame.
4022a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL2(BrowserPluginMsg_UpdatedName,
4032a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     int /* instance_id */,
4042a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     std::string /* name */)
4052a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
4062a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Guest renders into an FBO with textures provided by the embedder.
4072a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// When HW accelerated buffers are swapped in the guest, the message
4082a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// is forwarded to the embedder to notify it of a new texture
4092a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// available for compositing.
410eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen MurdochIPC_MESSAGE_CONTROL2(BrowserPluginMsg_BuffersSwapped,
4112a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     int /* instance_id */,
412eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch                     BrowserPluginMsg_BuffersSwapped_Params)
4132a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
414c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)IPC_MESSAGE_CONTROL4(BrowserPluginMsg_CompositorFrameSwapped,
415c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)                     int /* instance_id */,
416c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)                     cc::CompositorFrame /* frame */,
417c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)                     int /* route_id */,
418c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)                     int /* renderer_host_id */)
419c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
4202a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// When the guest requests permission, the browser process forwards this
4212a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// request to the embeddder through this message.
4222a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL4(BrowserPluginMsg_RequestPermission,
4232a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     int /* instance_id */,
4242a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     BrowserPluginPermissionType /* permission_type */,
4252a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                     int /* request_id */,
4267d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)                     base::DictionaryValue /* request_info */)
4272a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
4282a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Forwards a PointerLock Unlock request to the BrowserPlugin.
4292a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)IPC_MESSAGE_CONTROL1(BrowserPluginMsg_UnlockMouse, int /* instance_id */)
4302a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
431