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