Upstream version 11.39.250.0
[platform/framework/web/crosswalk.git] / src / content / common / view_messages.h
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 // IPC messages for page rendering.
6 // Multiply-included message file, hence no include guard.
7
8 #include "base/memory/shared_memory.h"
9 #include "base/process/process.h"
10 #include "base/strings/string16.h"
11 #include "cc/output/begin_frame_args.h"
12 #include "cc/output/compositor_frame.h"
13 #include "cc/output/compositor_frame_ack.h"
14 #include "content/common/content_export.h"
15 #include "content/common/content_param_traits.h"
16 #include "content/common/cookie_data.h"
17 #include "content/common/date_time_suggestion.h"
18 #include "content/common/navigation_gesture.h"
19 #include "content/common/view_message_enums.h"
20 #include "content/common/webplugin_geometry.h"
21 #include "content/public/common/common_param_traits.h"
22 #include "content/public/common/favicon_url.h"
23 #include "content/public/common/file_chooser_params.h"
24 #include "content/public/common/menu_item.h"
25 #include "content/public/common/page_state.h"
26 #include "content/public/common/page_zoom.h"
27 #include "content/public/common/referrer.h"
28 #include "content/public/common/renderer_preferences.h"
29 #include "content/public/common/stop_find_action.h"
30 #include "content/public/common/three_d_api_types.h"
31 #include "content/public/common/window_container_type.h"
32 #include "ipc/ipc_channel_handle.h"
33 #include "ipc/ipc_message_macros.h"
34 #include "ipc/ipc_platform_file.h"
35 #include "media/audio/audio_parameters.h"
36 #include "media/base/channel_layout.h"
37 #include "media/base/media_log_event.h"
38 #include "net/base/network_change_notifier.h"
39 #include "third_party/WebKit/public/platform/WebFloatPoint.h"
40 #include "third_party/WebKit/public/platform/WebFloatRect.h"
41 #include "third_party/WebKit/public/platform/WebScreenInfo.h"
42 #include "third_party/WebKit/public/web/WebFindOptions.h"
43 #include "third_party/WebKit/public/web/WebMediaPlayerAction.h"
44 #include "third_party/WebKit/public/web/WebPluginAction.h"
45 #include "third_party/WebKit/public/web/WebPopupType.h"
46 #include "third_party/WebKit/public/web/WebTextDirection.h"
47 #include "third_party/skia/include/core/SkBitmap.h"
48 #include "ui/base/ime/text_input_mode.h"
49 #include "ui/base/ime/text_input_type.h"
50 #include "ui/base/ui_base_types.h"
51 #include "ui/gfx/ipc/gfx_param_traits.h"
52 #include "ui/gfx/point.h"
53 #include "ui/gfx/range/range.h"
54 #include "ui/gfx/rect.h"
55 #include "ui/gfx/rect_f.h"
56 #include "ui/gfx/vector2d.h"
57 #include "ui/gfx/vector2d_f.h"
58 #include "ui/shell_dialogs/selected_file_info.h"
59
60 #if defined(OS_MACOSX)
61 #include "content/common/mac/font_descriptor.h"
62 #include "third_party/WebKit/public/web/mac/WebScrollbarTheme.h"
63 #endif
64
65 #if defined(ENABLE_PLUGINS)
66 #include "content/common/pepper_renderer_instance_data.h"
67 #endif
68
69 #undef IPC_MESSAGE_EXPORT
70 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT
71
72 #define IPC_MESSAGE_START ViewMsgStart
73
74 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebMediaPlayerAction::Type,
75                           blink::WebMediaPlayerAction::Type::TypeLast)
76 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebPluginAction::Type,
77                           blink::WebPluginAction::Type::TypeLast)
78 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebPopupType,
79                           blink::WebPopupType::WebPopupTypeLast)
80 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebTextDirection,
81                           blink::WebTextDirection::WebTextDirectionLast)
82 IPC_ENUM_TRAITS(WindowContainerType)
83 IPC_ENUM_TRAITS(content::FaviconURL::IconType)
84 IPC_ENUM_TRAITS(content::FileChooserParams::Mode)
85 IPC_ENUM_TRAITS(content::MenuItem::Type)
86 IPC_ENUM_TRAITS(content::NavigationGesture)
87 IPC_ENUM_TRAITS(content::PageZoom)
88 IPC_ENUM_TRAITS(gfx::FontRenderParams::Hinting)
89 IPC_ENUM_TRAITS(gfx::FontRenderParams::SubpixelRendering)
90 IPC_ENUM_TRAITS_MAX_VALUE(content::TapMultipleTargetsStrategy,
91                           content::TAP_MULTIPLE_TARGETS_STRATEGY_MAX)
92 IPC_ENUM_TRAITS_MAX_VALUE(content::StopFindAction,
93                           content::STOP_FIND_ACTION_LAST)
94 IPC_ENUM_TRAITS_MAX_VALUE(content::ThreeDAPIType,
95                           content::THREE_D_API_TYPE_LAST)
96 IPC_ENUM_TRAITS_MAX_VALUE(media::ChannelLayout, media::CHANNEL_LAYOUT_MAX - 1)
97 IPC_ENUM_TRAITS_MAX_VALUE(media::MediaLogEvent::Type,
98                           media::MediaLogEvent::TYPE_LAST)
99 IPC_ENUM_TRAITS_MAX_VALUE(ui::TextInputMode, ui::TEXT_INPUT_MODE_MAX)
100 IPC_ENUM_TRAITS(ui::TextInputType)
101
102 #if defined(OS_MACOSX)
103 IPC_STRUCT_TRAITS_BEGIN(FontDescriptor)
104   IPC_STRUCT_TRAITS_MEMBER(font_name)
105   IPC_STRUCT_TRAITS_MEMBER(font_point_size)
106 IPC_STRUCT_TRAITS_END()
107 #endif
108
109 IPC_STRUCT_TRAITS_BEGIN(blink::WebFindOptions)
110   IPC_STRUCT_TRAITS_MEMBER(forward)
111   IPC_STRUCT_TRAITS_MEMBER(matchCase)
112   IPC_STRUCT_TRAITS_MEMBER(findNext)
113 IPC_STRUCT_TRAITS_END()
114
115 IPC_STRUCT_TRAITS_BEGIN(blink::WebMediaPlayerAction)
116   IPC_STRUCT_TRAITS_MEMBER(type)
117   IPC_STRUCT_TRAITS_MEMBER(enable)
118 IPC_STRUCT_TRAITS_END()
119
120 IPC_STRUCT_TRAITS_BEGIN(blink::WebPluginAction)
121   IPC_STRUCT_TRAITS_MEMBER(type)
122   IPC_STRUCT_TRAITS_MEMBER(enable)
123 IPC_STRUCT_TRAITS_END()
124
125 IPC_STRUCT_TRAITS_BEGIN(blink::WebFloatPoint)
126   IPC_STRUCT_TRAITS_MEMBER(x)
127   IPC_STRUCT_TRAITS_MEMBER(y)
128 IPC_STRUCT_TRAITS_END()
129
130 IPC_STRUCT_TRAITS_BEGIN(blink::WebFloatRect)
131   IPC_STRUCT_TRAITS_MEMBER(x)
132   IPC_STRUCT_TRAITS_MEMBER(y)
133   IPC_STRUCT_TRAITS_MEMBER(width)
134   IPC_STRUCT_TRAITS_MEMBER(height)
135 IPC_STRUCT_TRAITS_END()
136
137 IPC_STRUCT_TRAITS_BEGIN(blink::WebScreenInfo)
138   IPC_STRUCT_TRAITS_MEMBER(deviceScaleFactor)
139   IPC_STRUCT_TRAITS_MEMBER(depth)
140   IPC_STRUCT_TRAITS_MEMBER(depthPerComponent)
141   IPC_STRUCT_TRAITS_MEMBER(isMonochrome)
142   IPC_STRUCT_TRAITS_MEMBER(rect)
143   IPC_STRUCT_TRAITS_MEMBER(availableRect)
144   IPC_STRUCT_TRAITS_MEMBER(orientationType)
145   IPC_STRUCT_TRAITS_MEMBER(orientationAngle)
146 IPC_STRUCT_TRAITS_END()
147
148 IPC_STRUCT_TRAITS_BEGIN(content::MenuItem)
149   IPC_STRUCT_TRAITS_MEMBER(label)
150   IPC_STRUCT_TRAITS_MEMBER(tool_tip)
151   IPC_STRUCT_TRAITS_MEMBER(type)
152   IPC_STRUCT_TRAITS_MEMBER(action)
153   IPC_STRUCT_TRAITS_MEMBER(rtl)
154   IPC_STRUCT_TRAITS_MEMBER(has_directional_override)
155   IPC_STRUCT_TRAITS_MEMBER(enabled)
156   IPC_STRUCT_TRAITS_MEMBER(checked)
157   IPC_STRUCT_TRAITS_MEMBER(submenu)
158 IPC_STRUCT_TRAITS_END()
159
160 IPC_STRUCT_TRAITS_BEGIN(content::DateTimeSuggestion)
161   IPC_STRUCT_TRAITS_MEMBER(value)
162   IPC_STRUCT_TRAITS_MEMBER(localized_value)
163   IPC_STRUCT_TRAITS_MEMBER(label)
164 IPC_STRUCT_TRAITS_END()
165
166 IPC_STRUCT_TRAITS_BEGIN(content::FaviconURL)
167   IPC_STRUCT_TRAITS_MEMBER(icon_url)
168   IPC_STRUCT_TRAITS_MEMBER(icon_type)
169   IPC_STRUCT_TRAITS_MEMBER(icon_sizes)
170 IPC_STRUCT_TRAITS_END()
171
172 IPC_STRUCT_TRAITS_BEGIN(content::FileChooserParams)
173   IPC_STRUCT_TRAITS_MEMBER(mode)
174   IPC_STRUCT_TRAITS_MEMBER(title)
175   IPC_STRUCT_TRAITS_MEMBER(default_file_name)
176   IPC_STRUCT_TRAITS_MEMBER(accept_types)
177 #if defined(OS_ANDROID)
178   IPC_STRUCT_TRAITS_MEMBER(capture)
179 #endif
180 IPC_STRUCT_TRAITS_END()
181
182 #if defined(ENABLE_PLUGINS)
183 IPC_STRUCT_TRAITS_BEGIN(content::PepperRendererInstanceData)
184   IPC_STRUCT_TRAITS_MEMBER(render_process_id)
185   IPC_STRUCT_TRAITS_MEMBER(render_frame_id)
186   IPC_STRUCT_TRAITS_MEMBER(document_url)
187   IPC_STRUCT_TRAITS_MEMBER(plugin_url)
188 IPC_STRUCT_TRAITS_END()
189 #endif
190
191 IPC_STRUCT_TRAITS_BEGIN(content::RendererPreferences)
192   IPC_STRUCT_TRAITS_MEMBER(can_accept_load_drops)
193   IPC_STRUCT_TRAITS_MEMBER(should_antialias_text)
194   IPC_STRUCT_TRAITS_MEMBER(hinting)
195   IPC_STRUCT_TRAITS_MEMBER(use_autohinter)
196   IPC_STRUCT_TRAITS_MEMBER(use_bitmaps)
197   IPC_STRUCT_TRAITS_MEMBER(subpixel_rendering)
198   IPC_STRUCT_TRAITS_MEMBER(use_subpixel_positioning)
199   IPC_STRUCT_TRAITS_MEMBER(focus_ring_color)
200   IPC_STRUCT_TRAITS_MEMBER(thumb_active_color)
201   IPC_STRUCT_TRAITS_MEMBER(thumb_inactive_color)
202   IPC_STRUCT_TRAITS_MEMBER(track_color)
203   IPC_STRUCT_TRAITS_MEMBER(active_selection_bg_color)
204   IPC_STRUCT_TRAITS_MEMBER(active_selection_fg_color)
205   IPC_STRUCT_TRAITS_MEMBER(inactive_selection_bg_color)
206   IPC_STRUCT_TRAITS_MEMBER(inactive_selection_fg_color)
207   IPC_STRUCT_TRAITS_MEMBER(browser_handles_non_local_top_level_requests)
208   IPC_STRUCT_TRAITS_MEMBER(browser_handles_all_top_level_requests)
209   IPC_STRUCT_TRAITS_MEMBER(caret_blink_interval)
210   IPC_STRUCT_TRAITS_MEMBER(use_custom_colors)
211   IPC_STRUCT_TRAITS_MEMBER(enable_referrers)
212   IPC_STRUCT_TRAITS_MEMBER(enable_do_not_track)
213   IPC_STRUCT_TRAITS_MEMBER(default_zoom_level)
214   IPC_STRUCT_TRAITS_MEMBER(user_agent_override)
215   IPC_STRUCT_TRAITS_MEMBER(accept_languages)
216   IPC_STRUCT_TRAITS_MEMBER(report_frame_name_changes)
217   IPC_STRUCT_TRAITS_MEMBER(tap_multiple_targets_strategy)
218   IPC_STRUCT_TRAITS_MEMBER(disable_client_blocked_error_page)
219   IPC_STRUCT_TRAITS_MEMBER(plugin_fullscreen_allowed)
220   IPC_STRUCT_TRAITS_MEMBER(use_video_overlay_for_embedded_encrypted_video)
221 IPC_STRUCT_TRAITS_END()
222
223 IPC_STRUCT_TRAITS_BEGIN(content::CookieData)
224   IPC_STRUCT_TRAITS_MEMBER(name)
225   IPC_STRUCT_TRAITS_MEMBER(value)
226   IPC_STRUCT_TRAITS_MEMBER(domain)
227   IPC_STRUCT_TRAITS_MEMBER(path)
228   IPC_STRUCT_TRAITS_MEMBER(expires)
229   IPC_STRUCT_TRAITS_MEMBER(http_only)
230   IPC_STRUCT_TRAITS_MEMBER(secure)
231   IPC_STRUCT_TRAITS_MEMBER(session)
232 IPC_STRUCT_TRAITS_END()
233
234 IPC_STRUCT_TRAITS_BEGIN(content::WebPluginGeometry)
235   IPC_STRUCT_TRAITS_MEMBER(window)
236   IPC_STRUCT_TRAITS_MEMBER(window_rect)
237   IPC_STRUCT_TRAITS_MEMBER(clip_rect)
238   IPC_STRUCT_TRAITS_MEMBER(cutout_rects)
239   IPC_STRUCT_TRAITS_MEMBER(rects_valid)
240   IPC_STRUCT_TRAITS_MEMBER(visible)
241 IPC_STRUCT_TRAITS_END()
242
243 IPC_STRUCT_TRAITS_BEGIN(media::MediaLogEvent)
244   IPC_STRUCT_TRAITS_MEMBER(id)
245   IPC_STRUCT_TRAITS_MEMBER(type)
246   IPC_STRUCT_TRAITS_MEMBER(params)
247   IPC_STRUCT_TRAITS_MEMBER(time)
248 IPC_STRUCT_TRAITS_END()
249
250 IPC_STRUCT_TRAITS_BEGIN(ui::SelectedFileInfo)
251   IPC_STRUCT_TRAITS_MEMBER(file_path)
252   IPC_STRUCT_TRAITS_MEMBER(local_path)
253   IPC_STRUCT_TRAITS_MEMBER(display_name)
254 IPC_STRUCT_TRAITS_END()
255
256 IPC_STRUCT_BEGIN(ViewHostMsg_CreateWindow_Params)
257   // Routing ID of the view initiating the open.
258   IPC_STRUCT_MEMBER(int, opener_id)
259
260   // True if this open request came in the context of a user gesture.
261   IPC_STRUCT_MEMBER(bool, user_gesture)
262
263   // Type of window requested.
264   IPC_STRUCT_MEMBER(WindowContainerType, window_container_type)
265
266   // The session storage namespace ID this view should use.
267   IPC_STRUCT_MEMBER(int64, session_storage_namespace_id)
268
269   // The name of the resulting frame that should be created (empty if none
270   // has been specified).
271   IPC_STRUCT_MEMBER(base::string16, frame_name)
272
273   // The routing id of the frame initiating the open.
274   IPC_STRUCT_MEMBER(int, opener_render_frame_id)
275
276   // The URL of the frame initiating the open.
277   IPC_STRUCT_MEMBER(GURL, opener_url)
278
279   // The URL of the top frame containing the opener.
280   IPC_STRUCT_MEMBER(GURL, opener_top_level_frame_url)
281
282   // The security origin of the frame initiating the open.
283   IPC_STRUCT_MEMBER(GURL, opener_security_origin)
284
285   // Whether the opener will be suppressed in the new window, in which case
286   // scripting the new window is not allowed.
287   IPC_STRUCT_MEMBER(bool, opener_suppressed)
288
289   // Whether the window should be opened in the foreground, background, etc.
290   IPC_STRUCT_MEMBER(WindowOpenDisposition, disposition)
291
292   // The URL that will be loaded in the new window (empty if none has been
293   // sepcified).
294   IPC_STRUCT_MEMBER(GURL, target_url)
295
296   // The referrer that will be used to load |target_url| (empty if none has
297   // been specified).
298   IPC_STRUCT_MEMBER(content::Referrer, referrer)
299
300   // The window features to use for the new view.
301   IPC_STRUCT_MEMBER(blink::WebWindowFeatures, features)
302
303   // The additional window features to use for the new view. We pass these
304   // separately from |features| above because we cannot serialize WebStrings
305   // over IPC.
306   IPC_STRUCT_MEMBER(std::vector<base::string16>, additional_features)
307 IPC_STRUCT_END()
308
309 IPC_STRUCT_BEGIN(ViewHostMsg_CreateWorker_Params)
310   // URL for the worker script.
311   IPC_STRUCT_MEMBER(GURL, url)
312
313   // Name for a SharedWorker, otherwise empty string.
314   IPC_STRUCT_MEMBER(base::string16, name)
315
316   // Security policy used in the worker.
317   IPC_STRUCT_MEMBER(base::string16, content_security_policy)
318
319   // Security policy type used in the worker.
320   IPC_STRUCT_MEMBER(blink::WebContentSecurityPolicyType, security_policy_type)
321
322   // The ID of the parent document (unique within parent renderer).
323   IPC_STRUCT_MEMBER(unsigned long long, document_id)
324
325   // RenderFrame routing id used to send messages back to the parent.
326   IPC_STRUCT_MEMBER(int, render_frame_route_id)
327 IPC_STRUCT_END()
328
329 IPC_STRUCT_BEGIN(ViewHostMsg_DateTimeDialogValue_Params)
330   IPC_STRUCT_MEMBER(ui::TextInputType, dialog_type)
331   IPC_STRUCT_MEMBER(double, dialog_value)
332   IPC_STRUCT_MEMBER(double, minimum)
333   IPC_STRUCT_MEMBER(double, maximum)
334   IPC_STRUCT_MEMBER(double, step)
335   IPC_STRUCT_MEMBER(std::vector<content::DateTimeSuggestion>, suggestions)
336 IPC_STRUCT_END()
337
338 IPC_STRUCT_BEGIN(ViewHostMsg_SelectionBounds_Params)
339   IPC_STRUCT_MEMBER(gfx::Rect, anchor_rect)
340   IPC_STRUCT_MEMBER(blink::WebTextDirection, anchor_dir)
341   IPC_STRUCT_MEMBER(gfx::Rect, focus_rect)
342   IPC_STRUCT_MEMBER(blink::WebTextDirection, focus_dir)
343   IPC_STRUCT_MEMBER(bool, is_anchor_first)
344 IPC_STRUCT_END()
345
346 IPC_STRUCT_BEGIN(ViewHostMsg_TextInputState_Params)
347   // The type of input field
348   IPC_STRUCT_MEMBER(ui::TextInputType, type)
349
350   // The flags of the input field (autocorrect, autocomplete, etc.)
351   IPC_STRUCT_MEMBER(int, flags)
352
353   // The value of the input field
354   IPC_STRUCT_MEMBER(std::string, value)
355
356   // The cursor position of the current selection start, or the caret position
357   // if nothing is selected
358   IPC_STRUCT_MEMBER(int, selection_start)
359
360   // The cursor position of the current selection end, or the caret position
361   // if nothing is selected
362   IPC_STRUCT_MEMBER(int, selection_end)
363
364   // The start position of the current composition, or -1 if there is none
365   IPC_STRUCT_MEMBER(int, composition_start)
366
367   // The end position of the current composition, or -1 if there is none
368   IPC_STRUCT_MEMBER(int, composition_end)
369
370   // Whether or not inline composition can be performed for the current input.
371   IPC_STRUCT_MEMBER(bool, can_compose_inline)
372
373   // Whether or not the IME should be shown as a result of this update. Even if
374   // true, the IME will only be shown if the type is appropriate (e.g. not
375   // TEXT_INPUT_TYPE_NONE).
376   IPC_STRUCT_MEMBER(bool, show_ime_if_needed)
377
378   // Whether this change is originated from non-IME (e.g. Javascript, Autofill).
379   IPC_STRUCT_MEMBER(bool, is_non_ime_change)
380 IPC_STRUCT_END()
381
382 IPC_STRUCT_BEGIN(ViewHostMsg_UpdateRect_Params)
383   // The size of the RenderView when this message was generated.  This is
384   // included so the host knows how large the view is from the perspective of
385   // the renderer process.  This is necessary in case a resize operation is in
386   // progress. If auto-resize is enabled, this should update the corresponding
387   // view size.
388   IPC_STRUCT_MEMBER(gfx::Size, view_size)
389
390   // New window locations for plugin child windows.
391   IPC_STRUCT_MEMBER(std::vector<content::WebPluginGeometry>,
392                     plugin_window_moves)
393
394   // The following describes the various bits that may be set in flags:
395   //
396   //   ViewHostMsg_UpdateRect_Flags::IS_RESIZE_ACK
397   //     Indicates that this is a response to a ViewMsg_Resize message.
398   //
399   //   ViewHostMsg_UpdateRect_Flags::IS_REPAINT_ACK
400   //     Indicates that this is a response to a ViewMsg_Repaint message.
401   //
402   // If flags is zero, then this message corresponds to an unsolicited paint
403   // request by the render view.  Any of the above bits may be set in flags,
404   // which would indicate that this paint message is an ACK for multiple
405   // request messages.
406   IPC_STRUCT_MEMBER(int, flags)
407 IPC_STRUCT_END()
408
409 IPC_STRUCT_BEGIN(ViewMsg_New_Params)
410   // Renderer-wide preferences.
411   IPC_STRUCT_MEMBER(content::RendererPreferences, renderer_preferences)
412
413   // Preferences for this view.
414   IPC_STRUCT_MEMBER(content::WebPreferences, web_preferences)
415
416   // The ID of the view to be created.
417   IPC_STRUCT_MEMBER(int32, view_id)
418
419   // The ID of the main frame hosted in the view.
420   IPC_STRUCT_MEMBER(int32, main_frame_routing_id)
421
422   // The ID of the rendering surface.
423   IPC_STRUCT_MEMBER(int32, surface_id)
424
425   // The session storage namespace ID this view should use.
426   IPC_STRUCT_MEMBER(int64, session_storage_namespace_id)
427
428   // The name of the frame associated with this view (or empty if none).
429   IPC_STRUCT_MEMBER(base::string16, frame_name)
430
431   // The route ID of the opener RenderView if we need to set one
432   // (MSG_ROUTING_NONE otherwise).
433   IPC_STRUCT_MEMBER(int, opener_route_id)
434
435   // Whether the RenderView should initially be swapped out.
436   IPC_STRUCT_MEMBER(bool, swapped_out)
437
438   // The ID of the proxy object for the main frame in this view. It is only
439   // used if |swapped_out| is true.
440   IPC_STRUCT_MEMBER(int32, proxy_routing_id)
441
442   // Whether the RenderView should initially be hidden.
443   IPC_STRUCT_MEMBER(bool, hidden)
444
445   // Whether the RenderView will never be visible.
446   IPC_STRUCT_MEMBER(bool, never_visible)
447
448   // Whether the window associated with this view was created with an opener.
449   IPC_STRUCT_MEMBER(bool, window_was_created_with_opener)
450
451   // The initial page ID to use for this view, which must be larger than any
452   // existing navigation that might be loaded in the view.  Page IDs are unique
453   // to a view and are only updated by the renderer after this initial value.
454   IPC_STRUCT_MEMBER(int32, next_page_id)
455
456   // The properties of the screen associated with the view.
457   IPC_STRUCT_MEMBER(blink::WebScreenInfo, screen_info)
458 IPC_STRUCT_END()
459
460 IPC_STRUCT_BEGIN(ViewMsg_PostMessage_Params)
461   // Whether the data format is supplied as serialized script value, or as
462   // a simple string. If it is a raw string, must be converted from string to a
463   // WebSerializedScriptValue in renderer.
464   IPC_STRUCT_MEMBER(bool, is_data_raw_string)
465   // The serialized script value.
466   IPC_STRUCT_MEMBER(base::string16, data)
467   // When sent to the browser, this is the routing ID of the source frame in
468   // the source process.  The browser replaces it with the routing ID of the
469   // equivalent (swapped out) frame in the destination process.
470   IPC_STRUCT_MEMBER(int, source_routing_id)
471
472   // The origin of the source frame.
473   IPC_STRUCT_MEMBER(base::string16, source_origin)
474
475   // The origin for the message's target.
476   IPC_STRUCT_MEMBER(base::string16, target_origin)
477
478   // Information about the MessagePorts this message contains.
479   IPC_STRUCT_MEMBER(std::vector<int>, message_port_ids)
480   IPC_STRUCT_MEMBER(std::vector<int>, new_routing_ids)
481 IPC_STRUCT_END()
482
483 // Messages sent from the browser to the renderer.
484
485 #if defined(OS_ANDROID)
486 // Tells the renderer to cancel an opened date/time dialog.
487 IPC_MESSAGE_ROUTED0(ViewMsg_CancelDateTimeDialog)
488
489 // Replaces a date time input field.
490 IPC_MESSAGE_ROUTED1(ViewMsg_ReplaceDateTime,
491                     double /* dialog_value */)
492
493 #endif
494
495 // Get all savable resource links from current webpage, include main
496 // frame and sub-frame.
497 IPC_MESSAGE_ROUTED1(ViewMsg_GetAllSavableResourceLinksForCurrentPage,
498                     GURL /* url of page which is needed to save */)
499
500 // Get html data by serializing all frames of current page with lists
501 // which contain all resource links that have local copy.
502 IPC_MESSAGE_ROUTED3(ViewMsg_GetSerializedHtmlDataForCurrentPageWithLocalLinks,
503                     std::vector<GURL> /* urls that have local copy */,
504                     std::vector<base::FilePath> /* paths of local copy */,
505                     base::FilePath /* local directory path */)
506
507 // Tells the render side that a ViewHostMsg_LockMouse message has been
508 // processed. |succeeded| indicates whether the mouse has been successfully
509 // locked or not.
510 IPC_MESSAGE_ROUTED1(ViewMsg_LockMouse_ACK,
511                     bool /* succeeded */)
512 // Tells the render side that the mouse has been unlocked.
513 IPC_MESSAGE_ROUTED0(ViewMsg_MouseLockLost)
514
515 // Sent by the browser when the parameters for vsync alignment have changed.
516 IPC_MESSAGE_ROUTED2(ViewMsg_UpdateVSyncParameters,
517                     base::TimeTicks /* timebase */,
518                     base::TimeDelta /* interval */)
519
520 // Sent to the RenderView when a new tab is swapped into an existing
521 // tab and the histories need to be merged. The existing tab has a history of
522 // |merged_history_length| which precedes the history of the new tab. All
523 // page_ids >= |minimum_page_id| in the new tab are appended to the history.
524 //
525 // For example, suppose the history of page_ids in the new tab's RenderView
526 // is [4 7 8]. This is merged into an existing tab with 3 history items, and
527 // all pages in the new tab with page_id >= 7 are to be preserved.
528 // The resulting page history is [-1 -1 -1 7 8].
529 IPC_MESSAGE_ROUTED2(ViewMsg_SetHistoryLengthAndPrune,
530                     int, /* merge_history_length */
531                     int32 /* minimum_page_id */)
532
533 // Tells the renderer to create a new view.
534 // This message is slightly different, the view it takes (via
535 // ViewMsg_New_Params) is the view to create, the message itself is sent as a
536 // non-view control message.
537 IPC_MESSAGE_CONTROL1(ViewMsg_New,
538                      ViewMsg_New_Params)
539
540 // Reply in response to ViewHostMsg_ShowView or ViewHostMsg_ShowWidget.
541 // similar to the new command, but used when the renderer created a view
542 // first, and we need to update it.
543 IPC_MESSAGE_ROUTED0(ViewMsg_CreatingNew_ACK)
544
545 // Sends updated preferences to the renderer.
546 IPC_MESSAGE_ROUTED1(ViewMsg_SetRendererPrefs,
547                     content::RendererPreferences)
548
549 // This passes a set of webkit preferences down to the renderer.
550 IPC_MESSAGE_ROUTED1(ViewMsg_UpdateWebPreferences,
551                     content::WebPreferences)
552
553 // Informs the renderer that the timezone has changed.
554 IPC_MESSAGE_CONTROL0(ViewMsg_TimezoneChange)
555
556 // Tells the render view to close.
557 // Expects a Close_ACK message when finished.
558 IPC_MESSAGE_ROUTED0(ViewMsg_Close)
559
560 IPC_STRUCT_BEGIN(ViewMsg_Resize_Params)
561   IPC_STRUCT_MEMBER(blink::WebScreenInfo, screen_info)
562   IPC_STRUCT_MEMBER(gfx::Size, new_size)
563   IPC_STRUCT_MEMBER(gfx::Size, physical_backing_size)
564   IPC_STRUCT_MEMBER(float, top_controls_layout_height)
565   IPC_STRUCT_MEMBER(gfx::Size, visible_viewport_size)
566   IPC_STRUCT_MEMBER(gfx::Rect, resizer_rect)
567   IPC_STRUCT_MEMBER(bool, is_fullscreen)
568 IPC_STRUCT_END()
569
570 // Tells the render view to change its size.  A ViewHostMsg_UpdateRect message
571 // is generated in response provided new_size is not empty and not equal to
572 // the view's current size.  The generated ViewHostMsg_UpdateRect message will
573 // have the IS_RESIZE_ACK flag set. It also receives the resizer rect so that
574 // we don't have to fetch it every time WebKit asks for it.
575 IPC_MESSAGE_ROUTED1(ViewMsg_Resize,
576                     ViewMsg_Resize_Params /* params */)
577
578 // Tells the render view that the resize rect has changed.
579 IPC_MESSAGE_ROUTED1(ViewMsg_ChangeResizeRect,
580                     gfx::Rect /* resizer_rect */)
581
582 // Sent to inform the view that it was hidden.  This allows it to reduce its
583 // resource utilization.
584 IPC_MESSAGE_ROUTED0(ViewMsg_WasHidden)
585
586 // Tells the render view that it is no longer hidden (see WasHidden), and the
587 // render view is expected to respond with a full repaint if needs_repainting
588 // is true. If needs_repainting is false, then this message does not trigger a
589 // message in response.
590 IPC_MESSAGE_ROUTED2(ViewMsg_WasShown,
591                     bool /* needs_repainting */,
592                     ui::LatencyInfo /* latency_info */)
593
594 // Tells the renderer to focus the first (last if reverse is true) focusable
595 // node.
596 IPC_MESSAGE_ROUTED1(ViewMsg_SetInitialFocus,
597                     bool /* reverse */)
598
599 // Sent to inform the renderer to invoke a context menu.
600 // The parameter specifies the location in the render view's coordinates.
601 IPC_MESSAGE_ROUTED2(ViewMsg_ShowContextMenu,
602                     ui::MenuSourceType,
603                     gfx::Point /* location where menu should be shown */)
604
605 // Sent when the user wants to search for a word on the page (find in page).
606 IPC_MESSAGE_ROUTED3(ViewMsg_Find,
607                     int /* request_id */,
608                     base::string16 /* search_text */,
609                     blink::WebFindOptions)
610
611 // This message notifies the renderer that the user has closed the FindInPage
612 // window (and what action to take regarding the selection).
613 IPC_MESSAGE_ROUTED1(ViewMsg_StopFinding,
614                     content::StopFindAction /* action */)
615
616 // Copies the image at location x, y to the clipboard (if there indeed is an
617 // image at that location).
618 IPC_MESSAGE_ROUTED2(ViewMsg_CopyImageAt,
619                     int /* x */,
620                     int /* y */)
621
622 // Saves the image at location x, y to the disk (if there indeed is an
623 // image at that location).
624 IPC_MESSAGE_ROUTED2(ViewMsg_SaveImageAt,
625                     int /* x */,
626                     int /* y */)
627
628 // Tells the renderer to perform the given action on the media player
629 // located at the given point.
630 IPC_MESSAGE_ROUTED2(ViewMsg_MediaPlayerActionAt,
631                     gfx::Point, /* location */
632                     blink::WebMediaPlayerAction)
633
634 // Tells the renderer to perform the given action on the plugin located at
635 // the given point.
636 IPC_MESSAGE_ROUTED2(ViewMsg_PluginActionAt,
637                     gfx::Point, /* location */
638                     blink::WebPluginAction)
639
640 // Posts a message from a frame in another process to the current renderer.
641 IPC_MESSAGE_ROUTED1(ViewMsg_PostMessageEvent,
642                     ViewMsg_PostMessage_Params)
643
644 // Change the zoom level for the current main frame.  If the level actually
645 // changes, a ViewHostMsg_DidZoomURL message will be sent back to the browser
646 // telling it what url got zoomed and what its current zoom level is.
647 IPC_MESSAGE_ROUTED1(ViewMsg_Zoom,
648                     content::PageZoom /* function */)
649
650 // Set the zoom level for a particular url that the renderer is in the
651 // process of loading.  This will be stored, to be used if the load commits
652 // and ignored otherwise.
653 IPC_MESSAGE_ROUTED2(ViewMsg_SetZoomLevelForLoadingURL,
654                     GURL /* url */,
655                     double /* zoom_level */)
656
657 // Set the zoom level for a particular url, so all render views
658 // displaying this url can update their zoom levels to match.
659 // If scheme is empty, then only host is used for matching.
660 IPC_MESSAGE_CONTROL3(ViewMsg_SetZoomLevelForCurrentURL,
661                      std::string /* scheme */,
662                      std::string /* host */,
663                      double /* zoom_level */)
664
665 // Set the zoom level for a particular render view.
666 IPC_MESSAGE_ROUTED2(ViewMsg_SetZoomLevelForView,
667                     bool /* uses_temporary_zoom_level */,
668                     double /* zoom_level */)
669
670 // Change encoding of page in the renderer.
671 IPC_MESSAGE_ROUTED1(ViewMsg_SetPageEncoding,
672                     std::string /*new encoding name*/)
673
674 // Reset encoding of page in the renderer back to default.
675 IPC_MESSAGE_ROUTED0(ViewMsg_ResetPageEncodingToDefault)
676
677 // Used to tell a render view whether it should expose various bindings
678 // that allow JS content extended privileges.  See BindingsPolicy for valid
679 // flag values.
680 IPC_MESSAGE_ROUTED1(ViewMsg_AllowBindings,
681                     int /* enabled_bindings_flags */)
682
683 // Tell the renderer to add a property to the WebUI binding object.  This
684 // only works if we allowed WebUI bindings.
685 IPC_MESSAGE_ROUTED2(ViewMsg_SetWebUIProperty,
686                     std::string /* property_name */,
687                     std::string /* property_value_json */)
688
689 // This message starts/stop monitoring the input method status of the focused
690 // edit control of a renderer process.
691 // Parameters
692 // * is_active (bool)
693 //   Indicates if an input method is active in the browser process.
694 //   The possible actions when a renderer process receives this message are
695 //   listed below:
696 //     Value Action
697 //     true  Start sending IPC message ViewHostMsg_ImeUpdateTextInputState
698 //           to notify the input method status of the focused edit control.
699 //     false Stop sending IPC message ViewHostMsg_ImeUpdateTextInputState.
700 IPC_MESSAGE_ROUTED1(ViewMsg_SetInputMethodActive,
701                     bool /* is_active */)
702
703 // IME API oncandidatewindow* events for InputMethodContext.
704 IPC_MESSAGE_ROUTED0(ViewMsg_CandidateWindowShown)
705 IPC_MESSAGE_ROUTED0(ViewMsg_CandidateWindowUpdated)
706 IPC_MESSAGE_ROUTED0(ViewMsg_CandidateWindowHidden)
707
708 // Used to notify the render-view that we have received a target URL. Used
709 // to prevent target URLs spamming the browser.
710 IPC_MESSAGE_ROUTED0(ViewMsg_UpdateTargetURL_ACK)
711
712 IPC_MESSAGE_ROUTED1(ViewMsg_RunFileChooserResponse,
713                     std::vector<ui::SelectedFileInfo>)
714
715 // Provides the results of directory enumeration.
716 IPC_MESSAGE_ROUTED2(ViewMsg_EnumerateDirectoryResponse,
717                     int /* request_id */,
718                     std::vector<base::FilePath> /* files_in_directory */)
719
720 // When a renderer sends a ViewHostMsg_Focus to the browser process,
721 // the browser has the option of sending a ViewMsg_CantFocus back to
722 // the renderer.
723 IPC_MESSAGE_ROUTED0(ViewMsg_CantFocus)
724
725 // Tells the renderer to suppress any further modal dialogs until it receives a
726 // corresponding ViewMsg_SwapOut message.  This ensures that no
727 // PageGroupLoadDeferrer is on the stack for SwapOut.
728 IPC_MESSAGE_ROUTED0(ViewMsg_SuppressDialogsUntilSwapOut)
729
730 // Instructs the renderer to close the current page, including running the
731 // onunload event handler.
732 //
733 // Expects a ClosePage_ACK message when finished.
734 IPC_MESSAGE_ROUTED0(ViewMsg_ClosePage)
735
736 // Notifies the renderer about ui theme changes
737 IPC_MESSAGE_ROUTED0(ViewMsg_ThemeChanged)
738
739 // Notifies the renderer that a paint is to be generated for the rectangle
740 // passed in.
741 IPC_MESSAGE_ROUTED1(ViewMsg_Repaint,
742                     gfx::Size /* The view size to be repainted */)
743
744 // Notification that a move or resize renderer's containing window has
745 // started.
746 IPC_MESSAGE_ROUTED0(ViewMsg_MoveOrResizeStarted)
747
748 IPC_MESSAGE_ROUTED2(ViewMsg_UpdateScreenRects,
749                     gfx::Rect /* view_screen_rect */,
750                     gfx::Rect /* window_screen_rect */)
751
752 // Reply to ViewHostMsg_RequestMove, ViewHostMsg_ShowView, and
753 // ViewHostMsg_ShowWidget to inform the renderer that the browser has
754 // processed the move.  The browser may have ignored the move, but it finished
755 // processing.  This is used because the renderer keeps a temporary cache of
756 // the widget position while these asynchronous operations are in progress.
757 IPC_MESSAGE_ROUTED0(ViewMsg_Move_ACK)
758
759 // Used to instruct the RenderView to send back updates to the preferred size.
760 IPC_MESSAGE_ROUTED0(ViewMsg_EnablePreferredSizeChangedMode)
761
762 // Used to instruct the RenderView to automatically resize and send back
763 // updates for the new size.
764 IPC_MESSAGE_ROUTED2(ViewMsg_EnableAutoResize,
765                     gfx::Size /* min_size */,
766                     gfx::Size /* max_size */)
767
768 // Used to instruct the RenderView to disalbe automatically resize.
769 IPC_MESSAGE_ROUTED1(ViewMsg_DisableAutoResize,
770                     gfx::Size /* new_size */)
771
772 // Changes the text direction of the currently selected input field (if any).
773 IPC_MESSAGE_ROUTED1(ViewMsg_SetTextDirection,
774                     blink::WebTextDirection /* direction */)
775
776 // Tells the renderer to clear the focused element (if any).
777 IPC_MESSAGE_ROUTED0(ViewMsg_ClearFocusedElement)
778
779 // Make the RenderView background transparent or opaque.
780 IPC_MESSAGE_ROUTED1(ViewMsg_SetBackgroundOpaque, bool /* opaque */)
781
782 // Used to tell the renderer not to add scrollbars with height and
783 // width below a threshold.
784 IPC_MESSAGE_ROUTED1(ViewMsg_DisableScrollbarsForSmallWindows,
785                     gfx::Size /* disable_scrollbar_size_limit */)
786
787 // Activate/deactivate the RenderView (i.e., set its controls' tint
788 // accordingly, etc.).
789 IPC_MESSAGE_ROUTED1(ViewMsg_SetActive,
790                     bool /* active */)
791
792 // Response message to ViewHostMsg_CreateWorker.
793 // Sent when the worker has started.
794 IPC_MESSAGE_ROUTED0(ViewMsg_WorkerCreated)
795
796 // Sent when the worker failed to load the worker script.
797 // In normal cases, this message is sent after ViewMsg_WorkerCreated is sent.
798 // But if the shared worker of the same URL already exists and it has failed
799 // to load the script, when the renderer send ViewHostMsg_CreateWorker before
800 // the shared worker is killed only ViewMsg_WorkerScriptLoadFailed is sent.
801 IPC_MESSAGE_ROUTED0(ViewMsg_WorkerScriptLoadFailed)
802
803 // Sent when the worker has connected.
804 // This message is sent only if the worker successfully loaded the script.
805 IPC_MESSAGE_ROUTED0(ViewMsg_WorkerConnected)
806
807 // Tells the renderer that the network type has changed so that navigator.onLine
808 // and navigator.connection can be updated.
809 IPC_MESSAGE_CONTROL1(ViewMsg_NetworkTypeChanged,
810                      net::NetworkChangeNotifier::ConnectionType /* type */)
811
812 #if defined(ENABLE_PLUGINS)
813 // Reply to ViewHostMsg_OpenChannelToPpapiBroker
814 // Tells the renderer that the channel to the broker has been created.
815 IPC_MESSAGE_ROUTED2(ViewMsg_PpapiBrokerChannelCreated,
816                     base::ProcessId /* broker_pid */,
817                     IPC::ChannelHandle /* handle */)
818
819 // Reply to ViewHostMsg_RequestPpapiBrokerPermission.
820 // Tells the renderer whether permission to access to PPAPI broker was granted
821 // or not.
822 IPC_MESSAGE_ROUTED1(ViewMsg_PpapiBrokerPermissionResult,
823                     bool /* result */)
824
825 // Tells the renderer to empty its plugin list cache, optional reloading
826 // pages containing plugins.
827 IPC_MESSAGE_CONTROL1(ViewMsg_PurgePluginListCache,
828                      bool /* reload_pages */)
829 #endif
830
831 // Used to instruct the RenderView to go into "view source" mode.
832 IPC_MESSAGE_ROUTED0(ViewMsg_EnableViewSourceMode)
833
834 // Instructs the renderer to save the current page to MHTML.
835 IPC_MESSAGE_ROUTED2(ViewMsg_SavePageAsMHTML,
836                     int /* job_id */,
837                     IPC::PlatformFileForTransit /* file handle */)
838
839 // Temporary message to diagnose an unexpected condition in WebContentsImpl.
840 IPC_MESSAGE_CONTROL1(ViewMsg_TempCrashWithData,
841                      GURL /* data */)
842
843 // An acknowledge to ViewHostMsg_MultipleTargetsTouched to notify the renderer
844 // process to release the magnified image.
845 IPC_MESSAGE_ROUTED1(ViewMsg_ReleaseDisambiguationPopupBitmap,
846                     cc::SharedBitmapId /* id */)
847
848 // Notifies the renderer that a snapshot has been retrieved.
849 IPC_MESSAGE_ROUTED3(ViewMsg_WindowSnapshotCompleted,
850                     int /* snapshot_id */,
851                     gfx::Size /* size */,
852                     std::vector<unsigned char> /* png */)
853
854 // Fetches complete rendered content of a web page as plain text.
855 IPC_MESSAGE_ROUTED0(ViewMsg_GetRenderedText)
856
857 #if defined(OS_MACOSX)
858 IPC_ENUM_TRAITS_MAX_VALUE(blink::ScrollerStyle, blink::ScrollerStyleOverlay)
859
860 // Notification of a change in scrollbar appearance and/or behavior.
861 IPC_MESSAGE_CONTROL5(ViewMsg_UpdateScrollbarTheme,
862                      float /* initial_button_delay */,
863                      float /* autoscroll_button_delay */,
864                      bool /* jump_on_track_click */,
865                      blink::ScrollerStyle /* preferred_scroller_style */,
866                      bool /* redraw */)
867 #endif
868
869 #if defined(OS_ANDROID)
870 // Tells the renderer to suspend/resume the webkit timers.
871 IPC_MESSAGE_CONTROL1(ViewMsg_SetWebKitSharedTimersSuspended,
872                      bool /* suspend */)
873
874 // Sent when the browser wants the bounding boxes of the current find matches.
875 //
876 // If match rects are already cached on the browser side, |current_version|
877 // should be the version number from the ViewHostMsg_FindMatchRects_Reply
878 // they came in, so the renderer can tell if it needs to send updated rects.
879 // Otherwise just pass -1 to always receive the list of rects.
880 //
881 // There must be an active search string (it is probably most useful to call
882 // this immediately after a ViewHostMsg_Find_Reply message arrives with
883 // final_update set to true).
884 IPC_MESSAGE_ROUTED1(ViewMsg_FindMatchRects,
885                     int /* current_version */)
886
887 // Notifies the renderer whether hiding/showing the top controls is enabled
888 // and whether or not to animate to the proper state.
889 IPC_MESSAGE_ROUTED3(ViewMsg_UpdateTopControlsState,
890                     bool /* enable_hiding */,
891                     bool /* enable_showing */,
892                     bool /* animate */)
893
894 IPC_MESSAGE_ROUTED0(ViewMsg_ShowImeIfNeeded)
895
896 // Sent by the browser when the renderer should generate a new frame.
897 IPC_MESSAGE_ROUTED1(ViewMsg_BeginFrame,
898                     cc::BeginFrameArgs /* args */)
899
900 // Sent by the browser when an IME update that requires acknowledgement has been
901 // processed on the browser side.
902 IPC_MESSAGE_ROUTED0(ViewMsg_ImeEventAck)
903
904 // Extracts the data at the given rect, returning it through the
905 // ViewHostMsg_SmartClipDataExtracted IPC.
906 IPC_MESSAGE_ROUTED1(ViewMsg_ExtractSmartClipData,
907                     gfx::Rect /* rect */)
908
909 #elif defined(OS_MACOSX)
910 // Let the RenderView know its window has changed visibility.
911 IPC_MESSAGE_ROUTED1(ViewMsg_SetWindowVisibility,
912                     bool /* visibile */)
913
914 // Let the RenderView know its window's frame has changed.
915 IPC_MESSAGE_ROUTED2(ViewMsg_WindowFrameChanged,
916                     gfx::Rect /* window frame */,
917                     gfx::Rect /* content view frame */)
918
919 // Message sent from the browser to the renderer when the user starts or stops
920 // resizing the view.
921 IPC_MESSAGE_ROUTED1(ViewMsg_SetInLiveResize,
922                     bool /* enable */)
923
924 // Tell the renderer that plugin IME has completed.
925 IPC_MESSAGE_ROUTED2(ViewMsg_PluginImeCompositionCompleted,
926                     base::string16 /* text */,
927                     int /* plugin_id */)
928 #endif
929
930 // Sent by the browser as a reply to ViewHostMsg_SwapCompositorFrame.
931 IPC_MESSAGE_ROUTED2(ViewMsg_SwapCompositorFrameAck,
932                     uint32 /* output_surface_id */,
933                     cc::CompositorFrameAck /* ack */)
934
935 // Sent by browser to tell renderer compositor that some resources that were
936 // given to the browser in a swap are not being used anymore.
937 IPC_MESSAGE_ROUTED2(ViewMsg_ReclaimCompositorResources,
938                     uint32 /* output_surface_id */,
939                     cc::CompositorFrameAck /* ack */)
940
941 IPC_MESSAGE_ROUTED0(ViewMsg_SelectWordAroundCaret)
942
943 // Sent by the browser to ask the renderer to redraw.
944 // If |request_id| is not zero, it is added to the forced frame's latency info
945 // as ui::WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT.
946 IPC_MESSAGE_ROUTED1(ViewMsg_ForceRedraw,
947                     int /* request_id */)
948
949 // -----------------------------------------------------------------------------
950 // Messages sent from the renderer to the browser.
951
952 // Sent by the renderer when it is creating a new window.  The browser creates
953 // a tab for it and responds with a ViewMsg_CreatingNew_ACK.  If route_id is
954 // MSG_ROUTING_NONE, the view couldn't be created.
955 IPC_SYNC_MESSAGE_CONTROL1_4(ViewHostMsg_CreateWindow,
956                             ViewHostMsg_CreateWindow_Params,
957                             int /* route_id */,
958                             int /* main_frame_route_id */,
959                             int32 /* surface_id */,
960                             int64 /* cloned_session_storage_namespace_id */)
961
962 // Similar to ViewHostMsg_CreateWindow, except used for sub-widgets, like
963 // <select> dropdowns.  This message is sent to the WebContentsImpl that
964 // contains the widget being created.
965 IPC_SYNC_MESSAGE_CONTROL2_2(ViewHostMsg_CreateWidget,
966                             int /* opener_id */,
967                             blink::WebPopupType /* popup type */,
968                             int /* route_id */,
969                             int32 /* surface_id */)
970
971 // Similar to ViewHostMsg_CreateWidget except the widget is a full screen
972 // window.
973 IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_CreateFullscreenWidget,
974                             int /* opener_id */,
975                             int /* route_id */,
976                             int32 /* surface_id */)
977
978 // Asks the browser for a unique routing ID.
979 IPC_SYNC_MESSAGE_CONTROL0_1(ViewHostMsg_GenerateRoutingID,
980                             int /* routing_id */)
981
982 // Asks the browser for the default audio hardware configuration.
983 IPC_SYNC_MESSAGE_CONTROL0_2(ViewHostMsg_GetAudioHardwareConfig,
984                             media::AudioParameters /* input parameters */,
985                             media::AudioParameters /* output parameters */)
986
987 // Asks the browser for the renderer process memory size stats.
988 IPC_SYNC_MESSAGE_CONTROL0_2(ViewHostMsg_GetProcessMemorySizes,
989                             size_t /* private_bytes */,
990                             size_t /* shared_bytes */)
991
992 // These three messages are sent to the parent RenderViewHost to display the
993 // page/widget that was created by
994 // CreateWindow/CreateWidget/CreateFullscreenWidget. routing_id
995 // refers to the id that was returned from the Create message above.
996 // The initial_position parameter is a rectangle in screen coordinates.
997 //
998 // FUTURE: there will probably be flags here to control if the result is
999 // in a new window.
1000 IPC_MESSAGE_ROUTED4(ViewHostMsg_ShowView,
1001                     int /* route_id */,
1002                     WindowOpenDisposition /* disposition */,
1003                     gfx::Rect /* initial_pos */,
1004                     bool /* opened_by_user_gesture */)
1005
1006 IPC_MESSAGE_ROUTED2(ViewHostMsg_ShowWidget,
1007                     int /* route_id */,
1008                     gfx::Rect /* initial_pos */)
1009
1010 // Message to show a full screen widget.
1011 IPC_MESSAGE_ROUTED1(ViewHostMsg_ShowFullscreenWidget,
1012                     int /* route_id */)
1013
1014 // This message is sent after ViewHostMsg_ShowView to cause the RenderView
1015 // to run in a modal fashion until it is closed.
1016 IPC_SYNC_MESSAGE_ROUTED1_0(ViewHostMsg_RunModal,
1017                            int /* opener_id */)
1018
1019 // Indicates the renderer is ready in response to a ViewMsg_New or
1020 // a ViewMsg_CreatingNew_ACK.
1021 IPC_MESSAGE_ROUTED0(ViewHostMsg_RenderViewReady)
1022
1023 // Indicates the renderer process is gone.  This actually is sent by the
1024 // browser process to itself, but keeps the interface cleaner.
1025 IPC_MESSAGE_ROUTED2(ViewHostMsg_RenderProcessGone,
1026                     int, /* this really is base::TerminationStatus */
1027                     int /* exit_code */)
1028
1029 // Sent by the renderer process to request that the browser close the view.
1030 // This corresponds to the window.close() API, and the browser may ignore
1031 // this message.  Otherwise, the browser will generates a ViewMsg_Close
1032 // message to close the view.
1033 IPC_MESSAGE_ROUTED0(ViewHostMsg_Close)
1034
1035 // Send in response to a ViewMsg_UpdateScreenRects so that the renderer can
1036 // throttle these messages.
1037 IPC_MESSAGE_ROUTED0(ViewHostMsg_UpdateScreenRects_ACK)
1038
1039 // Sent by the renderer process to request that the browser move the view.
1040 // This corresponds to the window.resizeTo() and window.moveTo() APIs, and
1041 // the browser may ignore this message.
1042 IPC_MESSAGE_ROUTED1(ViewHostMsg_RequestMove,
1043                     gfx::Rect /* position */)
1044
1045 // Result of string search in the page.
1046 // Response to ViewMsg_Find with the results of the requested find-in-page
1047 // search, the number of matches found and the selection rect (in screen
1048 // coordinates) for the string found. If |final_update| is false, it signals
1049 // that this is not the last Find_Reply message - more will be sent as the
1050 // scoping effort continues.
1051 IPC_MESSAGE_ROUTED5(ViewHostMsg_Find_Reply,
1052                     int /* request_id */,
1053                     int /* number of matches */,
1054                     gfx::Rect /* selection_rect */,
1055                     int /* active_match_ordinal */,
1056                     bool /* final_update */)
1057
1058 // Indicates that the render view has been closed in respose to a
1059 // Close message.
1060 IPC_MESSAGE_CONTROL1(ViewHostMsg_Close_ACK,
1061                      int /* old_route_id */)
1062
1063 // Indicates that the current page has been closed, after a ClosePage
1064 // message.
1065 IPC_MESSAGE_ROUTED0(ViewHostMsg_ClosePage_ACK)
1066
1067 // Notifies the browser that we have session history information.
1068 // page_id: unique ID that allows us to distinguish between history entries.
1069 IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateState,
1070                     int32 /* page_id */,
1071                     content::PageState /* state */)
1072
1073 // Notifies the browser that we want to show a destination url for a potential
1074 // action (e.g. when the user is hovering over a link).
1075 IPC_MESSAGE_ROUTED1(ViewHostMsg_UpdateTargetURL,
1076                     GURL)
1077
1078 // Sent when the document element is available for the top-level frame.  This
1079 // happens after the page starts loading, but before all resources are
1080 // finished.
1081 IPC_MESSAGE_ROUTED1(ViewHostMsg_DocumentAvailableInMainFrame,
1082                     bool /* uses_temporary_zoom_level */)
1083
1084 // Sent when the renderer loads a resource from its memory cache.
1085 // The security info is non empty if the resource was originally loaded over
1086 // a secure connection.
1087 // Note: May only be sent once per URL per frame per committed load.
1088 IPC_MESSAGE_ROUTED5(ViewHostMsg_DidLoadResourceFromMemoryCache,
1089                     GURL /* url */,
1090                     std::string  /* security info */,
1091                     std::string  /* http method */,
1092                     std::string  /* mime type */,
1093                     content::ResourceType /* resource type */)
1094
1095 // Sent when the renderer displays insecure content in a secure page.
1096 IPC_MESSAGE_ROUTED0(ViewHostMsg_DidDisplayInsecureContent)
1097
1098 // Sent when the renderer runs insecure content in a secure origin.
1099 IPC_MESSAGE_ROUTED2(ViewHostMsg_DidRunInsecureContent,
1100                     std::string  /* security_origin */,
1101                     GURL         /* target URL */)
1102
1103 // Sent to update part of the view.  In response to this message, the host
1104 // generates a ViewMsg_UpdateRect_ACK message.
1105 IPC_MESSAGE_ROUTED1(ViewHostMsg_UpdateRect,
1106                     ViewHostMsg_UpdateRect_Params)
1107
1108 IPC_MESSAGE_ROUTED0(ViewHostMsg_Focus)
1109 IPC_MESSAGE_ROUTED0(ViewHostMsg_Blur)
1110
1111 // Message sent from renderer to the browser when focus changes inside the
1112 // webpage. The parameter says whether the newly focused element needs
1113 // keyboard input (true for textfields, text areas and content editable divs).
1114 IPC_MESSAGE_ROUTED1(ViewHostMsg_FocusedNodeChanged,
1115     bool /* is_editable_node */)
1116
1117 IPC_MESSAGE_ROUTED1(ViewHostMsg_SetCursor, content::WebCursor)
1118
1119 // Used to set a cookie. The cookie is set asynchronously, but will be
1120 // available to a subsequent ViewHostMsg_GetCookies request.
1121 IPC_MESSAGE_CONTROL4(ViewHostMsg_SetCookie,
1122                      int /* render_frame_id */,
1123                      GURL /* url */,
1124                      GURL /* first_party_for_cookies */,
1125                      std::string /* cookie */)
1126
1127 // Used to get cookies for the given URL. This may block waiting for a
1128 // previous SetCookie message to be processed.
1129 IPC_SYNC_MESSAGE_CONTROL3_1(ViewHostMsg_GetCookies,
1130                             int /* render_frame_id */,
1131                             GURL /* url */,
1132                             GURL /* first_party_for_cookies */,
1133                             std::string /* cookies */)
1134
1135 // Used to get raw cookie information for the given URL. This may block
1136 // waiting for a previous SetCookie message to be processed.
1137 IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_GetRawCookies,
1138                             GURL /* url */,
1139                             GURL /* first_party_for_cookies */,
1140                             std::vector<content::CookieData>
1141                                 /* raw_cookies */)
1142
1143 // Used to delete cookie for the given URL and name
1144 IPC_SYNC_MESSAGE_CONTROL2_0(ViewHostMsg_DeleteCookie,
1145                             GURL /* url */,
1146                             std::string /* cookie_name */)
1147
1148 // Used to check if cookies are enabled for the given URL. This may block
1149 // waiting for a previous SetCookie message to be processed.
1150 IPC_SYNC_MESSAGE_CONTROL3_1(ViewHostMsg_CookiesEnabled,
1151                             int /* render_frame_id */,
1152                             GURL /* url */,
1153                             GURL /* first_party_for_cookies */,
1154                             bool /* cookies_enabled */)
1155
1156 // Used to get the list of plugins
1157 IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_GetPlugins,
1158     bool /* refresh*/,
1159     std::vector<content::WebPluginInfo> /* plugins */)
1160
1161 #if defined(OS_WIN)
1162 IPC_MESSAGE_ROUTED1(ViewHostMsg_WindowlessPluginDummyWindowCreated,
1163                     gfx::NativeViewId /* dummy_activation_window */)
1164
1165 IPC_MESSAGE_ROUTED1(ViewHostMsg_WindowlessPluginDummyWindowDestroyed,
1166                     gfx::NativeViewId /* dummy_activation_window */)
1167
1168 // Asks the browser for the user's monitor profile.
1169 IPC_SYNC_MESSAGE_CONTROL0_1(ViewHostMsg_GetMonitorColorProfile,
1170                             std::vector<char> /* profile */)
1171 #endif
1172
1173 // Get the list of proxies to use for |url|, as a semicolon delimited list
1174 // of "<TYPE> <HOST>:<PORT>" | "DIRECT".
1175 IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_ResolveProxy,
1176                             GURL /* url */,
1177                             bool /* result */,
1178                             std::string /* proxy list */)
1179
1180 // A renderer sends this to the browser process when it wants to create a
1181 // worker.  The browser will create the worker process if necessary, and
1182 // will return the route id on success.  On error returns MSG_ROUTING_NONE.
1183 IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_CreateWorker,
1184                             ViewHostMsg_CreateWorker_Params,
1185                             int /* route_id */)
1186
1187 // A renderer sends this to the browser process when a document has been
1188 // detached. The browser will use this to constrain the lifecycle of worker
1189 // processes (SharedWorkers are shut down when their last associated document
1190 // is detached).
1191 IPC_MESSAGE_CONTROL1(ViewHostMsg_DocumentDetached,
1192                      uint64 /* document_id */)
1193
1194 // Wraps an IPC message that's destined to the worker on the renderer->browser
1195 // hop.
1196 IPC_MESSAGE_CONTROL1(ViewHostMsg_ForwardToWorker,
1197                      IPC::Message /* message */)
1198
1199 // Tells the browser that a specific Appcache manifest in the current page
1200 // was accessed.
1201 IPC_MESSAGE_ROUTED2(ViewHostMsg_AppCacheAccessed,
1202                     GURL /* manifest url */,
1203                     bool /* blocked by policy */)
1204
1205 // Initiates a download based on user actions like 'ALT+click'.
1206 IPC_MESSAGE_CONTROL4(ViewHostMsg_DownloadUrl,
1207                      int /* render_view_id */,
1208                      GURL /* url */,
1209                      content::Referrer /* referrer */,
1210                      base::string16 /* suggested_name */)
1211
1212 // Used to go to the session history entry at the given offset (ie, -1 will
1213 // return the "back" item).
1214 IPC_MESSAGE_ROUTED1(ViewHostMsg_GoToEntryAtOffset,
1215                     int /* offset (from current) of history item to get */)
1216
1217 // Sent from an inactive renderer for the browser to route to the active
1218 // renderer, instructing it to close.
1219 IPC_MESSAGE_ROUTED0(ViewHostMsg_RouteCloseEvent)
1220
1221 // Sent to the browser from an inactive renderer to post a message to the
1222 // active renderer.
1223 IPC_MESSAGE_ROUTED1(ViewHostMsg_RouteMessageEvent,
1224                     ViewMsg_PostMessage_Params)
1225
1226 // Notifies that the preferred size of the content changed.
1227 IPC_MESSAGE_ROUTED1(ViewHostMsg_DidContentsPreferredSizeChange,
1228                     gfx::Size /* pref_size */)
1229
1230 // Notifies whether there are JavaScript touch event handlers or not.
1231 IPC_MESSAGE_ROUTED1(ViewHostMsg_HasTouchEventHandlers,
1232                     bool /* has_handlers */)
1233
1234 // A message from HTML-based UI.  When (trusted) Javascript calls
1235 // send(message, args), this message is sent to the browser.
1236 IPC_MESSAGE_ROUTED3(ViewHostMsg_WebUISend,
1237                     GURL /* source_url */,
1238                     std::string  /* message */,
1239                     base::ListValue /* args */)
1240
1241 #if defined(ENABLE_PLUGINS)
1242 // A renderer sends this to the browser process when it wants to create a ppapi
1243 // plugin.  The browser will create the plugin process if necessary, and will
1244 // return a handle to the channel on success.
1245 //
1246 // The plugin_child_id is the ChildProcessHost ID assigned in the browser
1247 // process. This ID is valid only in the context of the browser process and is
1248 // used to identify the proper process when the renderer notifies it that the
1249 // plugin is hung.
1250 //
1251 // On error an empty string and null handles are returned.
1252 IPC_SYNC_MESSAGE_CONTROL1_3(ViewHostMsg_OpenChannelToPepperPlugin,
1253                             base::FilePath /* path */,
1254                             IPC::ChannelHandle /* handle to channel */,
1255                             base::ProcessId /* plugin_pid */,
1256                             int /* plugin_child_id */)
1257
1258 // Notification that a plugin has created a new plugin instance. The parameters
1259 // indicate:
1260 // -The plugin process ID that we're creating the instance for.
1261 // -The instance ID of the instance being created.
1262 // -A PepperRendererInstanceData struct which contains properties from the
1263 // renderer which are associated with the plugin instance. This includes the
1264 // routing ID of the associated render view and the URL of plugin.
1265 // -Whether the plugin we're creating an instance for is external or internal.
1266 //
1267 // This message must be sync even though it returns no parameters to avoid
1268 // a race condition with the plugin process. The plugin process sends messages
1269 // to the browser that assume the browser knows about the instance. We need to
1270 // make sure that the browser actually knows about the instance before we tell
1271 // the plugin to run.
1272 IPC_SYNC_MESSAGE_CONTROL4_0(
1273     ViewHostMsg_DidCreateOutOfProcessPepperInstance,
1274     int /* plugin_child_id */,
1275     int32 /* pp_instance */,
1276     content::PepperRendererInstanceData /* creation_data */,
1277     bool /* is_external */)
1278
1279 // Notification that a plugin has destroyed an instance. This is the opposite of
1280 // the "DidCreate" message above.
1281 IPC_MESSAGE_CONTROL3(ViewHostMsg_DidDeleteOutOfProcessPepperInstance,
1282                      int /* plugin_child_id */,
1283                      int32 /* pp_instance */,
1284                      bool /* is_external */)
1285
1286 // Message from the renderer to the browser indicating the in-process instance
1287 // has been created.
1288 IPC_MESSAGE_CONTROL2(ViewHostMsg_DidCreateInProcessInstance,
1289                      int32 /* instance */,
1290                      content::PepperRendererInstanceData /* instance_data */)
1291
1292 // Message from the renderer to the browser indicating the in-process instance
1293 // has been destroyed.
1294 IPC_MESSAGE_CONTROL1(ViewHostMsg_DidDeleteInProcessInstance,
1295                      int32 /* instance */)
1296
1297 // A renderer sends this to the browser process when it wants to
1298 // create a ppapi broker.  The browser will create the broker process
1299 // if necessary, and will return a handle to the channel on success.
1300 // On error an empty string is returned.
1301 // The browser will respond with ViewMsg_PpapiBrokerChannelCreated.
1302 IPC_MESSAGE_CONTROL2(ViewHostMsg_OpenChannelToPpapiBroker,
1303                      int /* routing_id */,
1304                      base::FilePath /* path */)
1305
1306 // A renderer sends this to the browser process when it wants to access a PPAPI
1307 // broker. In contrast to ViewHostMsg_OpenChannelToPpapiBroker, this is called
1308 // for every connection.
1309 // The browser will respond with ViewMsg_PpapiBrokerPermissionResult.
1310 IPC_MESSAGE_ROUTED3(ViewHostMsg_RequestPpapiBrokerPermission,
1311                     int /* routing_id */,
1312                     GURL /* document_url */,
1313                     base::FilePath /* plugin_path */)
1314 #endif  // defined(ENABLE_PLUGINS)
1315
1316 // Send the tooltip text for the current mouse position to the browser.
1317 IPC_MESSAGE_ROUTED2(ViewHostMsg_SetTooltipText,
1318                     base::string16 /* tooltip text string */,
1319                     blink::WebTextDirection /* text direction hint */)
1320
1321 IPC_MESSAGE_ROUTED0(ViewHostMsg_SelectRange_ACK)
1322 IPC_MESSAGE_ROUTED0(ViewHostMsg_MoveCaret_ACK)
1323
1324 // Notification that the text selection has changed.
1325 // Note: The secound parameter is the character based offset of the
1326 // base::string16
1327 // text in the document.
1328 IPC_MESSAGE_ROUTED3(ViewHostMsg_SelectionChanged,
1329                     base::string16 /* text covers the selection range */,
1330                     size_t /* the offset of the text in the document */,
1331                     gfx::Range /* selection range in the document */)
1332
1333 // Notification that the selection bounds have changed.
1334 IPC_MESSAGE_ROUTED1(ViewHostMsg_SelectionBoundsChanged,
1335                     ViewHostMsg_SelectionBounds_Params)
1336
1337 // Asks the browser to display the file chooser.  The result is returned in a
1338 // ViewMsg_RunFileChooserResponse message.
1339 IPC_MESSAGE_ROUTED1(ViewHostMsg_RunFileChooser,
1340                     content::FileChooserParams)
1341
1342 // Asks the browser to enumerate a directory.  This is equivalent to running
1343 // the file chooser in directory-enumeration mode and having the user select
1344 // the given directory.  The result is returned in a
1345 // ViewMsg_EnumerateDirectoryResponse message.
1346 IPC_MESSAGE_ROUTED2(ViewHostMsg_EnumerateDirectory,
1347                     int /* request_id */,
1348                     base::FilePath /* file_path */)
1349
1350 // Asks the browser to save a image (for <canvas> or <img>) from a data URL.
1351 // Note: |data_url| is the contents of a data:URL, and that it's represented as
1352 // a string only to work around size limitations for GURLs in IPC messages.
1353 IPC_MESSAGE_CONTROL2(ViewHostMsg_SaveImageFromDataURL,
1354                      int /* render_view_id */,
1355                      std::string /* data_url */)
1356
1357 // Tells the browser to move the focus to the next (previous if reverse is
1358 // true) focusable element.
1359 IPC_MESSAGE_ROUTED1(ViewHostMsg_TakeFocus,
1360                     bool /* reverse */)
1361
1362 // Required for opening a date/time dialog
1363 IPC_MESSAGE_ROUTED1(ViewHostMsg_OpenDateTimeDialog,
1364                     ViewHostMsg_DateTimeDialogValue_Params /* value */)
1365
1366 IPC_MESSAGE_ROUTED3(ViewHostMsg_TextInputTypeChanged,
1367                     ui::TextInputType /* TextInputType of the focused node */,
1368                     ui::TextInputMode /* TextInputMode of the focused node */,
1369                     bool /* can_compose_inline in the focused node */)
1370
1371 // Required for updating text input state.
1372 IPC_MESSAGE_ROUTED1(ViewHostMsg_TextInputStateChanged,
1373                     ViewHostMsg_TextInputState_Params /* input state params */)
1374
1375 // Sent when the renderer changes the zoom level for a particular url, so the
1376 // browser can update its records.  If the view is a plugin doc, then url is
1377 // used to update the zoom level for all pages in that site.  Otherwise, the
1378 // render view's id is used so that only the menu is updated.
1379 IPC_MESSAGE_ROUTED2(ViewHostMsg_DidZoomURL,
1380                     double /* zoom_level */,
1381                     GURL /* url */)
1382
1383 // Updates the minimum/maximum allowed zoom percent for this tab from the
1384 // default values.  If |remember| is true, then the zoom setting is applied to
1385 // other pages in the site and is saved, otherwise it only applies to this
1386 // tab.
1387 IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateZoomLimits,
1388                     int /* minimum_percent */,
1389                     int /* maximum_percent */)
1390
1391 // Notify the browser that this render process can or can't be suddenly
1392 // terminated.
1393 IPC_MESSAGE_CONTROL1(ViewHostMsg_SuddenTerminationChanged,
1394                      bool /* enabled */)
1395
1396 IPC_MESSAGE_ROUTED3(
1397     ViewHostMsg_SwapCompositorFrame,
1398     uint32 /* output_surface_id */,
1399     cc::CompositorFrame /* frame */,
1400     std::vector<IPC::Message> /* messages_to_deliver_with_frame */)
1401
1402 // Sent by the compositor when a flinging animation is stopped.
1403 IPC_MESSAGE_ROUTED0(ViewHostMsg_DidStopFlinging)
1404
1405 //---------------------------------------------------------------------------
1406 // Request for cryptographic operation messages:
1407 // These are messages from the renderer to the browser to perform a
1408 // cryptographic operation.
1409
1410 // Asks the browser process to generate a keypair for grabbing a client
1411 // certificate from a CA (<keygen> tag), and returns the signed public
1412 // key and challenge string.
1413 IPC_SYNC_MESSAGE_CONTROL3_1(ViewHostMsg_Keygen,
1414                             uint32 /* key size index */,
1415                             std::string /* challenge string */,
1416                             GURL /* URL of requestor */,
1417                             std::string /* signed public key and challenge */)
1418
1419 // Message sent from the renderer to the browser to request that the browser
1420 // cache |data| associated with |url|.
1421 IPC_MESSAGE_CONTROL3(ViewHostMsg_DidGenerateCacheableMetadata,
1422                      GURL /* url */,
1423                      double /* expected_response_time */,
1424                      std::vector<char> /* data */)
1425
1426 // Register a new handler for URL requests with the given scheme.
1427 IPC_MESSAGE_ROUTED4(ViewHostMsg_RegisterProtocolHandler,
1428                     std::string /* scheme */,
1429                     GURL /* url */,
1430                     base::string16 /* title */,
1431                     bool /* user_gesture */)
1432
1433 // Unregister the registered handler for URL requests with the given scheme.
1434 IPC_MESSAGE_ROUTED3(ViewHostMsg_UnregisterProtocolHandler,
1435                     std::string /* scheme */,
1436                     GURL /* url */,
1437                     bool /* user_gesture */)
1438
1439 // Puts the browser into "tab fullscreen" mode for the sending renderer.
1440 // See the comment in chrome/browser/ui/browser.h for more details.
1441 IPC_MESSAGE_ROUTED1(ViewHostMsg_ToggleFullscreen,
1442                     bool /* enter_fullscreen */)
1443
1444 // Send back a string to be recorded by UserMetrics.
1445 IPC_MESSAGE_CONTROL1(ViewHostMsg_UserMetricsRecordAction,
1446                      std::string /* action */)
1447
1448 // Notifies the browser that the page was or was not saved as MHTML.
1449 IPC_MESSAGE_CONTROL2(ViewHostMsg_SavedPageAsMHTML,
1450                      int /* job_id */,
1451                      int64 /* size of the MHTML file, -1 if error */)
1452
1453 IPC_MESSAGE_ROUTED3(ViewHostMsg_SendCurrentPageAllSavableResourceLinks,
1454                     std::vector<GURL> /* all savable resource links */,
1455                     std::vector<content::Referrer> /* all referrers */,
1456                     std::vector<GURL> /* all frame links */)
1457
1458 IPC_MESSAGE_ROUTED3(ViewHostMsg_SendSerializedHtmlData,
1459                     GURL /* frame's url */,
1460                     std::string /* data buffer */,
1461                     int32 /* complete status */)
1462
1463 // Notifies the browser of an event occurring in the media pipeline.
1464 IPC_MESSAGE_CONTROL1(ViewHostMsg_MediaLogEvents,
1465                      std::vector<media::MediaLogEvent> /* events */)
1466
1467 // Requests to lock the mouse. Will result in a ViewMsg_LockMouse_ACK message
1468 // being sent back.
1469 // |privileged| is used by Pepper Flash. If this flag is set to true, we won't
1470 // pop up a bubble to ask for user permission or take mouse lock content into
1471 // account.
1472 IPC_MESSAGE_ROUTED3(ViewHostMsg_LockMouse,
1473                     bool /* user_gesture */,
1474                     bool /* last_unlocked_by_target */,
1475                     bool /* privileged */)
1476
1477 // Requests to unlock the mouse. A ViewMsg_MouseLockLost message will be sent
1478 // whenever the mouse is unlocked (which may or may not be caused by
1479 // ViewHostMsg_UnlockMouse).
1480 IPC_MESSAGE_ROUTED0(ViewHostMsg_UnlockMouse)
1481
1482 // Notifies that multiple touch targets may have been pressed, and to show
1483 // the disambiguation popup.
1484 IPC_MESSAGE_ROUTED3(ViewHostMsg_ShowDisambiguationPopup,
1485                     gfx::Rect, /* Border of touched targets */
1486                     gfx::Size, /* Size of zoomed image */
1487                     cc::SharedBitmapId /* id */)
1488
1489 // Sent by the renderer process to check whether client 3D APIs
1490 // (Pepper 3D, WebGL) are explicitly blocked.
1491 IPC_SYNC_MESSAGE_CONTROL3_1(ViewHostMsg_Are3DAPIsBlocked,
1492                             int /* render_view_id */,
1493                             GURL /* top_origin_url */,
1494                             content::ThreeDAPIType /* requester */,
1495                             bool /* blocked */)
1496
1497 // Sent by the renderer process to indicate that a context was lost by
1498 // client 3D content (Pepper 3D, WebGL) running on the page at the
1499 // given URL.
1500 IPC_MESSAGE_CONTROL3(ViewHostMsg_DidLose3DContext,
1501                      GURL /* top_origin_url */,
1502                      content::ThreeDAPIType /* context_type */,
1503                      int /* arb_robustness_status_code */)
1504
1505 // Notifies the browser that document has parsed the body. This is used by the
1506 // ResourceScheduler as an indication that bandwidth contention won't block
1507 // first paint.
1508 IPC_MESSAGE_ROUTED0(ViewHostMsg_WillInsertBody)
1509
1510 // Notification that the urls for the favicon of a site has been determined.
1511 IPC_MESSAGE_ROUTED1(ViewHostMsg_UpdateFaviconURL,
1512                     std::vector<content::FaviconURL> /* candidates */)
1513
1514 // Sent by the renderer to the browser to start a vibration with the given
1515 // duration.
1516 IPC_MESSAGE_CONTROL1(ViewHostMsg_Vibrate,
1517                      int64 /* milliseconds */)
1518
1519 // Sent by the renderer to the browser to cancel the currently running
1520 // vibration, if there is one.
1521 IPC_MESSAGE_CONTROL0(ViewHostMsg_CancelVibration)
1522
1523 // Message sent from renderer to the browser when the element that is focused
1524 // has been touched. A bool is passed in this message which indicates if the
1525 // node is editable.
1526 IPC_MESSAGE_ROUTED1(ViewHostMsg_FocusedNodeTouched,
1527                     bool /* editable */)
1528
1529 // Message sent from the renderer to the browser when an HTML form has failed
1530 // validation constraints.
1531 IPC_MESSAGE_ROUTED3(ViewHostMsg_ShowValidationMessage,
1532                     gfx::Rect /* anchor rectangle in root view coordinate */,
1533                     base::string16 /* validation message */,
1534                     base::string16 /* supplemental text */)
1535
1536 // Message sent from the renderer to the browser when a HTML form validation
1537 // message should be hidden from view.
1538 IPC_MESSAGE_ROUTED0(ViewHostMsg_HideValidationMessage)
1539
1540 // Message sent from the renderer to the browser when the suggested co-ordinates
1541 // of the anchor for a HTML form validation message have changed.
1542 IPC_MESSAGE_ROUTED1(ViewHostMsg_MoveValidationMessage,
1543                     gfx::Rect /* anchor rectangle in root view coordinate */)
1544
1545 #if defined(OS_ANDROID)
1546 // Response to ViewMsg_FindMatchRects.
1547 //
1548 // |version| will contain the current version number of the renderer's find
1549 // match list (incremented whenever they change), which should be passed in the
1550 // next call to ViewMsg_FindMatchRects.
1551 //
1552 // |rects| will either contain a list of the enclosing rects of all matches
1553 // found by the most recent Find operation, or will be empty if |version| is not
1554 // greater than the |current_version| passed to ViewMsg_FindMatchRects (hence
1555 // your locally cached rects should still be valid). The rect coords will be
1556 // custom normalized fractions of the document size. The rects will be sorted by
1557 // frame traversal order starting in the main frame, then by dom order.
1558 //
1559 // |active_rect| will contain the bounding box of the active find-in-page match
1560 // marker, in similarly normalized coords (or an empty rect if there isn't one).
1561 IPC_MESSAGE_ROUTED3(ViewHostMsg_FindMatchRects_Reply,
1562                     int /* version */,
1563                     std::vector<gfx::RectF> /* rects */,
1564                     gfx::RectF /* active_rect */)
1565
1566 // Start an android intent with the given URI.
1567 IPC_MESSAGE_ROUTED1(ViewHostMsg_StartContentIntent,
1568                     GURL /* content_url */)
1569
1570 // Message sent when the renderer changed the background color for the view.
1571 IPC_MESSAGE_ROUTED1(ViewHostMsg_DidChangeBodyBackgroundColor,
1572                     uint32  /* bg_color */)
1573
1574 // This message runs the MediaCodec for decoding audio for webaudio.
1575 IPC_MESSAGE_CONTROL3(ViewHostMsg_RunWebAudioMediaCodec,
1576                      base::SharedMemoryHandle /* encoded_data_handle */,
1577                      base::FileDescriptor /* pcm_output */,
1578                      uint32_t /* data_size*/)
1579
1580 // Sent by renderer to request a ViewMsg_BeginFrame message for upcoming
1581 // display events. If |enabled| is true, the BeginFrame message will continue
1582 // to be be delivered until the notification is disabled.
1583 IPC_MESSAGE_ROUTED1(ViewHostMsg_SetNeedsBeginFrame,
1584                     bool /* enabled */)
1585
1586 // Reply to the ViewMsg_ExtractSmartClipData message.
1587 IPC_MESSAGE_ROUTED3(ViewHostMsg_SmartClipDataExtracted,
1588                     base::string16 /* text */,
1589                     base::string16 /* html */,
1590                     gfx::Rect /* rect */)
1591
1592 #elif defined(OS_MACOSX)
1593 // Request that the browser load a font into shared memory for us.
1594 IPC_SYNC_MESSAGE_CONTROL1_3(ViewHostMsg_LoadFont,
1595                            FontDescriptor /* font to load */,
1596                            uint32 /* buffer size */,
1597                            base::SharedMemoryHandle /* font data */,
1598                            uint32 /* font id */)
1599
1600 // Informs the browser that a plugin has gained or lost focus.
1601 IPC_MESSAGE_ROUTED2(ViewHostMsg_PluginFocusChanged,
1602                     bool, /* focused */
1603                     int /* plugin_id */)
1604
1605 // Instructs the browser to start plugin IME.
1606 IPC_MESSAGE_ROUTED0(ViewHostMsg_StartPluginIme)
1607
1608 // Receives content of a web page as plain text.
1609 IPC_MESSAGE_ROUTED1(ViewMsg_GetRenderedTextCompleted, std::string);
1610
1611 #elif defined(OS_WIN)
1612 // Request that the given font characters be loaded by the browser so it's
1613 // cached by the OS. Please see RenderMessageFilter::OnPreCacheFontCharacters
1614 // for details.
1615 IPC_SYNC_MESSAGE_CONTROL2_0(ViewHostMsg_PreCacheFontCharacters,
1616                             LOGFONT /* font_data */,
1617                             base::string16 /* characters */)
1618 #endif
1619
1620 #if defined(OS_POSIX)
1621 // On POSIX, we cannot allocated shared memory from within the sandbox, so
1622 // this call exists for the renderer to ask the browser to allocate memory
1623 // on its behalf. We return a file descriptor to the POSIX shared memory.
1624 // If the |cache_in_browser| flag is |true|, then a copy of the shmem is kept
1625 // by the browser, and it is the caller's repsonsibility to send a
1626 // ViewHostMsg_FreeTransportDIB message in order to release the cached shmem.
1627 // In all cases, the caller is responsible for deleting the resulting
1628 // TransportDIB.
1629 IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_AllocTransportDIB,
1630                             uint32_t, /* bytes requested */
1631                             bool, /* cache in the browser */
1632                             TransportDIB::Handle /* DIB */)
1633
1634 // Since the browser keeps handles to the allocated transport DIBs, this
1635 // message is sent to tell the browser that it may release them when the
1636 // renderer is finished with them.
1637 IPC_MESSAGE_CONTROL1(ViewHostMsg_FreeTransportDIB,
1638                      TransportDIB::Id /* DIB id */)
1639 #endif
1640
1641 // Adding a new message? Stick to the sort order above: first platform
1642 // independent ViewMsg, then ifdefs for platform specific ViewMsg, then platform
1643 // independent ViewHostMsg, then ifdefs for platform specific ViewHostMsg.