• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_Resize_Params)
410   // Information about the screen (dpi, depth, etc..).
411   IPC_STRUCT_MEMBER(blink::WebScreenInfo, screen_info)
412   // The size of the renderer.
413   IPC_STRUCT_MEMBER(gfx::Size, new_size)
414   // The size of the view's backing surface in non-DPI-adjusted pixels.
415   IPC_STRUCT_MEMBER(gfx::Size, physical_backing_size)
416   // The amount that the viewport size given to Blink was shrunk by the URL-bar
417   // (always 0 on platforms where URL-bar hiding isn't supported).
418   IPC_STRUCT_MEMBER(float, top_controls_layout_height)
419   // The size of the visible viewport, which may be smaller than the view if the
420   // view is partially occluded (e.g. by a virtual keyboard).  The size is in
421   // DPI-adjusted pixels.
422   IPC_STRUCT_MEMBER(gfx::Size, visible_viewport_size)
423   // The resizer rect.
424   IPC_STRUCT_MEMBER(gfx::Rect, resizer_rect)
425   // Indicates whether a page is fullscreen or not.
426   IPC_STRUCT_MEMBER(bool, is_fullscreen)
427 IPC_STRUCT_END()
428 
429 IPC_STRUCT_BEGIN(ViewMsg_New_Params)
430   // Renderer-wide preferences.
431   IPC_STRUCT_MEMBER(content::RendererPreferences, renderer_preferences)
432 
433   // Preferences for this view.
434   IPC_STRUCT_MEMBER(content::WebPreferences, web_preferences)
435 
436   // The ID of the view to be created.
437   IPC_STRUCT_MEMBER(int32, view_id)
438 
439   // The ID of the main frame hosted in the view.
440   IPC_STRUCT_MEMBER(int32, main_frame_routing_id)
441 
442   // The ID of the rendering surface.
443   IPC_STRUCT_MEMBER(int32, surface_id)
444 
445   // The session storage namespace ID this view should use.
446   IPC_STRUCT_MEMBER(int64, session_storage_namespace_id)
447 
448   // The name of the frame associated with this view (or empty if none).
449   IPC_STRUCT_MEMBER(base::string16, frame_name)
450 
451   // The route ID of the opener RenderView if we need to set one
452   // (MSG_ROUTING_NONE otherwise).
453   IPC_STRUCT_MEMBER(int, opener_route_id)
454 
455   // Whether the RenderView should initially be swapped out.
456   IPC_STRUCT_MEMBER(bool, swapped_out)
457 
458   // The ID of the proxy object for the main frame in this view. It is only
459   // used if |swapped_out| is true.
460   IPC_STRUCT_MEMBER(int32, proxy_routing_id)
461 
462   // Whether the RenderView should initially be hidden.
463   IPC_STRUCT_MEMBER(bool, hidden)
464 
465   // Whether the RenderView will never be visible.
466   IPC_STRUCT_MEMBER(bool, never_visible)
467 
468   // Whether the window associated with this view was created with an opener.
469   IPC_STRUCT_MEMBER(bool, window_was_created_with_opener)
470 
471   // The initial page ID to use for this view, which must be larger than any
472   // existing navigation that might be loaded in the view.  Page IDs are unique
473   // to a view and are only updated by the renderer after this initial value.
474   IPC_STRUCT_MEMBER(int32, next_page_id)
475 
476   // The initial renderer size.
477   IPC_STRUCT_MEMBER(ViewMsg_Resize_Params, initial_size)
478 
479   // Whether to enable auto-resize.
480   IPC_STRUCT_MEMBER(bool, enable_auto_resize)
481 
482   // The minimum size to layout the page if auto-resize is enabled.
483   IPC_STRUCT_MEMBER(gfx::Size, min_size)
484 
485   // The maximum size to layout the page if auto-resize is enabled.
486   IPC_STRUCT_MEMBER(gfx::Size, max_size)
487 IPC_STRUCT_END()
488 
489 IPC_STRUCT_BEGIN(ViewMsg_PostMessage_Params)
490   // Whether the data format is supplied as serialized script value, or as
491   // a simple string. If it is a raw string, must be converted from string to a
492   // WebSerializedScriptValue in renderer.
493   IPC_STRUCT_MEMBER(bool, is_data_raw_string)
494   // The serialized script value.
495   IPC_STRUCT_MEMBER(base::string16, data)
496   // When sent to the browser, this is the routing ID of the source frame in
497   // the source process.  The browser replaces it with the routing ID of the
498   // equivalent (swapped out) frame in the destination process.
499   IPC_STRUCT_MEMBER(int, source_routing_id)
500 
501   // The origin of the source frame.
502   IPC_STRUCT_MEMBER(base::string16, source_origin)
503 
504   // The origin for the message's target.
505   IPC_STRUCT_MEMBER(base::string16, target_origin)
506 
507   // Information about the MessagePorts this message contains.
508   IPC_STRUCT_MEMBER(std::vector<int>, message_port_ids)
509   IPC_STRUCT_MEMBER(std::vector<int>, new_routing_ids)
510 IPC_STRUCT_END()
511 
512 // Messages sent from the browser to the renderer.
513 
514 #if defined(OS_ANDROID)
515 // Tells the renderer to cancel an opened date/time dialog.
516 IPC_MESSAGE_ROUTED0(ViewMsg_CancelDateTimeDialog)
517 
518 // Replaces a date time input field.
519 IPC_MESSAGE_ROUTED1(ViewMsg_ReplaceDateTime,
520                     double /* dialog_value */)
521 
522 #endif
523 
524 // Get all savable resource links from current webpage, include main
525 // frame and sub-frame.
526 IPC_MESSAGE_ROUTED1(ViewMsg_GetAllSavableResourceLinksForCurrentPage,
527                     GURL /* url of page which is needed to save */)
528 
529 // Get html data by serializing all frames of current page with lists
530 // which contain all resource links that have local copy.
531 IPC_MESSAGE_ROUTED3(ViewMsg_GetSerializedHtmlDataForCurrentPageWithLocalLinks,
532                     std::vector<GURL> /* urls that have local copy */,
533                     std::vector<base::FilePath> /* paths of local copy */,
534                     base::FilePath /* local directory path */)
535 
536 // Tells the render side that a ViewHostMsg_LockMouse message has been
537 // processed. |succeeded| indicates whether the mouse has been successfully
538 // locked or not.
539 IPC_MESSAGE_ROUTED1(ViewMsg_LockMouse_ACK,
540                     bool /* succeeded */)
541 // Tells the render side that the mouse has been unlocked.
542 IPC_MESSAGE_ROUTED0(ViewMsg_MouseLockLost)
543 
544 // Sent by the browser when the parameters for vsync alignment have changed.
545 IPC_MESSAGE_ROUTED2(ViewMsg_UpdateVSyncParameters,
546                     base::TimeTicks /* timebase */,
547                     base::TimeDelta /* interval */)
548 
549 // Sent to the RenderView when a new tab is swapped into an existing
550 // tab and the histories need to be merged. The existing tab has a history of
551 // |merged_history_length| which precedes the history of the new tab. All
552 // page_ids >= |minimum_page_id| in the new tab are appended to the history.
553 //
554 // For example, suppose the history of page_ids in the new tab's RenderView
555 // is [4 7 8]. This is merged into an existing tab with 3 history items, and
556 // all pages in the new tab with page_id >= 7 are to be preserved.
557 // The resulting page history is [-1 -1 -1 7 8].
558 IPC_MESSAGE_ROUTED2(ViewMsg_SetHistoryLengthAndPrune,
559                     int, /* merge_history_length */
560                     int32 /* minimum_page_id */)
561 
562 // Tells the renderer to create a new view.
563 // This message is slightly different, the view it takes (via
564 // ViewMsg_New_Params) is the view to create, the message itself is sent as a
565 // non-view control message.
566 IPC_MESSAGE_CONTROL1(ViewMsg_New,
567                      ViewMsg_New_Params)
568 
569 // Reply in response to ViewHostMsg_ShowView or ViewHostMsg_ShowWidget.
570 // similar to the new command, but used when the renderer created a view
571 // first, and we need to update it.
572 IPC_MESSAGE_ROUTED0(ViewMsg_CreatingNew_ACK)
573 
574 // Sends updated preferences to the renderer.
575 IPC_MESSAGE_ROUTED1(ViewMsg_SetRendererPrefs,
576                     content::RendererPreferences)
577 
578 // This passes a set of webkit preferences down to the renderer.
579 IPC_MESSAGE_ROUTED1(ViewMsg_UpdateWebPreferences,
580                     content::WebPreferences)
581 
582 // Informs the renderer that the timezone has changed.
583 IPC_MESSAGE_CONTROL0(ViewMsg_TimezoneChange)
584 
585 // Tells the render view to close.
586 // Expects a Close_ACK message when finished.
587 IPC_MESSAGE_ROUTED0(ViewMsg_Close)
588 
589 // Tells the render view to change its size.  A ViewHostMsg_UpdateRect message
590 // is generated in response provided new_size is not empty and not equal to
591 // the view's current size.  The generated ViewHostMsg_UpdateRect message will
592 // have the IS_RESIZE_ACK flag set. It also receives the resizer rect so that
593 // we don't have to fetch it every time WebKit asks for it.
594 IPC_MESSAGE_ROUTED1(ViewMsg_Resize,
595                     ViewMsg_Resize_Params /* params */)
596 
597 // Tells the render view that the resize rect has changed.
598 IPC_MESSAGE_ROUTED1(ViewMsg_ChangeResizeRect,
599                     gfx::Rect /* resizer_rect */)
600 
601 // Sent to inform the view that it was hidden.  This allows it to reduce its
602 // resource utilization.
603 IPC_MESSAGE_ROUTED0(ViewMsg_WasHidden)
604 
605 // Tells the render view that it is no longer hidden (see WasHidden), and the
606 // render view is expected to respond with a full repaint if needs_repainting
607 // is true. If needs_repainting is false, then this message does not trigger a
608 // message in response.
609 IPC_MESSAGE_ROUTED2(ViewMsg_WasShown,
610                     bool /* needs_repainting */,
611                     ui::LatencyInfo /* latency_info */)
612 
613 // Tells the renderer to focus the first (last if reverse is true) focusable
614 // node.
615 IPC_MESSAGE_ROUTED1(ViewMsg_SetInitialFocus,
616                     bool /* reverse */)
617 
618 // Sent to inform the renderer to invoke a context menu.
619 // The parameter specifies the location in the render view's coordinates.
620 IPC_MESSAGE_ROUTED2(ViewMsg_ShowContextMenu,
621                     ui::MenuSourceType,
622                     gfx::Point /* location where menu should be shown */)
623 
624 // Sent when the user wants to search for a word on the page (find in page).
625 IPC_MESSAGE_ROUTED3(ViewMsg_Find,
626                     int /* request_id */,
627                     base::string16 /* search_text */,
628                     blink::WebFindOptions)
629 
630 // This message notifies the renderer that the user has closed the FindInPage
631 // window (and what action to take regarding the selection).
632 IPC_MESSAGE_ROUTED1(ViewMsg_StopFinding,
633                     content::StopFindAction /* action */)
634 
635 // Copies the image at location x, y to the clipboard (if there indeed is an
636 // image at that location).
637 IPC_MESSAGE_ROUTED2(ViewMsg_CopyImageAt,
638                     int /* x */,
639                     int /* y */)
640 
641 // Saves the image at location x, y to the disk (if there indeed is an
642 // image at that location).
643 IPC_MESSAGE_ROUTED2(ViewMsg_SaveImageAt,
644                     int /* x */,
645                     int /* y */)
646 
647 // Tells the renderer to perform the given action on the media player
648 // located at the given point.
649 IPC_MESSAGE_ROUTED2(ViewMsg_MediaPlayerActionAt,
650                     gfx::Point, /* location */
651                     blink::WebMediaPlayerAction)
652 
653 // Tells the renderer to perform the given action on the plugin located at
654 // the given point.
655 IPC_MESSAGE_ROUTED2(ViewMsg_PluginActionAt,
656                     gfx::Point, /* location */
657                     blink::WebPluginAction)
658 
659 // Posts a message from a frame in another process to the current renderer.
660 IPC_MESSAGE_ROUTED1(ViewMsg_PostMessageEvent,
661                     ViewMsg_PostMessage_Params)
662 
663 // Change the zoom level for the current main frame.  If the level actually
664 // changes, a ViewHostMsg_DidZoomURL message will be sent back to the browser
665 // telling it what url got zoomed and what its current zoom level is.
666 IPC_MESSAGE_ROUTED1(ViewMsg_Zoom,
667                     content::PageZoom /* function */)
668 
669 // Set the zoom level for a particular url that the renderer is in the
670 // process of loading.  This will be stored, to be used if the load commits
671 // and ignored otherwise.
672 IPC_MESSAGE_ROUTED2(ViewMsg_SetZoomLevelForLoadingURL,
673                     GURL /* url */,
674                     double /* zoom_level */)
675 
676 // Set the zoom level for a particular url, so all render views
677 // displaying this url can update their zoom levels to match.
678 // If scheme is empty, then only host is used for matching.
679 IPC_MESSAGE_CONTROL3(ViewMsg_SetZoomLevelForCurrentURL,
680                      std::string /* scheme */,
681                      std::string /* host */,
682                      double /* zoom_level */)
683 
684 // Set the zoom level for a particular render view.
685 IPC_MESSAGE_ROUTED2(ViewMsg_SetZoomLevelForView,
686                     bool /* uses_temporary_zoom_level */,
687                     double /* zoom_level */)
688 
689 // Change encoding of page in the renderer.
690 IPC_MESSAGE_ROUTED1(ViewMsg_SetPageEncoding,
691                     std::string /*new encoding name*/)
692 
693 // Reset encoding of page in the renderer back to default.
694 IPC_MESSAGE_ROUTED0(ViewMsg_ResetPageEncodingToDefault)
695 
696 // Used to tell a render view whether it should expose various bindings
697 // that allow JS content extended privileges.  See BindingsPolicy for valid
698 // flag values.
699 IPC_MESSAGE_ROUTED1(ViewMsg_AllowBindings,
700                     int /* enabled_bindings_flags */)
701 
702 // Tell the renderer to add a property to the WebUI binding object.  This
703 // only works if we allowed WebUI bindings.
704 IPC_MESSAGE_ROUTED2(ViewMsg_SetWebUIProperty,
705                     std::string /* property_name */,
706                     std::string /* property_value_json */)
707 
708 // This message starts/stop monitoring the input method status of the focused
709 // edit control of a renderer process.
710 // Parameters
711 // * is_active (bool)
712 //   Indicates if an input method is active in the browser process.
713 //   The possible actions when a renderer process receives this message are
714 //   listed below:
715 //     Value Action
716 //     true  Start sending IPC message ViewHostMsg_ImeUpdateTextInputState
717 //           to notify the input method status of the focused edit control.
718 //     false Stop sending IPC message ViewHostMsg_ImeUpdateTextInputState.
719 IPC_MESSAGE_ROUTED1(ViewMsg_SetInputMethodActive,
720                     bool /* is_active */)
721 
722 // IME API oncandidatewindow* events for InputMethodContext.
723 IPC_MESSAGE_ROUTED0(ViewMsg_CandidateWindowShown)
724 IPC_MESSAGE_ROUTED0(ViewMsg_CandidateWindowUpdated)
725 IPC_MESSAGE_ROUTED0(ViewMsg_CandidateWindowHidden)
726 
727 // Used to notify the render-view that we have received a target URL. Used
728 // to prevent target URLs spamming the browser.
729 IPC_MESSAGE_ROUTED0(ViewMsg_UpdateTargetURL_ACK)
730 
731 IPC_MESSAGE_ROUTED1(ViewMsg_RunFileChooserResponse,
732                     std::vector<ui::SelectedFileInfo>)
733 
734 // Provides the results of directory enumeration.
735 IPC_MESSAGE_ROUTED2(ViewMsg_EnumerateDirectoryResponse,
736                     int /* request_id */,
737                     std::vector<base::FilePath> /* files_in_directory */)
738 
739 // When a renderer sends a ViewHostMsg_Focus to the browser process,
740 // the browser has the option of sending a ViewMsg_CantFocus back to
741 // the renderer.
742 IPC_MESSAGE_ROUTED0(ViewMsg_CantFocus)
743 
744 // Tells the renderer to suppress any further modal dialogs until it receives a
745 // corresponding ViewMsg_SwapOut message.  This ensures that no
746 // PageGroupLoadDeferrer is on the stack for SwapOut.
747 IPC_MESSAGE_ROUTED0(ViewMsg_SuppressDialogsUntilSwapOut)
748 
749 // Instructs the renderer to close the current page, including running the
750 // onunload event handler.
751 //
752 // Expects a ClosePage_ACK message when finished.
753 IPC_MESSAGE_ROUTED0(ViewMsg_ClosePage)
754 
755 // Notifies the renderer about ui theme changes
756 IPC_MESSAGE_ROUTED0(ViewMsg_ThemeChanged)
757 
758 // Notifies the renderer that a paint is to be generated for the rectangle
759 // passed in.
760 IPC_MESSAGE_ROUTED1(ViewMsg_Repaint,
761                     gfx::Size /* The view size to be repainted */)
762 
763 // Notification that a move or resize renderer's containing window has
764 // started.
765 IPC_MESSAGE_ROUTED0(ViewMsg_MoveOrResizeStarted)
766 
767 IPC_MESSAGE_ROUTED2(ViewMsg_UpdateScreenRects,
768                     gfx::Rect /* view_screen_rect */,
769                     gfx::Rect /* window_screen_rect */)
770 
771 // Reply to ViewHostMsg_RequestMove, ViewHostMsg_ShowView, and
772 // ViewHostMsg_ShowWidget to inform the renderer that the browser has
773 // processed the move.  The browser may have ignored the move, but it finished
774 // processing.  This is used because the renderer keeps a temporary cache of
775 // the widget position while these asynchronous operations are in progress.
776 IPC_MESSAGE_ROUTED0(ViewMsg_Move_ACK)
777 
778 // Used to instruct the RenderView to send back updates to the preferred size.
779 IPC_MESSAGE_ROUTED0(ViewMsg_EnablePreferredSizeChangedMode)
780 
781 // Used to instruct the RenderView to automatically resize and send back
782 // updates for the new size.
783 IPC_MESSAGE_ROUTED2(ViewMsg_EnableAutoResize,
784                     gfx::Size /* min_size */,
785                     gfx::Size /* max_size */)
786 
787 // Used to instruct the RenderView to disalbe automatically resize.
788 IPC_MESSAGE_ROUTED1(ViewMsg_DisableAutoResize,
789                     gfx::Size /* new_size */)
790 
791 // Changes the text direction of the currently selected input field (if any).
792 IPC_MESSAGE_ROUTED1(ViewMsg_SetTextDirection,
793                     blink::WebTextDirection /* direction */)
794 
795 // Tells the renderer to clear the focused element (if any).
796 IPC_MESSAGE_ROUTED0(ViewMsg_ClearFocusedElement)
797 
798 // Make the RenderView background transparent or opaque.
799 IPC_MESSAGE_ROUTED1(ViewMsg_SetBackgroundOpaque, bool /* opaque */)
800 
801 // Used to tell the renderer not to add scrollbars with height and
802 // width below a threshold.
803 IPC_MESSAGE_ROUTED1(ViewMsg_DisableScrollbarsForSmallWindows,
804                     gfx::Size /* disable_scrollbar_size_limit */)
805 
806 // Activate/deactivate the RenderView (i.e., set its controls' tint
807 // accordingly, etc.).
808 IPC_MESSAGE_ROUTED1(ViewMsg_SetActive,
809                     bool /* active */)
810 
811 // Response message to ViewHostMsg_CreateWorker.
812 // Sent when the worker has started.
813 IPC_MESSAGE_ROUTED0(ViewMsg_WorkerCreated)
814 
815 // Sent when the worker failed to load the worker script.
816 // In normal cases, this message is sent after ViewMsg_WorkerCreated is sent.
817 // But if the shared worker of the same URL already exists and it has failed
818 // to load the script, when the renderer send ViewHostMsg_CreateWorker before
819 // the shared worker is killed only ViewMsg_WorkerScriptLoadFailed is sent.
820 IPC_MESSAGE_ROUTED0(ViewMsg_WorkerScriptLoadFailed)
821 
822 // Sent when the worker has connected.
823 // This message is sent only if the worker successfully loaded the script.
824 IPC_MESSAGE_ROUTED0(ViewMsg_WorkerConnected)
825 
826 // Tells the renderer that the network type has changed so that navigator.onLine
827 // and navigator.connection can be updated.
828 IPC_MESSAGE_CONTROL1(ViewMsg_NetworkTypeChanged,
829                      net::NetworkChangeNotifier::ConnectionType /* type */)
830 
831 #if defined(ENABLE_PLUGINS)
832 // Reply to ViewHostMsg_OpenChannelToPpapiBroker
833 // Tells the renderer that the channel to the broker has been created.
834 IPC_MESSAGE_ROUTED2(ViewMsg_PpapiBrokerChannelCreated,
835                     base::ProcessId /* broker_pid */,
836                     IPC::ChannelHandle /* handle */)
837 
838 // Reply to ViewHostMsg_RequestPpapiBrokerPermission.
839 // Tells the renderer whether permission to access to PPAPI broker was granted
840 // or not.
841 IPC_MESSAGE_ROUTED1(ViewMsg_PpapiBrokerPermissionResult,
842                     bool /* result */)
843 
844 // Tells the renderer to empty its plugin list cache, optional reloading
845 // pages containing plugins.
846 IPC_MESSAGE_CONTROL1(ViewMsg_PurgePluginListCache,
847                      bool /* reload_pages */)
848 #endif
849 
850 // Used to instruct the RenderView to go into "view source" mode.
851 IPC_MESSAGE_ROUTED0(ViewMsg_EnableViewSourceMode)
852 
853 // Instructs the renderer to save the current page to MHTML.
854 IPC_MESSAGE_ROUTED2(ViewMsg_SavePageAsMHTML,
855                     int /* job_id */,
856                     IPC::PlatformFileForTransit /* file handle */)
857 
858 // Temporary message to diagnose an unexpected condition in WebContentsImpl.
859 IPC_MESSAGE_CONTROL1(ViewMsg_TempCrashWithData,
860                      GURL /* data */)
861 
862 // An acknowledge to ViewHostMsg_MultipleTargetsTouched to notify the renderer
863 // process to release the magnified image.
864 IPC_MESSAGE_ROUTED1(ViewMsg_ReleaseDisambiguationPopupBitmap,
865                     cc::SharedBitmapId /* id */)
866 
867 // Notifies the renderer that a snapshot has been retrieved.
868 IPC_MESSAGE_ROUTED3(ViewMsg_WindowSnapshotCompleted,
869                     int /* snapshot_id */,
870                     gfx::Size /* size */,
871                     std::vector<unsigned char> /* png */)
872 
873 // Fetches complete rendered content of a web page as plain text.
874 IPC_MESSAGE_ROUTED0(ViewMsg_GetRenderedText)
875 
876 #if defined(OS_MACOSX)
877 IPC_ENUM_TRAITS_MAX_VALUE(blink::ScrollerStyle, blink::ScrollerStyleOverlay)
878 
879 // Notification of a change in scrollbar appearance and/or behavior.
880 IPC_MESSAGE_CONTROL5(ViewMsg_UpdateScrollbarTheme,
881                      float /* initial_button_delay */,
882                      float /* autoscroll_button_delay */,
883                      bool /* jump_on_track_click */,
884                      blink::ScrollerStyle /* preferred_scroller_style */,
885                      bool /* redraw */)
886 #endif
887 
888 #if defined(OS_ANDROID)
889 // Tells the renderer to suspend/resume the webkit timers.
890 IPC_MESSAGE_CONTROL1(ViewMsg_SetWebKitSharedTimersSuspended,
891                      bool /* suspend */)
892 
893 // Sent when the browser wants the bounding boxes of the current find matches.
894 //
895 // If match rects are already cached on the browser side, |current_version|
896 // should be the version number from the ViewHostMsg_FindMatchRects_Reply
897 // they came in, so the renderer can tell if it needs to send updated rects.
898 // Otherwise just pass -1 to always receive the list of rects.
899 //
900 // There must be an active search string (it is probably most useful to call
901 // this immediately after a ViewHostMsg_Find_Reply message arrives with
902 // final_update set to true).
903 IPC_MESSAGE_ROUTED1(ViewMsg_FindMatchRects,
904                     int /* current_version */)
905 
906 // Notifies the renderer whether hiding/showing the top controls is enabled
907 // and whether or not to animate to the proper state.
908 IPC_MESSAGE_ROUTED3(ViewMsg_UpdateTopControlsState,
909                     bool /* enable_hiding */,
910                     bool /* enable_showing */,
911                     bool /* animate */)
912 
913 IPC_MESSAGE_ROUTED0(ViewMsg_ShowImeIfNeeded)
914 
915 // Sent by the browser when the renderer should generate a new frame.
916 IPC_MESSAGE_ROUTED1(ViewMsg_BeginFrame,
917                     cc::BeginFrameArgs /* args */)
918 
919 // Sent by the browser when an IME update that requires acknowledgement has been
920 // processed on the browser side.
921 IPC_MESSAGE_ROUTED0(ViewMsg_ImeEventAck)
922 
923 // Extracts the data at the given rect, returning it through the
924 // ViewHostMsg_SmartClipDataExtracted IPC.
925 IPC_MESSAGE_ROUTED1(ViewMsg_ExtractSmartClipData,
926                     gfx::Rect /* rect */)
927 
928 #elif defined(OS_MACOSX)
929 // Let the RenderView know its window has changed visibility.
930 IPC_MESSAGE_ROUTED1(ViewMsg_SetWindowVisibility,
931                     bool /* visibile */)
932 
933 // Let the RenderView know its window's frame has changed.
934 IPC_MESSAGE_ROUTED2(ViewMsg_WindowFrameChanged,
935                     gfx::Rect /* window frame */,
936                     gfx::Rect /* content view frame */)
937 
938 // Message sent from the browser to the renderer when the user starts or stops
939 // resizing the view.
940 IPC_MESSAGE_ROUTED1(ViewMsg_SetInLiveResize,
941                     bool /* enable */)
942 
943 // Tell the renderer that plugin IME has completed.
944 IPC_MESSAGE_ROUTED2(ViewMsg_PluginImeCompositionCompleted,
945                     base::string16 /* text */,
946                     int /* plugin_id */)
947 #endif
948 
949 // Sent by the browser as a reply to ViewHostMsg_SwapCompositorFrame.
950 IPC_MESSAGE_ROUTED2(ViewMsg_SwapCompositorFrameAck,
951                     uint32 /* output_surface_id */,
952                     cc::CompositorFrameAck /* ack */)
953 
954 // Sent by browser to tell renderer compositor that some resources that were
955 // given to the browser in a swap are not being used anymore.
956 IPC_MESSAGE_ROUTED2(ViewMsg_ReclaimCompositorResources,
957                     uint32 /* output_surface_id */,
958                     cc::CompositorFrameAck /* ack */)
959 
960 IPC_MESSAGE_ROUTED0(ViewMsg_SelectWordAroundCaret)
961 
962 // Sent by the browser to ask the renderer to redraw.
963 // If |request_id| is not zero, it is added to the forced frame's latency info
964 // as ui::WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT.
965 IPC_MESSAGE_ROUTED1(ViewMsg_ForceRedraw,
966                     int /* request_id */)
967 
968 // -----------------------------------------------------------------------------
969 // Messages sent from the renderer to the browser.
970 
971 // Sent by the renderer when it is creating a new window.  The browser creates
972 // a tab for it and responds with a ViewMsg_CreatingNew_ACK.  If route_id is
973 // MSG_ROUTING_NONE, the view couldn't be created.
974 IPC_SYNC_MESSAGE_CONTROL1_4(ViewHostMsg_CreateWindow,
975                             ViewHostMsg_CreateWindow_Params,
976                             int /* route_id */,
977                             int /* main_frame_route_id */,
978                             int32 /* surface_id */,
979                             int64 /* cloned_session_storage_namespace_id */)
980 
981 // Similar to ViewHostMsg_CreateWindow, except used for sub-widgets, like
982 // <select> dropdowns.  This message is sent to the WebContentsImpl that
983 // contains the widget being created.
984 IPC_SYNC_MESSAGE_CONTROL2_2(ViewHostMsg_CreateWidget,
985                             int /* opener_id */,
986                             blink::WebPopupType /* popup type */,
987                             int /* route_id */,
988                             int32 /* surface_id */)
989 
990 // Similar to ViewHostMsg_CreateWidget except the widget is a full screen
991 // window.
992 IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_CreateFullscreenWidget,
993                             int /* opener_id */,
994                             int /* route_id */,
995                             int32 /* surface_id */)
996 
997 // Asks the browser for a unique routing ID.
998 IPC_SYNC_MESSAGE_CONTROL0_1(ViewHostMsg_GenerateRoutingID,
999                             int /* routing_id */)
1000 
1001 // Asks the browser for the default audio hardware configuration.
1002 IPC_SYNC_MESSAGE_CONTROL0_2(ViewHostMsg_GetAudioHardwareConfig,
1003                             media::AudioParameters /* input parameters */,
1004                             media::AudioParameters /* output parameters */)
1005 
1006 // Asks the browser for the renderer process memory size stats.
1007 IPC_SYNC_MESSAGE_CONTROL0_2(ViewHostMsg_GetProcessMemorySizes,
1008                             size_t /* private_bytes */,
1009                             size_t /* shared_bytes */)
1010 
1011 // These three messages are sent to the parent RenderViewHost to display the
1012 // page/widget that was created by
1013 // CreateWindow/CreateWidget/CreateFullscreenWidget. routing_id
1014 // refers to the id that was returned from the Create message above.
1015 // The initial_position parameter is a rectangle in screen coordinates.
1016 //
1017 // FUTURE: there will probably be flags here to control if the result is
1018 // in a new window.
1019 IPC_MESSAGE_ROUTED4(ViewHostMsg_ShowView,
1020                     int /* route_id */,
1021                     WindowOpenDisposition /* disposition */,
1022                     gfx::Rect /* initial_pos */,
1023                     bool /* opened_by_user_gesture */)
1024 
1025 IPC_MESSAGE_ROUTED2(ViewHostMsg_ShowWidget,
1026                     int /* route_id */,
1027                     gfx::Rect /* initial_pos */)
1028 
1029 // Message to show a full screen widget.
1030 IPC_MESSAGE_ROUTED1(ViewHostMsg_ShowFullscreenWidget,
1031                     int /* route_id */)
1032 
1033 // This message is sent after ViewHostMsg_ShowView to cause the RenderView
1034 // to run in a modal fashion until it is closed.
1035 IPC_SYNC_MESSAGE_ROUTED1_0(ViewHostMsg_RunModal,
1036                            int /* opener_id */)
1037 
1038 // Indicates the renderer is ready in response to a ViewMsg_New or
1039 // a ViewMsg_CreatingNew_ACK.
1040 IPC_MESSAGE_ROUTED0(ViewHostMsg_RenderViewReady)
1041 
1042 // Indicates the renderer process is gone.  This actually is sent by the
1043 // browser process to itself, but keeps the interface cleaner.
1044 IPC_MESSAGE_ROUTED2(ViewHostMsg_RenderProcessGone,
1045                     int, /* this really is base::TerminationStatus */
1046                     int /* exit_code */)
1047 
1048 // Sent by the renderer process to request that the browser close the view.
1049 // This corresponds to the window.close() API, and the browser may ignore
1050 // this message.  Otherwise, the browser will generates a ViewMsg_Close
1051 // message to close the view.
1052 IPC_MESSAGE_ROUTED0(ViewHostMsg_Close)
1053 
1054 // Send in response to a ViewMsg_UpdateScreenRects so that the renderer can
1055 // throttle these messages.
1056 IPC_MESSAGE_ROUTED0(ViewHostMsg_UpdateScreenRects_ACK)
1057 
1058 // Sent by the renderer process to request that the browser move the view.
1059 // This corresponds to the window.resizeTo() and window.moveTo() APIs, and
1060 // the browser may ignore this message.
1061 IPC_MESSAGE_ROUTED1(ViewHostMsg_RequestMove,
1062                     gfx::Rect /* position */)
1063 
1064 // Result of string search in the page.
1065 // Response to ViewMsg_Find with the results of the requested find-in-page
1066 // search, the number of matches found and the selection rect (in screen
1067 // coordinates) for the string found. If |final_update| is false, it signals
1068 // that this is not the last Find_Reply message - more will be sent as the
1069 // scoping effort continues.
1070 IPC_MESSAGE_ROUTED5(ViewHostMsg_Find_Reply,
1071                     int /* request_id */,
1072                     int /* number of matches */,
1073                     gfx::Rect /* selection_rect */,
1074                     int /* active_match_ordinal */,
1075                     bool /* final_update */)
1076 
1077 // Indicates that the render view has been closed in respose to a
1078 // Close message.
1079 IPC_MESSAGE_CONTROL1(ViewHostMsg_Close_ACK,
1080                      int /* old_route_id */)
1081 
1082 // Indicates that the current page has been closed, after a ClosePage
1083 // message.
1084 IPC_MESSAGE_ROUTED0(ViewHostMsg_ClosePage_ACK)
1085 
1086 // Notifies the browser that we have session history information.
1087 // page_id: unique ID that allows us to distinguish between history entries.
1088 IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateState,
1089                     int32 /* page_id */,
1090                     content::PageState /* state */)
1091 
1092 // Notifies the browser that we want to show a destination url for a potential
1093 // action (e.g. when the user is hovering over a link).
1094 IPC_MESSAGE_ROUTED1(ViewHostMsg_UpdateTargetURL,
1095                     GURL)
1096 
1097 // Sent when the document element is available for the top-level frame.  This
1098 // happens after the page starts loading, but before all resources are
1099 // finished.
1100 IPC_MESSAGE_ROUTED1(ViewHostMsg_DocumentAvailableInMainFrame,
1101                     bool /* uses_temporary_zoom_level */)
1102 
1103 // Sent when the renderer loads a resource from its memory cache.
1104 // The security info is non empty if the resource was originally loaded over
1105 // a secure connection.
1106 // Note: May only be sent once per URL per frame per committed load.
1107 IPC_MESSAGE_ROUTED5(ViewHostMsg_DidLoadResourceFromMemoryCache,
1108                     GURL /* url */,
1109                     std::string  /* security info */,
1110                     std::string  /* http method */,
1111                     std::string  /* mime type */,
1112                     content::ResourceType /* resource type */)
1113 
1114 // Sent when the renderer displays insecure content in a secure page.
1115 IPC_MESSAGE_ROUTED0(ViewHostMsg_DidDisplayInsecureContent)
1116 
1117 // Sent when the renderer runs insecure content in a secure origin.
1118 IPC_MESSAGE_ROUTED2(ViewHostMsg_DidRunInsecureContent,
1119                     std::string  /* security_origin */,
1120                     GURL         /* target URL */)
1121 
1122 // Sent to update part of the view.  In response to this message, the host
1123 // generates a ViewMsg_UpdateRect_ACK message.
1124 IPC_MESSAGE_ROUTED1(ViewHostMsg_UpdateRect,
1125                     ViewHostMsg_UpdateRect_Params)
1126 
1127 IPC_MESSAGE_ROUTED0(ViewHostMsg_Focus)
1128 IPC_MESSAGE_ROUTED0(ViewHostMsg_Blur)
1129 
1130 // Message sent from renderer to the browser when focus changes inside the
1131 // webpage. The parameter says whether the newly focused element needs
1132 // keyboard input (true for textfields, text areas and content editable divs).
1133 IPC_MESSAGE_ROUTED1(ViewHostMsg_FocusedNodeChanged,
1134     bool /* is_editable_node */)
1135 
1136 IPC_MESSAGE_ROUTED1(ViewHostMsg_SetCursor, content::WebCursor)
1137 
1138 // Used to set a cookie. The cookie is set asynchronously, but will be
1139 // available to a subsequent ViewHostMsg_GetCookies request.
1140 IPC_MESSAGE_CONTROL4(ViewHostMsg_SetCookie,
1141                      int /* render_frame_id */,
1142                      GURL /* url */,
1143                      GURL /* first_party_for_cookies */,
1144                      std::string /* cookie */)
1145 
1146 // Used to get cookies for the given URL. This may block waiting for a
1147 // previous SetCookie message to be processed.
1148 IPC_SYNC_MESSAGE_CONTROL3_1(ViewHostMsg_GetCookies,
1149                             int /* render_frame_id */,
1150                             GURL /* url */,
1151                             GURL /* first_party_for_cookies */,
1152                             std::string /* cookies */)
1153 
1154 // Used to get raw cookie information for the given URL. This may block
1155 // waiting for a previous SetCookie message to be processed.
1156 IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_GetRawCookies,
1157                             GURL /* url */,
1158                             GURL /* first_party_for_cookies */,
1159                             std::vector<content::CookieData>
1160                                 /* raw_cookies */)
1161 
1162 // Used to delete cookie for the given URL and name
1163 IPC_SYNC_MESSAGE_CONTROL2_0(ViewHostMsg_DeleteCookie,
1164                             GURL /* url */,
1165                             std::string /* cookie_name */)
1166 
1167 // Used to check if cookies are enabled for the given URL. This may block
1168 // waiting for a previous SetCookie message to be processed.
1169 IPC_SYNC_MESSAGE_CONTROL3_1(ViewHostMsg_CookiesEnabled,
1170                             int /* render_frame_id */,
1171                             GURL /* url */,
1172                             GURL /* first_party_for_cookies */,
1173                             bool /* cookies_enabled */)
1174 
1175 // Used to get the list of plugins
1176 IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_GetPlugins,
1177     bool /* refresh*/,
1178     std::vector<content::WebPluginInfo> /* plugins */)
1179 
1180 #if defined(OS_WIN)
1181 IPC_MESSAGE_ROUTED1(ViewHostMsg_WindowlessPluginDummyWindowCreated,
1182                     gfx::NativeViewId /* dummy_activation_window */)
1183 
1184 IPC_MESSAGE_ROUTED1(ViewHostMsg_WindowlessPluginDummyWindowDestroyed,
1185                     gfx::NativeViewId /* dummy_activation_window */)
1186 
1187 // Asks the browser for the user's monitor profile.
1188 IPC_SYNC_MESSAGE_CONTROL0_1(ViewHostMsg_GetMonitorColorProfile,
1189                             std::vector<char> /* profile */)
1190 #endif
1191 
1192 // Get the list of proxies to use for |url|, as a semicolon delimited list
1193 // of "<TYPE> <HOST>:<PORT>" | "DIRECT".
1194 IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_ResolveProxy,
1195                             GURL /* url */,
1196                             bool /* result */,
1197                             std::string /* proxy list */)
1198 
1199 // A renderer sends this to the browser process when it wants to create a
1200 // worker.  The browser will create the worker process if necessary, and
1201 // will return the route id on success.  On error returns MSG_ROUTING_NONE.
1202 IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_CreateWorker,
1203                             ViewHostMsg_CreateWorker_Params,
1204                             int /* route_id */)
1205 
1206 // A renderer sends this to the browser process when a document has been
1207 // detached. The browser will use this to constrain the lifecycle of worker
1208 // processes (SharedWorkers are shut down when their last associated document
1209 // is detached).
1210 IPC_MESSAGE_CONTROL1(ViewHostMsg_DocumentDetached,
1211                      uint64 /* document_id */)
1212 
1213 // Wraps an IPC message that's destined to the worker on the renderer->browser
1214 // hop.
1215 IPC_MESSAGE_CONTROL1(ViewHostMsg_ForwardToWorker,
1216                      IPC::Message /* message */)
1217 
1218 // Tells the browser that a specific Appcache manifest in the current page
1219 // was accessed.
1220 IPC_MESSAGE_ROUTED2(ViewHostMsg_AppCacheAccessed,
1221                     GURL /* manifest url */,
1222                     bool /* blocked by policy */)
1223 
1224 // Initiates a download based on user actions like 'ALT+click'.
1225 IPC_MESSAGE_CONTROL4(ViewHostMsg_DownloadUrl,
1226                      int /* render_view_id */,
1227                      GURL /* url */,
1228                      content::Referrer /* referrer */,
1229                      base::string16 /* suggested_name */)
1230 
1231 // Used to go to the session history entry at the given offset (ie, -1 will
1232 // return the "back" item).
1233 IPC_MESSAGE_ROUTED1(ViewHostMsg_GoToEntryAtOffset,
1234                     int /* offset (from current) of history item to get */)
1235 
1236 // Sent from an inactive renderer for the browser to route to the active
1237 // renderer, instructing it to close.
1238 IPC_MESSAGE_ROUTED0(ViewHostMsg_RouteCloseEvent)
1239 
1240 // Sent to the browser from an inactive renderer to post a message to the
1241 // active renderer.
1242 IPC_MESSAGE_ROUTED1(ViewHostMsg_RouteMessageEvent,
1243                     ViewMsg_PostMessage_Params)
1244 
1245 // Notifies that the preferred size of the content changed.
1246 IPC_MESSAGE_ROUTED1(ViewHostMsg_DidContentsPreferredSizeChange,
1247                     gfx::Size /* pref_size */)
1248 
1249 // Notifies whether there are JavaScript touch event handlers or not.
1250 IPC_MESSAGE_ROUTED1(ViewHostMsg_HasTouchEventHandlers,
1251                     bool /* has_handlers */)
1252 
1253 // A message from HTML-based UI.  When (trusted) Javascript calls
1254 // send(message, args), this message is sent to the browser.
1255 IPC_MESSAGE_ROUTED3(ViewHostMsg_WebUISend,
1256                     GURL /* source_url */,
1257                     std::string  /* message */,
1258                     base::ListValue /* args */)
1259 
1260 #if defined(ENABLE_PLUGINS)
1261 // A renderer sends this to the browser process when it wants to create a ppapi
1262 // plugin.  The browser will create the plugin process if necessary, and will
1263 // return a handle to the channel on success.
1264 //
1265 // The plugin_child_id is the ChildProcessHost ID assigned in the browser
1266 // process. This ID is valid only in the context of the browser process and is
1267 // used to identify the proper process when the renderer notifies it that the
1268 // plugin is hung.
1269 //
1270 // On error an empty string and null handles are returned.
1271 IPC_SYNC_MESSAGE_CONTROL1_3(ViewHostMsg_OpenChannelToPepperPlugin,
1272                             base::FilePath /* path */,
1273                             IPC::ChannelHandle /* handle to channel */,
1274                             base::ProcessId /* plugin_pid */,
1275                             int /* plugin_child_id */)
1276 
1277 // Notification that a plugin has created a new plugin instance. The parameters
1278 // indicate:
1279 // -The plugin process ID that we're creating the instance for.
1280 // -The instance ID of the instance being created.
1281 // -A PepperRendererInstanceData struct which contains properties from the
1282 // renderer which are associated with the plugin instance. This includes the
1283 // routing ID of the associated render view and the URL of plugin.
1284 // -Whether the plugin we're creating an instance for is external or internal.
1285 //
1286 // This message must be sync even though it returns no parameters to avoid
1287 // a race condition with the plugin process. The plugin process sends messages
1288 // to the browser that assume the browser knows about the instance. We need to
1289 // make sure that the browser actually knows about the instance before we tell
1290 // the plugin to run.
1291 IPC_SYNC_MESSAGE_CONTROL4_0(
1292     ViewHostMsg_DidCreateOutOfProcessPepperInstance,
1293     int /* plugin_child_id */,
1294     int32 /* pp_instance */,
1295     content::PepperRendererInstanceData /* creation_data */,
1296     bool /* is_external */)
1297 
1298 // Notification that a plugin has destroyed an instance. This is the opposite of
1299 // the "DidCreate" message above.
1300 IPC_MESSAGE_CONTROL3(ViewHostMsg_DidDeleteOutOfProcessPepperInstance,
1301                      int /* plugin_child_id */,
1302                      int32 /* pp_instance */,
1303                      bool /* is_external */)
1304 
1305 // Message from the renderer to the browser indicating the in-process instance
1306 // has been created.
1307 IPC_MESSAGE_CONTROL2(ViewHostMsg_DidCreateInProcessInstance,
1308                      int32 /* instance */,
1309                      content::PepperRendererInstanceData /* instance_data */)
1310 
1311 // Message from the renderer to the browser indicating the in-process instance
1312 // has been destroyed.
1313 IPC_MESSAGE_CONTROL1(ViewHostMsg_DidDeleteInProcessInstance,
1314                      int32 /* instance */)
1315 
1316 // A renderer sends this to the browser process when it wants to
1317 // create a ppapi broker.  The browser will create the broker process
1318 // if necessary, and will return a handle to the channel on success.
1319 // On error an empty string is returned.
1320 // The browser will respond with ViewMsg_PpapiBrokerChannelCreated.
1321 IPC_MESSAGE_CONTROL2(ViewHostMsg_OpenChannelToPpapiBroker,
1322                      int /* routing_id */,
1323                      base::FilePath /* path */)
1324 
1325 // A renderer sends this to the browser process when it wants to access a PPAPI
1326 // broker. In contrast to ViewHostMsg_OpenChannelToPpapiBroker, this is called
1327 // for every connection.
1328 // The browser will respond with ViewMsg_PpapiBrokerPermissionResult.
1329 IPC_MESSAGE_ROUTED3(ViewHostMsg_RequestPpapiBrokerPermission,
1330                     int /* routing_id */,
1331                     GURL /* document_url */,
1332                     base::FilePath /* plugin_path */)
1333 #endif  // defined(ENABLE_PLUGINS)
1334 
1335 // Send the tooltip text for the current mouse position to the browser.
1336 IPC_MESSAGE_ROUTED2(ViewHostMsg_SetTooltipText,
1337                     base::string16 /* tooltip text string */,
1338                     blink::WebTextDirection /* text direction hint */)
1339 
1340 IPC_MESSAGE_ROUTED0(ViewHostMsg_SelectRange_ACK)
1341 IPC_MESSAGE_ROUTED0(ViewHostMsg_MoveCaret_ACK)
1342 
1343 // Notification that the text selection has changed.
1344 // Note: The secound parameter is the character based offset of the
1345 // base::string16
1346 // text in the document.
1347 IPC_MESSAGE_ROUTED3(ViewHostMsg_SelectionChanged,
1348                     base::string16 /* text covers the selection range */,
1349                     size_t /* the offset of the text in the document */,
1350                     gfx::Range /* selection range in the document */)
1351 
1352 // Notification that the selection bounds have changed.
1353 IPC_MESSAGE_ROUTED1(ViewHostMsg_SelectionBoundsChanged,
1354                     ViewHostMsg_SelectionBounds_Params)
1355 
1356 // Asks the browser to display the file chooser.  The result is returned in a
1357 // ViewMsg_RunFileChooserResponse message.
1358 IPC_MESSAGE_ROUTED1(ViewHostMsg_RunFileChooser,
1359                     content::FileChooserParams)
1360 
1361 // Asks the browser to enumerate a directory.  This is equivalent to running
1362 // the file chooser in directory-enumeration mode and having the user select
1363 // the given directory.  The result is returned in a
1364 // ViewMsg_EnumerateDirectoryResponse message.
1365 IPC_MESSAGE_ROUTED2(ViewHostMsg_EnumerateDirectory,
1366                     int /* request_id */,
1367                     base::FilePath /* file_path */)
1368 
1369 // Asks the browser to save a image (for <canvas> or <img>) from a data URL.
1370 // Note: |data_url| is the contents of a data:URL, and that it's represented as
1371 // a string only to work around size limitations for GURLs in IPC messages.
1372 IPC_MESSAGE_CONTROL2(ViewHostMsg_SaveImageFromDataURL,
1373                      int /* render_view_id */,
1374                      std::string /* data_url */)
1375 
1376 // Tells the browser to move the focus to the next (previous if reverse is
1377 // true) focusable element.
1378 IPC_MESSAGE_ROUTED1(ViewHostMsg_TakeFocus,
1379                     bool /* reverse */)
1380 
1381 // Required for opening a date/time dialog
1382 IPC_MESSAGE_ROUTED1(ViewHostMsg_OpenDateTimeDialog,
1383                     ViewHostMsg_DateTimeDialogValue_Params /* value */)
1384 
1385 IPC_MESSAGE_ROUTED3(ViewHostMsg_TextInputTypeChanged,
1386                     ui::TextInputType /* TextInputType of the focused node */,
1387                     ui::TextInputMode /* TextInputMode of the focused node */,
1388                     bool /* can_compose_inline in the focused node */)
1389 
1390 // Required for updating text input state.
1391 IPC_MESSAGE_ROUTED1(ViewHostMsg_TextInputStateChanged,
1392                     ViewHostMsg_TextInputState_Params /* input state params */)
1393 
1394 // Sent when the renderer changes the zoom level for a particular url, so the
1395 // browser can update its records.  If the view is a plugin doc, then url is
1396 // used to update the zoom level for all pages in that site.  Otherwise, the
1397 // render view's id is used so that only the menu is updated.
1398 IPC_MESSAGE_ROUTED2(ViewHostMsg_DidZoomURL,
1399                     double /* zoom_level */,
1400                     GURL /* url */)
1401 
1402 // Updates the minimum/maximum allowed zoom percent for this tab from the
1403 // default values.  If |remember| is true, then the zoom setting is applied to
1404 // other pages in the site and is saved, otherwise it only applies to this
1405 // tab.
1406 IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateZoomLimits,
1407                     int /* minimum_percent */,
1408                     int /* maximum_percent */)
1409 
1410 // Notify the browser that this render process can or can't be suddenly
1411 // terminated.
1412 IPC_MESSAGE_CONTROL1(ViewHostMsg_SuddenTerminationChanged,
1413                      bool /* enabled */)
1414 
1415 IPC_MESSAGE_ROUTED3(
1416     ViewHostMsg_SwapCompositorFrame,
1417     uint32 /* output_surface_id */,
1418     cc::CompositorFrame /* frame */,
1419     std::vector<IPC::Message> /* messages_to_deliver_with_frame */)
1420 
1421 // Sent by the compositor when a flinging animation is stopped.
1422 IPC_MESSAGE_ROUTED0(ViewHostMsg_DidStopFlinging)
1423 
1424 //---------------------------------------------------------------------------
1425 // Request for cryptographic operation messages:
1426 // These are messages from the renderer to the browser to perform a
1427 // cryptographic operation.
1428 
1429 // Asks the browser process to generate a keypair for grabbing a client
1430 // certificate from a CA (<keygen> tag), and returns the signed public
1431 // key and challenge string.
1432 IPC_SYNC_MESSAGE_CONTROL3_1(ViewHostMsg_Keygen,
1433                             uint32 /* key size index */,
1434                             std::string /* challenge string */,
1435                             GURL /* URL of requestor */,
1436                             std::string /* signed public key and challenge */)
1437 
1438 // Message sent from the renderer to the browser to request that the browser
1439 // cache |data| associated with |url|.
1440 IPC_MESSAGE_CONTROL3(ViewHostMsg_DidGenerateCacheableMetadata,
1441                      GURL /* url */,
1442                      double /* expected_response_time */,
1443                      std::vector<char> /* data */)
1444 
1445 // Register a new handler for URL requests with the given scheme.
1446 IPC_MESSAGE_ROUTED4(ViewHostMsg_RegisterProtocolHandler,
1447                     std::string /* scheme */,
1448                     GURL /* url */,
1449                     base::string16 /* title */,
1450                     bool /* user_gesture */)
1451 
1452 // Unregister the registered handler for URL requests with the given scheme.
1453 IPC_MESSAGE_ROUTED3(ViewHostMsg_UnregisterProtocolHandler,
1454                     std::string /* scheme */,
1455                     GURL /* url */,
1456                     bool /* user_gesture */)
1457 
1458 // Puts the browser into "tab fullscreen" mode for the sending renderer.
1459 // See the comment in chrome/browser/ui/browser.h for more details.
1460 IPC_MESSAGE_ROUTED1(ViewHostMsg_ToggleFullscreen,
1461                     bool /* enter_fullscreen */)
1462 
1463 // Send back a string to be recorded by UserMetrics.
1464 IPC_MESSAGE_CONTROL1(ViewHostMsg_UserMetricsRecordAction,
1465                      std::string /* action */)
1466 
1467 // Notifies the browser that the page was or was not saved as MHTML.
1468 IPC_MESSAGE_CONTROL2(ViewHostMsg_SavedPageAsMHTML,
1469                      int /* job_id */,
1470                      int64 /* size of the MHTML file, -1 if error */)
1471 
1472 IPC_MESSAGE_ROUTED3(ViewHostMsg_SendCurrentPageAllSavableResourceLinks,
1473                     std::vector<GURL> /* all savable resource links */,
1474                     std::vector<content::Referrer> /* all referrers */,
1475                     std::vector<GURL> /* all frame links */)
1476 
1477 IPC_MESSAGE_ROUTED3(ViewHostMsg_SendSerializedHtmlData,
1478                     GURL /* frame's url */,
1479                     std::string /* data buffer */,
1480                     int32 /* complete status */)
1481 
1482 // Notifies the browser of an event occurring in the media pipeline.
1483 IPC_MESSAGE_CONTROL1(ViewHostMsg_MediaLogEvents,
1484                      std::vector<media::MediaLogEvent> /* events */)
1485 
1486 // Requests to lock the mouse. Will result in a ViewMsg_LockMouse_ACK message
1487 // being sent back.
1488 // |privileged| is used by Pepper Flash. If this flag is set to true, we won't
1489 // pop up a bubble to ask for user permission or take mouse lock content into
1490 // account.
1491 IPC_MESSAGE_ROUTED3(ViewHostMsg_LockMouse,
1492                     bool /* user_gesture */,
1493                     bool /* last_unlocked_by_target */,
1494                     bool /* privileged */)
1495 
1496 // Requests to unlock the mouse. A ViewMsg_MouseLockLost message will be sent
1497 // whenever the mouse is unlocked (which may or may not be caused by
1498 // ViewHostMsg_UnlockMouse).
1499 IPC_MESSAGE_ROUTED0(ViewHostMsg_UnlockMouse)
1500 
1501 // Notifies that multiple touch targets may have been pressed, and to show
1502 // the disambiguation popup.
1503 IPC_MESSAGE_ROUTED3(ViewHostMsg_ShowDisambiguationPopup,
1504                     gfx::Rect, /* Border of touched targets */
1505                     gfx::Size, /* Size of zoomed image */
1506                     cc::SharedBitmapId /* id */)
1507 
1508 // Sent by the renderer process to check whether client 3D APIs
1509 // (Pepper 3D, WebGL) are explicitly blocked.
1510 IPC_SYNC_MESSAGE_CONTROL3_1(ViewHostMsg_Are3DAPIsBlocked,
1511                             int /* render_view_id */,
1512                             GURL /* top_origin_url */,
1513                             content::ThreeDAPIType /* requester */,
1514                             bool /* blocked */)
1515 
1516 // Sent by the renderer process to indicate that a context was lost by
1517 // client 3D content (Pepper 3D, WebGL) running on the page at the
1518 // given URL.
1519 IPC_MESSAGE_CONTROL3(ViewHostMsg_DidLose3DContext,
1520                      GURL /* top_origin_url */,
1521                      content::ThreeDAPIType /* context_type */,
1522                      int /* arb_robustness_status_code */)
1523 
1524 // Notifies the browser that document has parsed the body. This is used by the
1525 // ResourceScheduler as an indication that bandwidth contention won't block
1526 // first paint.
1527 IPC_MESSAGE_ROUTED0(ViewHostMsg_WillInsertBody)
1528 
1529 // Notification that the urls for the favicon of a site has been determined.
1530 IPC_MESSAGE_ROUTED1(ViewHostMsg_UpdateFaviconURL,
1531                     std::vector<content::FaviconURL> /* candidates */)
1532 
1533 // Sent by the renderer to the browser to start a vibration with the given
1534 // duration.
1535 IPC_MESSAGE_CONTROL1(ViewHostMsg_Vibrate,
1536                      int64 /* milliseconds */)
1537 
1538 // Sent by the renderer to the browser to cancel the currently running
1539 // vibration, if there is one.
1540 IPC_MESSAGE_CONTROL0(ViewHostMsg_CancelVibration)
1541 
1542 // Message sent from renderer to the browser when the element that is focused
1543 // has been touched. A bool is passed in this message which indicates if the
1544 // node is editable.
1545 IPC_MESSAGE_ROUTED1(ViewHostMsg_FocusedNodeTouched,
1546                     bool /* editable */)
1547 
1548 // Message sent from the renderer to the browser when an HTML form has failed
1549 // validation constraints.
1550 IPC_MESSAGE_ROUTED3(ViewHostMsg_ShowValidationMessage,
1551                     gfx::Rect /* anchor rectangle in root view coordinate */,
1552                     base::string16 /* validation message */,
1553                     base::string16 /* supplemental text */)
1554 
1555 // Message sent from the renderer to the browser when a HTML form validation
1556 // message should be hidden from view.
1557 IPC_MESSAGE_ROUTED0(ViewHostMsg_HideValidationMessage)
1558 
1559 // Message sent from the renderer to the browser when the suggested co-ordinates
1560 // of the anchor for a HTML form validation message have changed.
1561 IPC_MESSAGE_ROUTED1(ViewHostMsg_MoveValidationMessage,
1562                     gfx::Rect /* anchor rectangle in root view coordinate */)
1563 
1564 #if defined(OS_ANDROID)
1565 // Response to ViewMsg_FindMatchRects.
1566 //
1567 // |version| will contain the current version number of the renderer's find
1568 // match list (incremented whenever they change), which should be passed in the
1569 // next call to ViewMsg_FindMatchRects.
1570 //
1571 // |rects| will either contain a list of the enclosing rects of all matches
1572 // found by the most recent Find operation, or will be empty if |version| is not
1573 // greater than the |current_version| passed to ViewMsg_FindMatchRects (hence
1574 // your locally cached rects should still be valid). The rect coords will be
1575 // custom normalized fractions of the document size. The rects will be sorted by
1576 // frame traversal order starting in the main frame, then by dom order.
1577 //
1578 // |active_rect| will contain the bounding box of the active find-in-page match
1579 // marker, in similarly normalized coords (or an empty rect if there isn't one).
1580 IPC_MESSAGE_ROUTED3(ViewHostMsg_FindMatchRects_Reply,
1581                     int /* version */,
1582                     std::vector<gfx::RectF> /* rects */,
1583                     gfx::RectF /* active_rect */)
1584 
1585 // Start an android intent with the given URI.
1586 IPC_MESSAGE_ROUTED1(ViewHostMsg_StartContentIntent,
1587                     GURL /* content_url */)
1588 
1589 // Message sent when the renderer changed the background color for the view.
1590 IPC_MESSAGE_ROUTED1(ViewHostMsg_DidChangeBodyBackgroundColor,
1591                     uint32  /* bg_color */)
1592 
1593 // This message runs the MediaCodec for decoding audio for webaudio.
1594 IPC_MESSAGE_CONTROL3(ViewHostMsg_RunWebAudioMediaCodec,
1595                      base::SharedMemoryHandle /* encoded_data_handle */,
1596                      base::FileDescriptor /* pcm_output */,
1597                      uint32_t /* data_size*/)
1598 
1599 // Sent by renderer to request a ViewMsg_BeginFrame message for upcoming
1600 // display events. If |enabled| is true, the BeginFrame message will continue
1601 // to be be delivered until the notification is disabled.
1602 IPC_MESSAGE_ROUTED1(ViewHostMsg_SetNeedsBeginFrame,
1603                     bool /* enabled */)
1604 
1605 // Reply to the ViewMsg_ExtractSmartClipData message.
1606 IPC_MESSAGE_ROUTED3(ViewHostMsg_SmartClipDataExtracted,
1607                     base::string16 /* text */,
1608                     base::string16 /* html */,
1609                     gfx::Rect /* rect */)
1610 
1611 #elif defined(OS_MACOSX)
1612 // Request that the browser load a font into shared memory for us.
1613 IPC_SYNC_MESSAGE_CONTROL1_3(ViewHostMsg_LoadFont,
1614                            FontDescriptor /* font to load */,
1615                            uint32 /* buffer size */,
1616                            base::SharedMemoryHandle /* font data */,
1617                            uint32 /* font id */)
1618 
1619 // Informs the browser that a plugin has gained or lost focus.
1620 IPC_MESSAGE_ROUTED2(ViewHostMsg_PluginFocusChanged,
1621                     bool, /* focused */
1622                     int /* plugin_id */)
1623 
1624 // Instructs the browser to start plugin IME.
1625 IPC_MESSAGE_ROUTED0(ViewHostMsg_StartPluginIme)
1626 
1627 // Receives content of a web page as plain text.
1628 IPC_MESSAGE_ROUTED1(ViewMsg_GetRenderedTextCompleted, std::string);
1629 
1630 #elif defined(OS_WIN)
1631 // Request that the given font characters be loaded by the browser so it's
1632 // cached by the OS. Please see RenderMessageFilter::OnPreCacheFontCharacters
1633 // for details.
1634 IPC_SYNC_MESSAGE_CONTROL2_0(ViewHostMsg_PreCacheFontCharacters,
1635                             LOGFONT /* font_data */,
1636                             base::string16 /* characters */)
1637 #endif
1638 
1639 #if defined(OS_POSIX)
1640 // On POSIX, we cannot allocated shared memory from within the sandbox, so
1641 // this call exists for the renderer to ask the browser to allocate memory
1642 // on its behalf. We return a file descriptor to the POSIX shared memory.
1643 // If the |cache_in_browser| flag is |true|, then a copy of the shmem is kept
1644 // by the browser, and it is the caller's repsonsibility to send a
1645 // ViewHostMsg_FreeTransportDIB message in order to release the cached shmem.
1646 // In all cases, the caller is responsible for deleting the resulting
1647 // TransportDIB.
1648 IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_AllocTransportDIB,
1649                             uint32_t, /* bytes requested */
1650                             bool, /* cache in the browser */
1651                             TransportDIB::Handle /* DIB */)
1652 
1653 // Since the browser keeps handles to the allocated transport DIBs, this
1654 // message is sent to tell the browser that it may release them when the
1655 // renderer is finished with them.
1656 IPC_MESSAGE_CONTROL1(ViewHostMsg_FreeTransportDIB,
1657                      TransportDIB::Id /* DIB id */)
1658 #endif
1659 
1660 // Adding a new message? Stick to the sort order above: first platform
1661 // independent ViewMsg, then ifdefs for platform specific ViewMsg, then platform
1662 // independent ViewHostMsg, then ifdefs for platform specific ViewHostMsg.
1663