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