OLD | NEW |
| (Empty) |
1 // Copyright 2013 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 file, hence no include guard. | |
6 | |
7 #include <stdint.h> | |
8 | |
9 #include "build/build_config.h" | |
10 #include "content/common/content_export.h" | |
11 #include "content/common/content_param_traits.h" | |
12 #include "content/common/cursors/webcursor.h" | |
13 #include "ipc/ipc_channel_handle.h" | |
14 #include "ipc/ipc_message_macros.h" | |
15 #include "ui/gfx/geometry/rect.h" | |
16 #include "ui/gfx/ipc/gfx_param_traits.h" | |
17 #include "ui/gfx/ipc/skia/gfx_skia_param_traits.h" | |
18 #include "ui/gfx/native_widget_types.h" | |
19 #include "ui/surface/transport_dib.h" | |
20 #include "url/ipc/url_param_traits.h" | |
21 | |
22 #if defined(OS_POSIX) | |
23 #include "base/file_descriptor_posix.h" | |
24 #endif | |
25 | |
26 #undef IPC_MESSAGE_EXPORT | |
27 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | |
28 | |
29 #define IPC_MESSAGE_START PluginMsgStart | |
30 | |
31 IPC_STRUCT_BEGIN(PluginMsg_Init_Params) | |
32 IPC_STRUCT_MEMBER(GURL, url) | |
33 IPC_STRUCT_MEMBER(GURL, page_url) | |
34 IPC_STRUCT_MEMBER(std::vector<std::string>, arg_names) | |
35 IPC_STRUCT_MEMBER(std::vector<std::string>, arg_values) | |
36 IPC_STRUCT_MEMBER(bool, load_manually) | |
37 IPC_STRUCT_MEMBER(int, host_render_view_routing_id) | |
38 IPC_STRUCT_END() | |
39 | |
40 IPC_STRUCT_BEGIN(PluginMsg_UpdateGeometry_Param) | |
41 IPC_STRUCT_MEMBER(gfx::Rect, window_rect) | |
42 IPC_STRUCT_MEMBER(gfx::Rect, clip_rect) | |
43 IPC_STRUCT_MEMBER(TransportDIB::Handle, windowless_buffer0) | |
44 IPC_STRUCT_MEMBER(TransportDIB::Handle, windowless_buffer1) | |
45 IPC_STRUCT_MEMBER(int, windowless_buffer_index) | |
46 IPC_STRUCT_END() | |
47 | |
48 //----------------------------------------------------------------------------- | |
49 // Plugin messages | |
50 // These are messages sent from the renderer process to the plugin process. | |
51 // Tells the plugin process to create a new plugin instance with the given | |
52 // id. A corresponding WebPluginDelegateStub is created which hosts the | |
53 // WebPluginDelegateImpl. | |
54 IPC_SYNC_MESSAGE_CONTROL1_1(PluginMsg_CreateInstance, | |
55 std::string /* mime_type */, | |
56 int /* instance_id */) | |
57 | |
58 // The WebPluginDelegateProxy sends this to the WebPluginDelegateStub in its | |
59 // destructor, so that the stub deletes the actual WebPluginDelegateImpl | |
60 // object that it's hosting. | |
61 IPC_SYNC_MESSAGE_CONTROL1_0(PluginMsg_DestroyInstance, | |
62 int /* instance_id */) | |
63 | |
64 IPC_SYNC_MESSAGE_CONTROL0_1(PluginMsg_GenerateRouteID, | |
65 int /* id */) | |
66 | |
67 // The messages below all map to WebPluginDelegate methods. | |
68 IPC_SYNC_MESSAGE_ROUTED1_2(PluginMsg_Init, | |
69 PluginMsg_Init_Params, | |
70 bool /* transparent */, | |
71 bool /* result */) | |
72 | |
73 // Used to synchronously request a paint for windowless plugins. | |
74 IPC_SYNC_MESSAGE_ROUTED1_0(PluginMsg_Paint, | |
75 gfx::Rect /* damaged_rect */) | |
76 | |
77 // Sent by the renderer after it paints from its backing store so that the | |
78 // plugin knows it can send more invalidates. | |
79 IPC_MESSAGE_ROUTED0(PluginMsg_DidPaint) | |
80 | |
81 // Updates the plugin location. | |
82 IPC_MESSAGE_ROUTED1(PluginMsg_UpdateGeometry, | |
83 PluginMsg_UpdateGeometry_Param) | |
84 | |
85 // A synchronous version of above. | |
86 IPC_SYNC_MESSAGE_ROUTED1_0(PluginMsg_UpdateGeometrySync, | |
87 PluginMsg_UpdateGeometry_Param) | |
88 | |
89 IPC_SYNC_MESSAGE_ROUTED1_0(PluginMsg_SetFocus, | |
90 bool /* focused */) | |
91 | |
92 IPC_SYNC_MESSAGE_ROUTED1_2(PluginMsg_HandleInputEvent, | |
93 IPC::WebInputEventPointer /* event */, | |
94 bool /* handled */, | |
95 content::WebCursor /* cursor type*/) | |
96 | |
97 IPC_MESSAGE_ROUTED1(PluginMsg_SetContentAreaFocus, | |
98 bool /* has_focus */) | |
99 | |
100 IPC_MESSAGE_CONTROL1(PluginMsg_SignalModalDialogEvent, | |
101 int /* render_view_id */) | |
102 | |
103 IPC_MESSAGE_CONTROL1(PluginMsg_ResetModalDialogEvent, | |
104 int /* render_view_id */) | |
105 | |
106 #if defined(OS_MACOSX) | |
107 IPC_MESSAGE_ROUTED1(PluginMsg_SetWindowFocus, | |
108 bool /* has_focus */) | |
109 | |
110 IPC_MESSAGE_ROUTED0(PluginMsg_ContainerHidden) | |
111 | |
112 IPC_MESSAGE_ROUTED3(PluginMsg_ContainerShown, | |
113 gfx::Rect /* window_frame */, | |
114 gfx::Rect /* view_frame */, | |
115 bool /* has_focus */) | |
116 | |
117 IPC_MESSAGE_ROUTED2(PluginMsg_WindowFrameChanged, | |
118 gfx::Rect /* window_frame */, | |
119 gfx::Rect /* view_frame */) | |
120 | |
121 IPC_MESSAGE_ROUTED1(PluginMsg_ImeCompositionCompleted, | |
122 base::string16 /* text */) | |
123 #endif | |
124 | |
125 //----------------------------------------------------------------------------- | |
126 // PluginHost messages | |
127 // These are messages sent from the plugin process to the renderer process. | |
128 // They all map to the corresponding WebPlugin methods. | |
129 | |
130 IPC_MESSAGE_ROUTED1(PluginHostMsg_InvalidateRect, | |
131 gfx::Rect /* rect */) | |
132 | |
133 IPC_SYNC_MESSAGE_ROUTED1_2(PluginHostMsg_ResolveProxy, | |
134 GURL /* url */, | |
135 bool /* result */, | |
136 std::string /* proxy list */) | |
137 | |
138 IPC_MESSAGE_ROUTED3(PluginHostMsg_SetCookie, | |
139 GURL /* url */, | |
140 GURL /* first_party_for_cookies */, | |
141 std::string /* cookie */) | |
142 | |
143 IPC_SYNC_MESSAGE_ROUTED2_1(PluginHostMsg_GetCookies, | |
144 GURL /* url */, | |
145 GURL /* first_party_for_cookies */, | |
146 std::string /* cookies */) | |
147 | |
148 IPC_MESSAGE_ROUTED0(PluginHostMsg_CancelDocumentLoad) | |
149 | |
150 IPC_MESSAGE_ROUTED0(PluginHostMsg_DidStartLoading) | |
151 IPC_MESSAGE_ROUTED0(PluginHostMsg_DidStopLoading) | |
152 | |
153 IPC_MESSAGE_CONTROL0(PluginHostMsg_PluginShuttingDown) | |
154 | |
155 #if defined(OS_MACOSX) | |
156 IPC_MESSAGE_ROUTED1(PluginHostMsg_FocusChanged, | |
157 bool /* focused */) | |
158 | |
159 IPC_MESSAGE_ROUTED0(PluginHostMsg_StartIme) | |
160 | |
161 //---------------------------------------------------------------------- | |
162 // Core Animation plugin implementation rendering via compositor. | |
163 | |
164 // Notifies the renderer process that this plugin will be using the | |
165 // accelerated rendering path. | |
166 IPC_MESSAGE_ROUTED0(PluginHostMsg_AcceleratedPluginEnabledRendering) | |
167 | |
168 // Notifies the renderer process that the plugin allocated a new | |
169 // IOSurface into which it is rendering. The renderer process forwards | |
170 // this IOSurface to the GPU process, causing it to be bound to a | |
171 // texture from which the compositor can render. Any previous | |
172 // IOSurface allocated by this plugin must be implicitly released by | |
173 // the receipt of this message. | |
174 IPC_MESSAGE_ROUTED3(PluginHostMsg_AcceleratedPluginAllocatedIOSurface, | |
175 int32_t /* width */, | |
176 int32_t /* height */, | |
177 uint32_t /* surface_id */) | |
178 | |
179 // Notifies the renderer process that the plugin produced a new frame | |
180 // of content into its IOSurface, and therefore that the compositor | |
181 // needs to redraw. | |
182 IPC_MESSAGE_ROUTED0(PluginHostMsg_AcceleratedPluginSwappedIOSurface) | |
183 #endif | |
OLD | NEW |