| 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 "ppapi/c/pp_instance.h" | |
| 17 #include "ui/gfx/size.h" | |
| 18 | |
| 19 #define IPC_MESSAGE_START BrowserPluginMsgStart | |
| 20 | |
| 21 // Browser plugin messages | |
| 22 | |
| 23 // ----------------------------------------------------------------------------- | |
| 24 // These messages are from the embedder to the browser process | |
| 25 | |
| 26 // A renderer sends this to the browser process when it wants to | |
| 27 // create a browser plugin. The browser will create a guest renderer process | |
| 28 // if necessary. | |
| 29 IPC_MESSAGE_ROUTED3(BrowserPluginHostMsg_NavigateFromEmbedder, | |
| 30 int /* plugin instance id*/, | |
| 31 long long /* frame id */, | |
| 32 std::string /* src */) | |
| 33 | |
| 34 // Initially before we create a guest renderer, browser plugin containers | |
| 35 // have a placeholder called BrowserPlugin where each BrowserPlugin has a unique | |
| 36 // ID. During pepper plugin initialization, the embedder page and the plugin | |
| 37 // negotiate an ID of type PP_Instance. The browser talks to the guest | |
| 38 // RenderView via yet another identifier called the routing ID. The browser | |
| 39 // has to keep track of how all these identifiers are associated with one | |
| 40 // another. | |
| 41 // For reference: | |
| 42 // 1. The embedder page sees the guest renderer as a plugin and so it talks | |
| 43 // to the guest via the PP_Instance identifer. | |
| 44 // 2. The guest renderer talks to the browser and vice versa via a routing ID. | |
| 45 // 3. The BrowserPlugin ID uniquely identifies a browser plugin container | |
| 46 // instance within an embedder. | |
| 47 // This identifier exists prior to the existence of the routing ID and the | |
| 48 // PP_Instance identifier. | |
| 49 // The purpose of this message is to tell the browser to map a PP_Instance | |
| 50 // identifier to BrowserPlugin identifier. | |
| 51 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_MapInstance, | |
| 52 int /* container_id */, | |
| 53 PP_Instance /* instance */) | |
| 54 | |
| 55 // ----------------------------------------------------------------------------- | |
| 56 // These messages are from the embedder render process to the guest render | |
| 57 // process. | |
| 58 | |
| 59 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_GuestReady, | |
| 60 PP_Instance /* instance */, | |
| 61 int /* embedder_container_id */) | |
| 62 | |
| 63 // ----------------------------------------------------------------------------- | |
| 64 // These messages are from the guest renderer to the browser process | |
| 65 | |
| 66 IPC_MESSAGE_ROUTED1(BrowserPluginHostMsg_ConnectToChannel, | |
| 67 IPC::ChannelHandle /* handle */) | |
| 68 | |
| 69 // A embedder sends this message to the browser when it wants | |
| 70 // to resize a guest plugin container so that the guest is relaid out | |
| 71 // according to the new size. | |
| 72 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_ResizeGuest, | |
| 73 int32, /* width */ | |
| 74 int32 /* height */) | |
| 75 | |
| 76 IPC_MESSAGE_ROUTED2(BrowserPluginHostMsg_NavigateFromGuest, | |
| 77 PP_Instance /* instance */, | |
| 78 std::string /* src */) | |
| 79 | |
| 80 // ----------------------------------------------------------------------------- | |
| 81 // These messages are from the browser process to the embedder. | |
| 82 | |
| 83 // A guest instance is ready to be placed. | |
| 84 IPC_MESSAGE_CONTROL3(BrowserPluginMsg_LoadGuest, | |
| 85 int /* instance_id */, | |
| 86 int /* guest_process_id */, | |
| 87 IPC::ChannelHandle /* channel_handle */) | |
| 88 | |
| 89 IPC_MESSAGE_CONTROL2(BrowserPluginMsg_AdvanceFocus, | |
| 90 int /* instance_id */, | |
| 91 bool /* reverse */) | |
| 92 | |
| OLD | NEW |