view_messages.h revision a3f7b4e666c476898878fa745f637129375cd889
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.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/browser_rendering_stats.h"
15#include "content/common/content_export.h"
16#include "content/common/content_param_traits.h"
17#include "content/common/cookie_data.h"
18#include "content/common/navigation_gesture.h"
19#include "content/common/pepper_renderer_instance_data.h"
20#include "content/common/view_message_enums.h"
21#include "content/common/webplugin_geometry.h"
22#include "content/port/common/input_event_ack_state.h"
23#include "content/public/common/common_param_traits.h"
24#include "content/public/common/context_menu_params.h"
25#include "content/public/common/favicon_url.h"
26#include "content/public/common/file_chooser_params.h"
27#include "content/public/common/frame_navigate_params.h"
28#include "content/public/common/javascript_message_type.h"
29#include "content/public/common/menu_item.h"
30#include "content/public/common/page_state.h"
31#include "content/public/common/page_zoom.h"
32#include "content/public/common/referrer.h"
33#include "content/public/common/renderer_preferences.h"
34#include "content/public/common/stop_find_action.h"
35#include "content/public/common/three_d_api_types.h"
36#include "content/public/common/window_container_type.h"
37#include "ipc/ipc_channel_handle.h"
38#include "ipc/ipc_message_macros.h"
39#include "ipc/ipc_platform_file.h"
40#include "media/audio/audio_parameters.h"
41#include "media/base/channel_layout.h"
42#include "media/base/media_log_event.h"
43#include "third_party/WebKit/public/platform/WebFloatPoint.h"
44#include "third_party/WebKit/public/platform/WebFloatRect.h"
45#include "third_party/WebKit/public/web/WebCompositionUnderline.h"
46#include "third_party/WebKit/public/web/WebFindOptions.h"
47#include "third_party/WebKit/public/web/WebMediaPlayerAction.h"
48#include "third_party/WebKit/public/web/WebPluginAction.h"
49#include "third_party/WebKit/public/web/WebPopupType.h"
50#include "third_party/WebKit/public/web/WebScreenInfo.h"
51#include "third_party/WebKit/public/web/WebTextDirection.h"
52#include "third_party/WebKit/public/web/WebWindowFeatures.h"
53#include "third_party/skia/include/core/SkBitmap.h"
54#include "ui/base/ime/text_input_mode.h"
55#include "ui/base/ime/text_input_type.h"
56#include "ui/base/range/range.h"
57#include "ui/base/ui_base_types.h"
58#include "ui/gfx/point.h"
59#include "ui/gfx/rect.h"
60#include "ui/gfx/rect_f.h"
61#include "ui/gfx/vector2d.h"
62#include "ui/gfx/vector2d_f.h"
63#include "ui/shell_dialogs/selected_file_info.h"
64
65#if defined(OS_MACOSX)
66#include "content/common/mac/font_descriptor.h"
67#endif
68
69#undef IPC_MESSAGE_EXPORT
70#define IPC_MESSAGE_EXPORT CONTENT_EXPORT
71
72#define IPC_MESSAGE_START ViewMsgStart
73
74IPC_ENUM_TRAITS(AccessibilityMode)
75IPC_ENUM_TRAITS(ViewMsg_Navigate_Type::Value)
76IPC_ENUM_TRAITS(WebKit::WebContextMenuData::MediaType)
77IPC_ENUM_TRAITS(WebKit::WebMediaPlayerAction::Type)
78IPC_ENUM_TRAITS(WebKit::WebPluginAction::Type)
79IPC_ENUM_TRAITS(WebKit::WebPopupType)
80IPC_ENUM_TRAITS(WebKit::WebTextDirection)
81IPC_ENUM_TRAITS(WindowContainerType)
82IPC_ENUM_TRAITS(content::FaviconURL::IconType)
83IPC_ENUM_TRAITS(content::FileChooserParams::Mode)
84IPC_ENUM_TRAITS(content::JavaScriptMessageType)
85IPC_ENUM_TRAITS(content::MenuItem::Type)
86IPC_ENUM_TRAITS(content::NavigationGesture)
87IPC_ENUM_TRAITS(content::PageZoom)
88IPC_ENUM_TRAITS(content::RendererPreferencesHintingEnum)
89IPC_ENUM_TRAITS(content::RendererPreferencesSubpixelRenderingEnum)
90IPC_ENUM_TRAITS(content::StopFindAction)
91IPC_ENUM_TRAITS(content::ThreeDAPIType)
92IPC_ENUM_TRAITS(media::ChannelLayout)
93IPC_ENUM_TRAITS(media::MediaLogEvent::Type)
94IPC_ENUM_TRAITS(ui::MenuSourceType)
95IPC_ENUM_TRAITS_MAX_VALUE(ui::TextInputMode, ui::TEXT_INPUT_MODE_MAX)
96IPC_ENUM_TRAITS(ui::TextInputType)
97
98#if defined(OS_MACOSX)
99IPC_STRUCT_TRAITS_BEGIN(FontDescriptor)
100  IPC_STRUCT_TRAITS_MEMBER(font_name)
101  IPC_STRUCT_TRAITS_MEMBER(font_point_size)
102IPC_STRUCT_TRAITS_END()
103#endif
104
105IPC_STRUCT_TRAITS_BEGIN(WebKit::WebCompositionUnderline)
106  IPC_STRUCT_TRAITS_MEMBER(startOffset)
107  IPC_STRUCT_TRAITS_MEMBER(endOffset)
108  IPC_STRUCT_TRAITS_MEMBER(color)
109  IPC_STRUCT_TRAITS_MEMBER(thick)
110IPC_STRUCT_TRAITS_END()
111
112IPC_STRUCT_TRAITS_BEGIN(WebKit::WebFindOptions)
113  IPC_STRUCT_TRAITS_MEMBER(forward)
114  IPC_STRUCT_TRAITS_MEMBER(matchCase)
115  IPC_STRUCT_TRAITS_MEMBER(findNext)
116IPC_STRUCT_TRAITS_END()
117
118IPC_STRUCT_TRAITS_BEGIN(WebKit::WebMediaPlayerAction)
119  IPC_STRUCT_TRAITS_MEMBER(type)
120  IPC_STRUCT_TRAITS_MEMBER(enable)
121IPC_STRUCT_TRAITS_END()
122
123IPC_STRUCT_TRAITS_BEGIN(WebKit::WebPluginAction)
124  IPC_STRUCT_TRAITS_MEMBER(type)
125  IPC_STRUCT_TRAITS_MEMBER(enable)
126IPC_STRUCT_TRAITS_END()
127
128IPC_STRUCT_TRAITS_BEGIN(WebKit::WebFloatPoint)
129  IPC_STRUCT_TRAITS_MEMBER(x)
130  IPC_STRUCT_TRAITS_MEMBER(y)
131IPC_STRUCT_TRAITS_END()
132
133IPC_STRUCT_TRAITS_BEGIN(WebKit::WebFloatRect)
134  IPC_STRUCT_TRAITS_MEMBER(x)
135  IPC_STRUCT_TRAITS_MEMBER(y)
136  IPC_STRUCT_TRAITS_MEMBER(width)
137  IPC_STRUCT_TRAITS_MEMBER(height)
138IPC_STRUCT_TRAITS_END()
139
140IPC_STRUCT_TRAITS_BEGIN(WebKit::WebScreenInfo)
141  IPC_STRUCT_TRAITS_MEMBER(deviceScaleFactor)
142  IPC_STRUCT_TRAITS_MEMBER(depth)
143  IPC_STRUCT_TRAITS_MEMBER(depthPerComponent)
144  IPC_STRUCT_TRAITS_MEMBER(isMonochrome)
145  IPC_STRUCT_TRAITS_MEMBER(rect)
146  IPC_STRUCT_TRAITS_MEMBER(availableRect)
147IPC_STRUCT_TRAITS_END()
148
149IPC_STRUCT_TRAITS_BEGIN(content::MenuItem)
150  IPC_STRUCT_TRAITS_MEMBER(label)
151  IPC_STRUCT_TRAITS_MEMBER(tool_tip)
152  IPC_STRUCT_TRAITS_MEMBER(type)
153  IPC_STRUCT_TRAITS_MEMBER(action)
154  IPC_STRUCT_TRAITS_MEMBER(rtl)
155  IPC_STRUCT_TRAITS_MEMBER(has_directional_override)
156  IPC_STRUCT_TRAITS_MEMBER(enabled)
157  IPC_STRUCT_TRAITS_MEMBER(checked)
158  IPC_STRUCT_TRAITS_MEMBER(submenu)
159IPC_STRUCT_TRAITS_END()
160
161IPC_STRUCT_TRAITS_BEGIN(content::ContextMenuParams)
162  IPC_STRUCT_TRAITS_MEMBER(media_type)
163  IPC_STRUCT_TRAITS_MEMBER(x)
164  IPC_STRUCT_TRAITS_MEMBER(y)
165  IPC_STRUCT_TRAITS_MEMBER(link_url)
166  IPC_STRUCT_TRAITS_MEMBER(link_text)
167  IPC_STRUCT_TRAITS_MEMBER(unfiltered_link_url)
168  IPC_STRUCT_TRAITS_MEMBER(src_url)
169  IPC_STRUCT_TRAITS_MEMBER(is_image_blocked)
170  IPC_STRUCT_TRAITS_MEMBER(page_url)
171  IPC_STRUCT_TRAITS_MEMBER(keyword_url)
172  IPC_STRUCT_TRAITS_MEMBER(frame_url)
173  IPC_STRUCT_TRAITS_MEMBER(frame_page_state)
174  IPC_STRUCT_TRAITS_MEMBER(media_flags)
175  IPC_STRUCT_TRAITS_MEMBER(selection_text)
176  IPC_STRUCT_TRAITS_MEMBER(misspelled_word)
177  IPC_STRUCT_TRAITS_MEMBER(misspelling_hash)
178  IPC_STRUCT_TRAITS_MEMBER(dictionary_suggestions)
179  IPC_STRUCT_TRAITS_MEMBER(speech_input_enabled)
180  IPC_STRUCT_TRAITS_MEMBER(spellcheck_enabled)
181  IPC_STRUCT_TRAITS_MEMBER(is_editable)
182#if defined(OS_MACOSX)
183  IPC_STRUCT_TRAITS_MEMBER(writing_direction_default)
184  IPC_STRUCT_TRAITS_MEMBER(writing_direction_left_to_right)
185  IPC_STRUCT_TRAITS_MEMBER(writing_direction_right_to_left)
186#endif  // OS_MACOSX
187  IPC_STRUCT_TRAITS_MEMBER(edit_flags)
188  IPC_STRUCT_TRAITS_MEMBER(security_info)
189  IPC_STRUCT_TRAITS_MEMBER(frame_charset)
190  IPC_STRUCT_TRAITS_MEMBER(referrer_policy)
191  IPC_STRUCT_TRAITS_MEMBER(custom_context)
192  IPC_STRUCT_TRAITS_MEMBER(custom_items)
193  IPC_STRUCT_TRAITS_MEMBER(source_type)
194#if defined(OS_ANDROID)
195  IPC_STRUCT_TRAITS_MEMBER(selection_start)
196  IPC_STRUCT_TRAITS_MEMBER(selection_end)
197#endif
198IPC_STRUCT_TRAITS_END()
199
200IPC_STRUCT_TRAITS_BEGIN(content::CustomContextMenuContext)
201  IPC_STRUCT_TRAITS_MEMBER(is_pepper_menu)
202  IPC_STRUCT_TRAITS_MEMBER(request_id)
203  IPC_STRUCT_TRAITS_MEMBER(render_widget_id)
204IPC_STRUCT_TRAITS_END()
205
206IPC_STRUCT_TRAITS_BEGIN(content::FaviconURL)
207  IPC_STRUCT_TRAITS_MEMBER(icon_url)
208  IPC_STRUCT_TRAITS_MEMBER(icon_type)
209IPC_STRUCT_TRAITS_END()
210
211IPC_STRUCT_TRAITS_BEGIN(content::FileChooserParams)
212  IPC_STRUCT_TRAITS_MEMBER(mode)
213  IPC_STRUCT_TRAITS_MEMBER(title)
214  IPC_STRUCT_TRAITS_MEMBER(default_file_name)
215  IPC_STRUCT_TRAITS_MEMBER(accept_types)
216#if defined(OS_ANDROID)
217  IPC_STRUCT_TRAITS_MEMBER(capture)
218#endif
219IPC_STRUCT_TRAITS_END()
220
221IPC_STRUCT_TRAITS_BEGIN(content::FrameNavigateParams)
222  IPC_STRUCT_TRAITS_MEMBER(page_id)
223  IPC_STRUCT_TRAITS_MEMBER(url)
224  IPC_STRUCT_TRAITS_MEMBER(base_url)
225  IPC_STRUCT_TRAITS_MEMBER(referrer)
226  IPC_STRUCT_TRAITS_MEMBER(transition)
227  IPC_STRUCT_TRAITS_MEMBER(redirects)
228  IPC_STRUCT_TRAITS_MEMBER(should_update_history)
229  IPC_STRUCT_TRAITS_MEMBER(searchable_form_url)
230  IPC_STRUCT_TRAITS_MEMBER(searchable_form_encoding)
231  IPC_STRUCT_TRAITS_MEMBER(password_form)
232  IPC_STRUCT_TRAITS_MEMBER(contents_mime_type)
233  IPC_STRUCT_TRAITS_MEMBER(socket_address)
234IPC_STRUCT_TRAITS_END()
235
236IPC_STRUCT_TRAITS_BEGIN(content::PepperRendererInstanceData)
237  IPC_STRUCT_TRAITS_MEMBER(render_process_id)
238  IPC_STRUCT_TRAITS_MEMBER(render_view_id)
239  IPC_STRUCT_TRAITS_MEMBER(document_url)
240  IPC_STRUCT_TRAITS_MEMBER(plugin_url)
241IPC_STRUCT_TRAITS_END()
242
243IPC_STRUCT_TRAITS_BEGIN(content::RendererPreferences)
244  IPC_STRUCT_TRAITS_MEMBER(can_accept_load_drops)
245  IPC_STRUCT_TRAITS_MEMBER(should_antialias_text)
246  IPC_STRUCT_TRAITS_MEMBER(hinting)
247  IPC_STRUCT_TRAITS_MEMBER(use_autohinter)
248  IPC_STRUCT_TRAITS_MEMBER(use_bitmaps)
249  IPC_STRUCT_TRAITS_MEMBER(subpixel_rendering)
250  IPC_STRUCT_TRAITS_MEMBER(use_subpixel_positioning)
251  IPC_STRUCT_TRAITS_MEMBER(focus_ring_color)
252  IPC_STRUCT_TRAITS_MEMBER(thumb_active_color)
253  IPC_STRUCT_TRAITS_MEMBER(thumb_inactive_color)
254  IPC_STRUCT_TRAITS_MEMBER(track_color)
255  IPC_STRUCT_TRAITS_MEMBER(active_selection_bg_color)
256  IPC_STRUCT_TRAITS_MEMBER(active_selection_fg_color)
257  IPC_STRUCT_TRAITS_MEMBER(inactive_selection_bg_color)
258  IPC_STRUCT_TRAITS_MEMBER(inactive_selection_fg_color)
259  IPC_STRUCT_TRAITS_MEMBER(browser_handles_non_local_top_level_requests)
260  IPC_STRUCT_TRAITS_MEMBER(browser_handles_all_top_level_requests)
261  IPC_STRUCT_TRAITS_MEMBER(caret_blink_interval)
262  IPC_STRUCT_TRAITS_MEMBER(use_custom_colors)
263  IPC_STRUCT_TRAITS_MEMBER(enable_referrers)
264  IPC_STRUCT_TRAITS_MEMBER(enable_do_not_track)
265  IPC_STRUCT_TRAITS_MEMBER(default_zoom_level)
266  IPC_STRUCT_TRAITS_MEMBER(user_agent_override)
267  IPC_STRUCT_TRAITS_MEMBER(accept_languages)
268  IPC_STRUCT_TRAITS_MEMBER(report_frame_name_changes)
269  IPC_STRUCT_TRAITS_MEMBER(touchpad_fling_profile)
270  IPC_STRUCT_TRAITS_MEMBER(touchscreen_fling_profile)
271IPC_STRUCT_TRAITS_END()
272
273IPC_STRUCT_TRAITS_BEGIN(content::CookieData)
274  IPC_STRUCT_TRAITS_MEMBER(name)
275  IPC_STRUCT_TRAITS_MEMBER(value)
276  IPC_STRUCT_TRAITS_MEMBER(domain)
277  IPC_STRUCT_TRAITS_MEMBER(path)
278  IPC_STRUCT_TRAITS_MEMBER(expires)
279  IPC_STRUCT_TRAITS_MEMBER(http_only)
280  IPC_STRUCT_TRAITS_MEMBER(secure)
281  IPC_STRUCT_TRAITS_MEMBER(session)
282IPC_STRUCT_TRAITS_END()
283
284IPC_STRUCT_TRAITS_BEGIN(content::WebPluginGeometry)
285  IPC_STRUCT_TRAITS_MEMBER(window)
286  IPC_STRUCT_TRAITS_MEMBER(window_rect)
287  IPC_STRUCT_TRAITS_MEMBER(clip_rect)
288  IPC_STRUCT_TRAITS_MEMBER(cutout_rects)
289  IPC_STRUCT_TRAITS_MEMBER(rects_valid)
290  IPC_STRUCT_TRAITS_MEMBER(visible)
291IPC_STRUCT_TRAITS_END()
292
293IPC_STRUCT_TRAITS_BEGIN(media::MediaLogEvent)
294  IPC_STRUCT_TRAITS_MEMBER(id)
295  IPC_STRUCT_TRAITS_MEMBER(type)
296  IPC_STRUCT_TRAITS_MEMBER(params)
297  IPC_STRUCT_TRAITS_MEMBER(time)
298IPC_STRUCT_TRAITS_END()
299
300IPC_STRUCT_TRAITS_BEGIN(ui::SelectedFileInfo)
301  IPC_STRUCT_TRAITS_MEMBER(file_path)
302  IPC_STRUCT_TRAITS_MEMBER(local_path)
303  IPC_STRUCT_TRAITS_MEMBER(display_name)
304IPC_STRUCT_TRAITS_END()
305
306IPC_STRUCT_TRAITS_BEGIN(content::BrowserRenderingStats)
307  IPC_STRUCT_TRAITS_MEMBER(input_event_count)
308  IPC_STRUCT_TRAITS_MEMBER(total_input_latency)
309  IPC_STRUCT_TRAITS_MEMBER(touch_ui_count)
310  IPC_STRUCT_TRAITS_MEMBER(total_touch_ui_latency)
311  IPC_STRUCT_TRAITS_MEMBER(touch_acked_count)
312  IPC_STRUCT_TRAITS_MEMBER(total_touch_acked_latency)
313  IPC_STRUCT_TRAITS_MEMBER(scroll_update_count)
314  IPC_STRUCT_TRAITS_MEMBER(total_scroll_update_latency)
315IPC_STRUCT_TRAITS_END()
316
317IPC_STRUCT_TRAITS_BEGIN(WebKit::WebWindowFeatures)
318  IPC_STRUCT_TRAITS_MEMBER(x)
319  IPC_STRUCT_TRAITS_MEMBER(xSet)
320  IPC_STRUCT_TRAITS_MEMBER(y)
321  IPC_STRUCT_TRAITS_MEMBER(ySet)
322  IPC_STRUCT_TRAITS_MEMBER(width)
323  IPC_STRUCT_TRAITS_MEMBER(widthSet)
324  IPC_STRUCT_TRAITS_MEMBER(height)
325  IPC_STRUCT_TRAITS_MEMBER(heightSet)
326  IPC_STRUCT_TRAITS_MEMBER(menuBarVisible)
327  IPC_STRUCT_TRAITS_MEMBER(statusBarVisible)
328  IPC_STRUCT_TRAITS_MEMBER(toolBarVisible)
329  IPC_STRUCT_TRAITS_MEMBER(locationBarVisible)
330  IPC_STRUCT_TRAITS_MEMBER(scrollbarsVisible)
331  IPC_STRUCT_TRAITS_MEMBER(resizable)
332  IPC_STRUCT_TRAITS_MEMBER(fullscreen)
333  IPC_STRUCT_TRAITS_MEMBER(dialog)
334IPC_STRUCT_TRAITS_END()
335
336IPC_STRUCT_BEGIN(ViewHostMsg_CreateWindow_Params)
337  // Routing ID of the view initiating the open.
338  IPC_STRUCT_MEMBER(int, opener_id)
339
340  // True if this open request came in the context of a user gesture.
341  IPC_STRUCT_MEMBER(bool, user_gesture)
342
343  // Type of window requested.
344  IPC_STRUCT_MEMBER(WindowContainerType, window_container_type)
345
346  // The session storage namespace ID this view should use.
347  IPC_STRUCT_MEMBER(int64, session_storage_namespace_id)
348
349  // The name of the resulting frame that should be created (empty if none
350  // has been specified).
351  IPC_STRUCT_MEMBER(string16, frame_name)
352
353  // The frame identifier of the frame initiating the open.
354  IPC_STRUCT_MEMBER(int64, opener_frame_id)
355
356  // The URL of the frame initiating the open.
357  IPC_STRUCT_MEMBER(GURL, opener_url)
358
359  // The security origin of the frame initiating the open.
360  IPC_STRUCT_MEMBER(GURL, opener_security_origin)
361
362  // Whether the opener will be suppressed in the new window, in which case
363  // scripting the new window is not allowed.
364  IPC_STRUCT_MEMBER(bool, opener_suppressed)
365
366  // Whether the window should be opened in the foreground, background, etc.
367  IPC_STRUCT_MEMBER(WindowOpenDisposition, disposition)
368
369  // The URL that will be loaded in the new window (empty if none has been
370  // sepcified).
371  IPC_STRUCT_MEMBER(GURL, target_url)
372
373  // The referrer that will be used to load |target_url| (empty if none has
374  // been specified).
375  IPC_STRUCT_MEMBER(content::Referrer, referrer)
376
377  // The window features to use for the new view.
378  IPC_STRUCT_MEMBER(WebKit::WebWindowFeatures, features)
379IPC_STRUCT_END()
380
381IPC_STRUCT_BEGIN(ViewHostMsg_CreateWorker_Params)
382  // URL for the worker script.
383  IPC_STRUCT_MEMBER(GURL, url)
384
385  // Name for a SharedWorker, otherwise empty string.
386  IPC_STRUCT_MEMBER(string16, name)
387
388  // The ID of the parent document (unique within parent renderer).
389  IPC_STRUCT_MEMBER(unsigned long long, document_id)
390
391  // RenderView routing id used to send messages back to the parent.
392  IPC_STRUCT_MEMBER(int, render_view_route_id)
393
394  // The route ID to associate with the worker. If MSG_ROUTING_NONE is passed,
395  // a new unique ID is created and assigned to the worker.
396  IPC_STRUCT_MEMBER(int, route_id)
397
398  // The ID of the appcache the main shared worker script resource was loaded
399  // from, only valid for shared workers.
400  IPC_STRUCT_MEMBER(int64, script_resource_appcache_id)
401IPC_STRUCT_END()
402
403IPC_STRUCT_BEGIN(ViewHostMsg_DateTimeDialogValue_Params)
404  IPC_STRUCT_MEMBER(int, dialog_type)
405  IPC_STRUCT_MEMBER(int, year)
406  IPC_STRUCT_MEMBER(int, month)
407  IPC_STRUCT_MEMBER(int, day)
408  IPC_STRUCT_MEMBER(int, hour)
409  IPC_STRUCT_MEMBER(int, minute)
410  IPC_STRUCT_MEMBER(int, second)
411  IPC_STRUCT_MEMBER(int, week)
412  IPC_STRUCT_MEMBER(double, minimum)
413  IPC_STRUCT_MEMBER(double, maximum)
414IPC_STRUCT_END()
415
416IPC_STRUCT_BEGIN(ViewHostMsg_DidFailProvisionalLoadWithError_Params)
417  // The frame ID for the failure report.
418  IPC_STRUCT_MEMBER(int64, frame_id)
419  // True if this is the top-most frame.
420  IPC_STRUCT_MEMBER(bool, is_main_frame)
421  // Error code as reported in the DidFailProvisionalLoad callback.
422  IPC_STRUCT_MEMBER(int, error_code)
423  // An error message generated from the error_code. This can be an empty
424  // string if we were unable to find a meaningful description.
425  IPC_STRUCT_MEMBER(string16, error_description)
426  // The URL that the error is reported for.
427  IPC_STRUCT_MEMBER(GURL, url)
428  // True if the failure is the result of navigating to a POST again
429  // and we're going to show the POST interstitial.
430  IPC_STRUCT_MEMBER(bool, showing_repost_interstitial)
431IPC_STRUCT_END()
432
433// Parameters structure for ViewHostMsg_FrameNavigate, which has too many data
434// parameters to be reasonably put in a predefined IPC message.
435IPC_STRUCT_BEGIN_WITH_PARENT(ViewHostMsg_FrameNavigate_Params,
436                             content::FrameNavigateParams)
437  IPC_STRUCT_TRAITS_PARENT(content::FrameNavigateParams)
438  // The frame ID for this navigation. The frame ID uniquely identifies the
439  // frame the navigation happened in for a given renderer.
440  IPC_STRUCT_MEMBER(int64, frame_id)
441
442  // Information regarding the security of the connection (empty if the
443  // connection was not secure).
444  IPC_STRUCT_MEMBER(std::string, security_info)
445
446  // The gesture that initiated this navigation.
447  IPC_STRUCT_MEMBER(content::NavigationGesture, gesture)
448
449  // True if this was a post request.
450  IPC_STRUCT_MEMBER(bool, is_post)
451
452  // The POST body identifier. -1 if it doesn't exist.
453  IPC_STRUCT_MEMBER(int64, post_id)
454
455  // Whether the frame navigation resulted in no change to the documents within
456  // the page. For example, the navigation may have just resulted in scrolling
457  // to a named anchor.
458  IPC_STRUCT_MEMBER(bool, was_within_same_page)
459
460  // The status code of the HTTP request.
461  IPC_STRUCT_MEMBER(int, http_status_code)
462
463  // True if the connection was proxied.  In this case, socket_address
464  // will represent the address of the proxy, rather than the remote host.
465  IPC_STRUCT_MEMBER(bool, was_fetched_via_proxy)
466
467  // Serialized history item state to store in the navigation entry.
468  IPC_STRUCT_MEMBER(content::PageState, page_state)
469
470  // Original request's URL.
471  IPC_STRUCT_MEMBER(GURL, original_request_url)
472
473  // User agent override used to navigate.
474  IPC_STRUCT_MEMBER(bool, is_overriding_user_agent)
475
476  // Notifies the browser that for this navigation, the session history was
477  // successfully cleared.
478  IPC_STRUCT_MEMBER(bool, history_list_was_cleared)
479IPC_STRUCT_END()
480
481IPC_STRUCT_BEGIN(ViewHostMsg_OpenURL_Params)
482  IPC_STRUCT_MEMBER(GURL, url)
483  IPC_STRUCT_MEMBER(content::Referrer, referrer)
484  IPC_STRUCT_MEMBER(WindowOpenDisposition, disposition)
485  IPC_STRUCT_MEMBER(int64, frame_id)
486  IPC_STRUCT_MEMBER(bool, should_replace_current_entry)
487  IPC_STRUCT_MEMBER(bool, user_gesture)
488IPC_STRUCT_END()
489
490IPC_STRUCT_BEGIN(ViewHostMsg_SelectionBounds_Params)
491  IPC_STRUCT_MEMBER(gfx::Rect, anchor_rect)
492  IPC_STRUCT_MEMBER(WebKit::WebTextDirection, anchor_dir)
493  IPC_STRUCT_MEMBER(gfx::Rect, focus_rect)
494  IPC_STRUCT_MEMBER(WebKit::WebTextDirection, focus_dir)
495  IPC_STRUCT_MEMBER(bool, is_anchor_first)
496IPC_STRUCT_END()
497
498// This message is used for supporting popup menus on Mac OS X using native
499// Cocoa controls. The renderer sends us this message which we use to populate
500// the popup menu.
501IPC_STRUCT_BEGIN(ViewHostMsg_ShowPopup_Params)
502  // Position on the screen.
503  IPC_STRUCT_MEMBER(gfx::Rect, bounds)
504
505  // The height of each item in the menu.
506  IPC_STRUCT_MEMBER(int, item_height)
507
508  // The size of the font to use for those items.
509  IPC_STRUCT_MEMBER(double, item_font_size)
510
511  // The currently selected (displayed) item in the menu.
512  IPC_STRUCT_MEMBER(int, selected_item)
513
514  // The entire list of items in the popup menu.
515  IPC_STRUCT_MEMBER(std::vector<content::MenuItem>, popup_items)
516
517  // Whether items should be right-aligned.
518  IPC_STRUCT_MEMBER(bool, right_aligned)
519
520  // Whether this is a multi-select popup.
521  IPC_STRUCT_MEMBER(bool, allow_multiple_selection)
522IPC_STRUCT_END()
523
524IPC_STRUCT_BEGIN(ViewHostMsg_TextInputState_Params)
525  // The type of input field
526  IPC_STRUCT_MEMBER(ui::TextInputType, type)
527
528  // The value of the input field
529  IPC_STRUCT_MEMBER(std::string, value)
530
531  // The cursor position of the current selection start, or the caret position
532  // if nothing is selected
533  IPC_STRUCT_MEMBER(int, selection_start)
534
535  // The cursor position of the current selection end, or the caret position
536  // if nothing is selected
537  IPC_STRUCT_MEMBER(int, selection_end)
538
539  // The start position of the current composition, or -1 if there is none
540  IPC_STRUCT_MEMBER(int, composition_start)
541
542  // The end position of the current composition, or -1 if there is none
543  IPC_STRUCT_MEMBER(int, composition_end)
544
545  // Whether or not inline composition can be performed for the current input.
546  IPC_STRUCT_MEMBER(bool, can_compose_inline)
547
548  // Whether or not the IME should be shown as a result of this update. Even if
549  // true, the IME will only be shown if the type is appropriate (e.g. not
550  // TEXT_INPUT_TYPE_NONE).
551  IPC_STRUCT_MEMBER(bool, show_ime_if_needed)
552IPC_STRUCT_END()
553
554IPC_STRUCT_BEGIN(ViewHostMsg_UpdateRect_Params)
555  // The bitmap to be painted into the view at the locations specified by
556  // update_rects.
557  IPC_STRUCT_MEMBER(TransportDIB::Id, bitmap)
558
559  // The position and size of the bitmap.
560  IPC_STRUCT_MEMBER(gfx::Rect, bitmap_rect)
561
562  // The scroll delta.  Only one of the delta components can be non-zero, and if
563  // they are both zero, then it means there is no scrolling and the scroll_rect
564  // is ignored.
565  IPC_STRUCT_MEMBER(gfx::Vector2d, scroll_delta)
566
567  // The rectangular region to scroll.
568  IPC_STRUCT_MEMBER(gfx::Rect, scroll_rect)
569
570  // The scroll offset of the render view.
571  IPC_STRUCT_MEMBER(gfx::Vector2d, scroll_offset)
572
573  // The regions of the bitmap (in view coords) that contain updated pixels.
574  // In the case of scrolling, this includes the scroll damage rect.
575  IPC_STRUCT_MEMBER(std::vector<gfx::Rect>, copy_rects)
576
577  // The size of the RenderView when this message was generated.  This is
578  // included so the host knows how large the view is from the perspective of
579  // the renderer process.  This is necessary in case a resize operation is in
580  // progress. If auto-resize is enabled, this should update the corresponding
581  // view size.
582  IPC_STRUCT_MEMBER(gfx::Size, view_size)
583
584  // New window locations for plugin child windows.
585  IPC_STRUCT_MEMBER(std::vector<content::WebPluginGeometry>,
586                    plugin_window_moves)
587
588  // The following describes the various bits that may be set in flags:
589  //
590  //   ViewHostMsg_UpdateRect_Flags::IS_RESIZE_ACK
591  //     Indicates that this is a response to a ViewMsg_Resize message.
592  //
593  //   ViewHostMsg_UpdateRect_Flags::IS_RESTORE_ACK
594  //     Indicates that this is a response to a ViewMsg_WasShown message.
595  //
596  //   ViewHostMsg_UpdateRect_Flags::IS_REPAINT_ACK
597  //     Indicates that this is a response to a ViewMsg_Repaint message.
598  //
599  // If flags is zero, then this message corresponds to an unsolicited paint
600  // request by the render view.  Any of the above bits may be set in flags,
601  // which would indicate that this paint message is an ACK for multiple
602  // request messages.
603  IPC_STRUCT_MEMBER(int, flags)
604
605  // Whether or not the renderer expects a ViewMsg_UpdateRect_ACK for this
606  // update. True for 2D painting, but false for accelerated compositing.
607  IPC_STRUCT_MEMBER(bool, needs_ack)
608
609  // All the above coordinates are in DIP. This is the scale factor needed
610  // to convert them to pixels.
611  IPC_STRUCT_MEMBER(float, scale_factor)
612
613  // The latency information for the frame. Only valid when accelerated
614  // compositing is disabled.
615  IPC_STRUCT_MEMBER(ui::LatencyInfo, latency_info)
616IPC_STRUCT_END()
617
618IPC_STRUCT_BEGIN(ViewMsg_Navigate_Params)
619  // The page_id for this navigation, or -1 if it is a new navigation.  Back,
620  // Forward, and Reload navigations should have a valid page_id.  If the load
621  // succeeds, then this page_id will be reflected in the resultant
622  // ViewHostMsg_FrameNavigate message.
623  IPC_STRUCT_MEMBER(int32, page_id)
624
625  // If page_id is -1, then pending_history_list_offset will also be -1.
626  // Otherwise, it contains the offset into the history list corresponding to
627  // the current navigation.
628  IPC_STRUCT_MEMBER(int, pending_history_list_offset)
629
630  // Informs the RenderView of where its current page contents reside in
631  // session history and the total size of the session history list.
632  IPC_STRUCT_MEMBER(int, current_history_list_offset)
633  IPC_STRUCT_MEMBER(int, current_history_list_length)
634
635  // Informs the RenderView the session history should be cleared. In that
636  // case, the RenderView needs to notify the browser that the clearing was
637  // succesful when the navigation commits.
638  IPC_STRUCT_MEMBER(bool, should_clear_history_list)
639
640  // The URL to load.
641  IPC_STRUCT_MEMBER(GURL, url)
642
643  // Base URL for use in WebKit's SubstituteData.
644  // Is only used with data: URLs.
645  IPC_STRUCT_MEMBER(GURL, base_url_for_data_url)
646
647  // History URL for use in WebKit's SubstituteData.
648  // Is only used with data: URLs.
649  IPC_STRUCT_MEMBER(GURL, history_url_for_data_url)
650
651  // The URL to send in the "Referer" header field. Can be empty if there is
652  // no referrer.
653  IPC_STRUCT_MEMBER(content::Referrer, referrer)
654
655  // The type of transition.
656  IPC_STRUCT_MEMBER(content::PageTransition, transition)
657
658  // Opaque history state (received by ViewHostMsg_UpdateState).
659  IPC_STRUCT_MEMBER(content::PageState, page_state)
660
661  // Type of navigation.
662  IPC_STRUCT_MEMBER(ViewMsg_Navigate_Type::Value, navigation_type)
663
664  // The time the request was created
665  IPC_STRUCT_MEMBER(base::Time, request_time)
666
667  // Extra headers (separated by \n) to send during the request.
668  IPC_STRUCT_MEMBER(std::string, extra_headers)
669
670  // The following two members identify a previous request that has been
671  // created before this navigation is being transferred to a new render view.
672  // This serves the purpose of recycling the old request.
673  // Unless this refers to a transferred navigation, these values are -1 and -1.
674  IPC_STRUCT_MEMBER(int, transferred_request_child_id)
675  IPC_STRUCT_MEMBER(int, transferred_request_request_id)
676
677  // Whether or not we should allow the url to download.
678  IPC_STRUCT_MEMBER(bool, allow_download)
679
680  // Whether or not the user agent override string should be used.
681  IPC_STRUCT_MEMBER(bool, is_overriding_user_agent)
682
683  // True if this was a post request.
684  IPC_STRUCT_MEMBER(bool, is_post)
685
686  // If is_post is true, holds the post_data information from browser. Empty
687  // otherwise.
688  IPC_STRUCT_MEMBER(std::vector<unsigned char>, browser_initiated_post_data)
689
690  // Whether or not this url should be allowed to access local file://
691  // resources.
692  IPC_STRUCT_MEMBER(bool, can_load_local_resources)
693
694  // If not empty, which frame to navigate.
695  IPC_STRUCT_MEMBER(std::string, frame_to_navigate)
696
697  // The navigationStart time to expose to JS for this navigation.
698  IPC_STRUCT_MEMBER(base::TimeTicks, browser_navigation_start)
699IPC_STRUCT_END()
700
701IPC_STRUCT_BEGIN(ViewMsg_New_Params)
702  // Renderer-wide preferences.
703  IPC_STRUCT_MEMBER(content::RendererPreferences, renderer_preferences)
704
705  // Preferences for this view.
706  IPC_STRUCT_MEMBER(WebPreferences, web_preferences)
707
708  // The ID of the view to be created.
709  IPC_STRUCT_MEMBER(int32, view_id)
710
711  // The ID of the main frame hosted in the view.
712  IPC_STRUCT_MEMBER(int32, main_frame_routing_id)
713
714  // The ID of the rendering surface.
715  IPC_STRUCT_MEMBER(int32, surface_id)
716
717  // The session storage namespace ID this view should use.
718  IPC_STRUCT_MEMBER(int64, session_storage_namespace_id)
719
720  // The name of the frame associated with this view (or empty if none).
721  IPC_STRUCT_MEMBER(string16, frame_name)
722
723  // The route ID of the opener RenderView if we need to set one
724  // (MSG_ROUTING_NONE otherwise).
725  IPC_STRUCT_MEMBER(int, opener_route_id)
726
727  // Whether the RenderView should initially be swapped out.
728  IPC_STRUCT_MEMBER(bool, swapped_out)
729
730  // The initial page ID to use for this view, which must be larger than any
731  // existing navigation that might be loaded in the view.  Page IDs are unique
732  // to a view and are only updated by the renderer after this initial value.
733  IPC_STRUCT_MEMBER(int32, next_page_id)
734
735  // The properties of the screen associated with the view.
736  IPC_STRUCT_MEMBER(WebKit::WebScreenInfo, screen_info)
737
738  // The accessibility mode of the renderer.
739  IPC_STRUCT_MEMBER(AccessibilityMode, accessibility_mode)
740
741  // Specifies whether partially swapping composited buffers is
742  // allowed for a renderer. Partial swaps will be used if they are both
743  // allowed and supported.
744  IPC_STRUCT_MEMBER(bool, allow_partial_swap)
745IPC_STRUCT_END()
746
747IPC_STRUCT_BEGIN(ViewMsg_PostMessage_Params)
748  // The serialized script value.
749  IPC_STRUCT_MEMBER(string16, data)
750
751  // When sent to the browser, this is the routing ID of the source frame in
752  // the source process.  The browser replaces it with the routing ID of the
753  // equivalent (swapped out) frame in the destination process.
754  IPC_STRUCT_MEMBER(int, source_routing_id)
755
756  // The origin of the source frame.
757  IPC_STRUCT_MEMBER(string16, source_origin)
758
759  // The origin for the message's target.
760  IPC_STRUCT_MEMBER(string16, target_origin)
761IPC_STRUCT_END()
762
763// Messages sent from the browser to the renderer.
764
765// Tells the renderer to cancel an opened date/time dialog.
766IPC_MESSAGE_ROUTED0(ViewMsg_CancelDateTimeDialog)
767
768// Get all savable resource links from current webpage, include main
769// frame and sub-frame.
770IPC_MESSAGE_ROUTED1(ViewMsg_GetAllSavableResourceLinksForCurrentPage,
771                    GURL /* url of page which is needed to save */)
772
773// Get html data by serializing all frames of current page with lists
774// which contain all resource links that have local copy.
775IPC_MESSAGE_ROUTED3(ViewMsg_GetSerializedHtmlDataForCurrentPageWithLocalLinks,
776                    std::vector<GURL> /* urls that have local copy */,
777                    std::vector<base::FilePath> /* paths of local copy */,
778                    base::FilePath /* local directory path */)
779
780// Tells the render side that a ViewHostMsg_LockMouse message has been
781// processed. |succeeded| indicates whether the mouse has been successfully
782// locked or not.
783IPC_MESSAGE_ROUTED1(ViewMsg_LockMouse_ACK,
784                    bool /* succeeded */)
785// Tells the render side that the mouse has been unlocked.
786IPC_MESSAGE_ROUTED0(ViewMsg_MouseLockLost)
787
788// Screen was rotated. Dispatched to the onorientationchange javascript API.
789IPC_MESSAGE_ROUTED1(ViewMsg_OrientationChangeEvent,
790                    int /* orientation */)
791
792// Sent by the browser when the parameters for vsync alignment have changed.
793IPC_MESSAGE_ROUTED2(ViewMsg_UpdateVSyncParameters,
794                    base::TimeTicks /* timebase */,
795                    base::TimeDelta /* interval */)
796
797// Set the top-level frame to the provided name.
798IPC_MESSAGE_ROUTED1(ViewMsg_SetName,
799                    std::string /* frame_name */)
800
801// Sent to the RenderView when a new tab is swapped into an existing
802// tab and the histories need to be merged. The existing tab has a history of
803// |merged_history_length| which precedes the history of the new tab. All
804// page_ids >= |minimum_page_id| in the new tab are appended to the history.
805//
806// For example, suppose the history of page_ids in the new tab's RenderView
807// is [4 7 8]. This is merged into an existing tab with 3 history items, and
808// all pages in the new tab with page_id >= 7 are to be preserved.
809// The resulting page history is [-1 -1 -1 7 8].
810IPC_MESSAGE_ROUTED2(ViewMsg_SetHistoryLengthAndPrune,
811                    int, /* merge_history_length */
812                    int32 /* minimum_page_id */)
813
814// Tells the renderer to create a new view.
815// This message is slightly different, the view it takes (via
816// ViewMsg_New_Params) is the view to create, the message itself is sent as a
817// non-view control message.
818IPC_MESSAGE_CONTROL1(ViewMsg_New,
819                     ViewMsg_New_Params)
820
821// Reply in response to ViewHostMsg_ShowView or ViewHostMsg_ShowWidget.
822// similar to the new command, but used when the renderer created a view
823// first, and we need to update it.
824IPC_MESSAGE_ROUTED0(ViewMsg_CreatingNew_ACK)
825
826// Sends updated preferences to the renderer.
827IPC_MESSAGE_ROUTED1(ViewMsg_SetRendererPrefs,
828                    content::RendererPreferences)
829
830// This passes a set of webkit preferences down to the renderer.
831IPC_MESSAGE_ROUTED1(ViewMsg_UpdateWebPreferences,
832                    WebPreferences)
833
834// Informs the renderer that the timezone has changed.
835IPC_MESSAGE_ROUTED0(ViewMsg_TimezoneChange)
836
837// Tells the render view to close.
838IPC_MESSAGE_ROUTED0(ViewMsg_Close)
839
840IPC_STRUCT_BEGIN(ViewMsg_Resize_Params)
841  IPC_STRUCT_MEMBER(WebKit::WebScreenInfo, screen_info)
842  IPC_STRUCT_MEMBER(gfx::Size, new_size)
843  IPC_STRUCT_MEMBER(gfx::Size, physical_backing_size)
844  IPC_STRUCT_MEMBER(float, overdraw_bottom_height)
845  IPC_STRUCT_MEMBER(gfx::Rect, resizer_rect)
846  IPC_STRUCT_MEMBER(bool, is_fullscreen)
847IPC_STRUCT_END()
848
849// Tells the render view to change its size.  A ViewHostMsg_UpdateRect message
850// is generated in response provided new_size is not empty and not equal to
851// the view's current size.  The generated ViewHostMsg_UpdateRect message will
852// have the IS_RESIZE_ACK flag set. It also receives the resizer rect so that
853// we don't have to fetch it every time WebKit asks for it.
854IPC_MESSAGE_ROUTED1(ViewMsg_Resize,
855                    ViewMsg_Resize_Params /* params */)
856
857// Tells the render view that the resize rect has changed.
858IPC_MESSAGE_ROUTED1(ViewMsg_ChangeResizeRect,
859                    gfx::Rect /* resizer_rect */)
860
861// Sent to inform the view that it was hidden.  This allows it to reduce its
862// resource utilization.
863IPC_MESSAGE_ROUTED0(ViewMsg_WasHidden)
864
865// Tells the render view that it is no longer hidden (see WasHidden), and the
866// render view is expected to respond with a full repaint if needs_repainting
867// is true.  In that case, the generated ViewHostMsg_UpdateRect message will
868// have the IS_RESTORE_ACK flag set.  If needs_repainting is false, then this
869// message does not trigger a message in response.
870IPC_MESSAGE_ROUTED1(ViewMsg_WasShown,
871                    bool /* needs_repainting */)
872
873// Sent to inform the view that it was swapped out.  This allows the process to
874// exit if no other views are using it.
875IPC_MESSAGE_ROUTED0(ViewMsg_WasSwappedOut)
876
877// Sent to render the view into the supplied transport DIB, resize
878// the web widget to match the |page_size|, scale it by the
879// appropriate scale to make it fit the |desired_size|, and return
880// it.  In response to this message, the host generates a
881// ViewHostMsg_PaintAtSize_ACK message.  Note that the DIB *must* be
882// the right size to receive an RGBA image at the |desired_size|.
883// |tag| is sent along with ViewHostMsg_PaintAtSize_ACK unmodified to
884// identify the PaintAtSize message the ACK belongs to.
885IPC_MESSAGE_ROUTED4(ViewMsg_PaintAtSize,
886                    TransportDIB::Handle /* dib_handle */,
887                    int /* tag */,
888                    gfx::Size /* page_size */,
889                    gfx::Size /* desired_size */)
890
891// Tells the render view that a ViewHostMsg_UpdateRect message was processed.
892// This signals the render view that it can send another UpdateRect message.
893IPC_MESSAGE_ROUTED0(ViewMsg_UpdateRect_ACK)
894
895// Tells the render view that a SwapBuffers was completed. Typically,
896// SwapBuffers requests go from renderer -> GPU process -> browser. Most
897// platforms still use the GfxCxt3D Echo for receiving the SwapBuffers Ack.
898// Using Echo routes the ack from browser -> GPU process -> renderer, while this
899// Ack goes directly from browser -> renderer. This is not used for the threaded
900// compositor path.
901IPC_MESSAGE_ROUTED0(ViewMsg_SwapBuffers_ACK)
902
903// Tells the render widget that a smooth scroll completed.
904IPC_MESSAGE_ROUTED0(ViewMsg_SmoothScrollCompleted)
905
906// Tells the renderer to focus the first (last if reverse is true) focusable
907// node.
908IPC_MESSAGE_ROUTED1(ViewMsg_SetInitialFocus,
909                    bool /* reverse */)
910
911// Executes custom context menu action that was provided from WebKit.
912IPC_MESSAGE_ROUTED2(ViewMsg_CustomContextMenuAction,
913                    content::CustomContextMenuContext /* custom_context */,
914                    unsigned /* action */)
915
916// Sent in response to a ViewHostMsg_ContextMenu to let the renderer know that
917// the menu has been closed.
918IPC_MESSAGE_ROUTED1(ViewMsg_ContextMenuClosed,
919                    content::CustomContextMenuContext /* custom_context */)
920
921// Sent to inform the renderer to invoke a context menu.
922// The parameter specifies the location in the render view's coordinates.
923IPC_MESSAGE_ROUTED1(ViewMsg_ShowContextMenu,
924                    gfx::Point /* location where menu should be shown */)
925
926// Tells the renderer to perform the specified navigation, interrupting any
927// existing navigation.
928IPC_MESSAGE_ROUTED1(ViewMsg_Navigate, ViewMsg_Navigate_Params)
929
930IPC_MESSAGE_ROUTED0(ViewMsg_Stop)
931
932// Tells the renderer to reload the current focused frame
933IPC_MESSAGE_ROUTED0(ViewMsg_ReloadFrame)
934
935// Sent when the user wants to search for a word on the page (find in page).
936IPC_MESSAGE_ROUTED3(ViewMsg_Find,
937                    int /* request_id */,
938                    string16 /* search_text */,
939                    WebKit::WebFindOptions)
940
941// This message notifies the renderer that the user has closed the FindInPage
942// window (and what action to take regarding the selection).
943IPC_MESSAGE_ROUTED1(ViewMsg_StopFinding,
944                    content::StopFindAction /* action */)
945
946// Informs the renderer about various statistics the browser has (e.g.
947// latency) regarding the frames that have been displayed.
948IPC_MESSAGE_ROUTED1(ViewMsg_SetBrowserRenderingStats,
949                    content::BrowserRenderingStats /* stats */)
950
951// Replaces a date time input field.
952IPC_MESSAGE_ROUTED1(ViewMsg_ReplaceDateTime,
953                    ViewHostMsg_DateTimeDialogValue_Params /* value */)
954
955// Copies the image at location x, y to the clipboard (if there indeed is an
956// image at that location).
957IPC_MESSAGE_ROUTED2(ViewMsg_CopyImageAt,
958                    int /* x */,
959                    int /* y */)
960
961// Tells the renderer to perform the given action on the media player
962// located at the given point.
963IPC_MESSAGE_ROUTED2(ViewMsg_MediaPlayerActionAt,
964                    gfx::Point, /* location */
965                    WebKit::WebMediaPlayerAction)
966
967// Tells the renderer to perform the given action on the plugin located at
968// the given point.
969IPC_MESSAGE_ROUTED2(ViewMsg_PluginActionAt,
970                    gfx::Point, /* location */
971                    WebKit::WebPluginAction)
972
973// Request for the renderer to evaluate an xpath to a frame and execute a
974// javascript: url in that frame's context. The message is completely
975// asynchronous and no corresponding response message is sent back.
976//
977// frame_xpath contains the modified xpath notation to identify an inner
978// subframe (starting from the root frame). It is a concatenation of
979// number of smaller xpaths delimited by '\n'. Each chunk in the string can
980// be evaluated to a frame in its parent-frame's context.
981//
982// Example: /html/body/iframe/\n/html/body/div/iframe/\n/frameset/frame[0]
983// can be broken into 3 xpaths
984// /html/body/iframe evaluates to an iframe within the root frame
985// /html/body/div/iframe evaluates to an iframe within the level-1 iframe
986// /frameset/frame[0] evaluates to first frame within the level-2 iframe
987//
988// jscript_url is the string containing the javascript: url to be executed
989// in the target frame's context. The string should start with "javascript:"
990// and continue with a valid JS text.
991//
992// If the fourth parameter is true the result is sent back to the renderer
993// using the message ViewHostMsg_ScriptEvalResponse.
994// ViewHostMsg_ScriptEvalResponse is passed the ID parameter so that the
995// client can uniquely identify the request.
996IPC_MESSAGE_ROUTED4(ViewMsg_ScriptEvalRequest,
997                    string16,  /* frame_xpath */
998                    string16,  /* jscript_url */
999                    int,  /* ID */
1000                    bool  /* If true, result is sent back. */)
1001
1002// Posts a message from a frame in another process to the current renderer.
1003IPC_MESSAGE_ROUTED1(ViewMsg_PostMessageEvent,
1004                    ViewMsg_PostMessage_Params)
1005
1006// Requests that the RenderView's main frame sets its opener to null.
1007IPC_MESSAGE_ROUTED0(ViewMsg_DisownOpener)
1008
1009// Request for the renderer to evaluate an xpath to a frame and insert css
1010// into that frame's document. See ViewMsg_ScriptEvalRequest for details on
1011// allowed xpath expressions.
1012IPC_MESSAGE_ROUTED2(ViewMsg_CSSInsertRequest,
1013                    string16,  /* frame_xpath */
1014                    std::string  /* css string */)
1015
1016// Change the zoom level for the current main frame.  If the level actually
1017// changes, a ViewHostMsg_DidZoomURL message will be sent back to the browser
1018// telling it what url got zoomed and what its current zoom level is.
1019IPC_MESSAGE_ROUTED1(ViewMsg_Zoom,
1020                    content::PageZoom /* function */)
1021
1022// Set the zoom level for the current main frame.  If the level actually
1023// changes, a ViewHostMsg_DidZoomURL message will be sent back to the browser
1024// telling it what url got zoomed and what its current zoom level is.
1025IPC_MESSAGE_ROUTED1(ViewMsg_SetZoomLevel,
1026                    double /* zoom_level */)
1027
1028// Zooms the page by the factor defined in the renderer.
1029IPC_MESSAGE_ROUTED3(ViewMsg_ZoomFactor,
1030                    content::PageZoom,
1031                    int /* zoom center_x */,
1032                    int /* zoom center_y */)
1033
1034// Set the zoom level for a particular url that the renderer is in the
1035// process of loading.  This will be stored, to be used if the load commits
1036// and ignored otherwise.
1037IPC_MESSAGE_ROUTED2(ViewMsg_SetZoomLevelForLoadingURL,
1038                    GURL /* url */,
1039                    double /* zoom_level */)
1040
1041// Set the zoom level for a particular url, so all render views
1042// displaying this url can update their zoom levels to match.
1043// If scheme is empty, then only host is used for matching.
1044IPC_MESSAGE_CONTROL3(ViewMsg_SetZoomLevelForCurrentURL,
1045                     std::string /* scheme */,
1046                     std::string /* host */,
1047                     double /* zoom_level */)
1048
1049// Change encoding of page in the renderer.
1050IPC_MESSAGE_ROUTED1(ViewMsg_SetPageEncoding,
1051                    std::string /*new encoding name*/)
1052
1053// Reset encoding of page in the renderer back to default.
1054IPC_MESSAGE_ROUTED0(ViewMsg_ResetPageEncodingToDefault)
1055
1056// Used to tell a render view whether it should expose various bindings
1057// that allow JS content extended privileges.  See BindingsPolicy for valid
1058// flag values.
1059IPC_MESSAGE_ROUTED1(ViewMsg_AllowBindings,
1060                    int /* enabled_bindings_flags */)
1061
1062// Tell the renderer to add a property to the WebUI binding object.  This
1063// only works if we allowed WebUI bindings.
1064IPC_MESSAGE_ROUTED2(ViewMsg_SetWebUIProperty,
1065                    std::string /* property_name */,
1066                    std::string /* property_value_json */)
1067
1068// This message starts/stop monitoring the input method status of the focused
1069// edit control of a renderer process.
1070// Parameters
1071// * is_active (bool)
1072//   Indicates if an input method is active in the browser process.
1073//   The possible actions when a renderer process receives this message are
1074//   listed below:
1075//     Value Action
1076//     true  Start sending IPC message ViewHostMsg_ImeUpdateTextInputState
1077//           to notify the input method status of the focused edit control.
1078//     false Stop sending IPC message ViewHostMsg_ImeUpdateTextInputState.
1079IPC_MESSAGE_ROUTED1(ViewMsg_SetInputMethodActive,
1080                    bool /* is_active */)
1081
1082// This message sends a string being composed with an input method.
1083IPC_MESSAGE_ROUTED4(
1084    ViewMsg_ImeSetComposition,
1085    string16, /* text */
1086    std::vector<WebKit::WebCompositionUnderline>, /* underlines */
1087    int, /* selectiont_start */
1088    int /* selection_end */)
1089
1090// This message confirms an ongoing composition.
1091IPC_MESSAGE_ROUTED3(ViewMsg_ImeConfirmComposition,
1092                    string16 /* text */,
1093                    ui::Range /* replacement_range */,
1094                    bool /* keep_selection */)
1095
1096// Sets the text composition to be between the given start and end offsets
1097// in the currently focused editable field.
1098IPC_MESSAGE_ROUTED3(ViewMsg_SetCompositionFromExistingText,
1099    int /* start */,
1100    int /* end */,
1101    std::vector<WebKit::WebCompositionUnderline> /* underlines */)
1102
1103// Selects between the given start and end offsets in the currently focused
1104// editable field.
1105IPC_MESSAGE_ROUTED2(ViewMsg_SetEditableSelectionOffsets,
1106                    int /* start */,
1107                    int /* end */)
1108
1109// Deletes the current selection plus the specified number of characters before
1110// and after the selection or caret.
1111IPC_MESSAGE_ROUTED2(ViewMsg_ExtendSelectionAndDelete,
1112                    int /* before */,
1113                    int /* after */)
1114
1115// Used to notify the render-view that we have received a target URL. Used
1116// to prevent target URLs spamming the browser.
1117IPC_MESSAGE_ROUTED0(ViewMsg_UpdateTargetURL_ACK)
1118
1119
1120// Sets the alternate error page URL (link doctor) for the renderer process.
1121IPC_MESSAGE_ROUTED1(ViewMsg_SetAltErrorPageURL,
1122                    GURL)
1123
1124// Notifies the color chooser client that the user selected a color.
1125IPC_MESSAGE_ROUTED2(ViewMsg_DidChooseColorResponse, unsigned, SkColor)
1126
1127// Notifies the color chooser client that the color chooser has ended.
1128IPC_MESSAGE_ROUTED1(ViewMsg_DidEndColorChooser, unsigned)
1129
1130IPC_MESSAGE_ROUTED1(ViewMsg_RunFileChooserResponse,
1131                    std::vector<ui::SelectedFileInfo>)
1132
1133// Provides the results of directory enumeration.
1134IPC_MESSAGE_ROUTED2(ViewMsg_EnumerateDirectoryResponse,
1135                    int /* request_id */,
1136                    std::vector<base::FilePath> /* files_in_directory */)
1137
1138// When a renderer sends a ViewHostMsg_Focus to the browser process,
1139// the browser has the option of sending a ViewMsg_CantFocus back to
1140// the renderer.
1141IPC_MESSAGE_ROUTED0(ViewMsg_CantFocus)
1142
1143// Instructs the renderer to invoke the frame's shouldClose method, which
1144// runs the onbeforeunload event handler.  Expects the result to be returned
1145// via ViewHostMsg_ShouldClose.
1146IPC_MESSAGE_ROUTED0(ViewMsg_ShouldClose)
1147
1148// Instructs the renderer to swap out for a cross-site transition, including
1149// running the unload event handler. Expects a SwapOut_ACK message when
1150// finished.
1151IPC_MESSAGE_ROUTED0(ViewMsg_SwapOut)
1152
1153// Instructs the renderer to close the current page, including running the
1154// onunload event handler.
1155//
1156// Expects a ClosePage_ACK message when finished.
1157IPC_MESSAGE_ROUTED0(ViewMsg_ClosePage)
1158
1159// Notifies the renderer about ui theme changes
1160IPC_MESSAGE_ROUTED0(ViewMsg_ThemeChanged)
1161
1162// Notifies the renderer that a paint is to be generated for the rectangle
1163// passed in.
1164IPC_MESSAGE_ROUTED1(ViewMsg_Repaint,
1165                    gfx::Size /* The view size to be repainted */)
1166
1167// Notification that a move or resize renderer's containing window has
1168// started.
1169IPC_MESSAGE_ROUTED0(ViewMsg_MoveOrResizeStarted)
1170
1171IPC_MESSAGE_ROUTED2(ViewMsg_UpdateScreenRects,
1172                    gfx::Rect /* view_screen_rect */,
1173                    gfx::Rect /* window_screen_rect */)
1174
1175// Reply to ViewHostMsg_RequestMove, ViewHostMsg_ShowView, and
1176// ViewHostMsg_ShowWidget to inform the renderer that the browser has
1177// processed the move.  The browser may have ignored the move, but it finished
1178// processing.  This is used because the renderer keeps a temporary cache of
1179// the widget position while these asynchronous operations are in progress.
1180IPC_MESSAGE_ROUTED0(ViewMsg_Move_ACK)
1181
1182// Used to instruct the RenderView to send back updates to the preferred size.
1183IPC_MESSAGE_ROUTED0(ViewMsg_EnablePreferredSizeChangedMode)
1184
1185// Used to instruct the RenderView to automatically resize and send back
1186// updates for the new size.
1187IPC_MESSAGE_ROUTED2(ViewMsg_EnableAutoResize,
1188                    gfx::Size /* min_size */,
1189                    gfx::Size /* max_size */)
1190
1191// Used to instruct the RenderView to disalbe automatically resize.
1192IPC_MESSAGE_ROUTED1(ViewMsg_DisableAutoResize,
1193                    gfx::Size /* new_size */)
1194
1195// Changes the text direction of the currently selected input field (if any).
1196IPC_MESSAGE_ROUTED1(ViewMsg_SetTextDirection,
1197                    WebKit::WebTextDirection /* direction */)
1198
1199// Tells the renderer to clear the focused node (if any).
1200IPC_MESSAGE_ROUTED0(ViewMsg_ClearFocusedNode)
1201
1202// Make the RenderView transparent and render it onto a custom background. The
1203// background will be tiled in both directions if it is not large enough.
1204IPC_MESSAGE_ROUTED1(ViewMsg_SetBackground,
1205                    SkBitmap /* background */)
1206
1207// Used to tell the renderer not to add scrollbars with height and
1208// width below a threshold.
1209IPC_MESSAGE_ROUTED1(ViewMsg_DisableScrollbarsForSmallWindows,
1210                    gfx::Size /* disable_scrollbar_size_limit */)
1211
1212// Activate/deactivate the RenderView (i.e., set its controls' tint
1213// accordingly, etc.).
1214IPC_MESSAGE_ROUTED1(ViewMsg_SetActive,
1215                    bool /* active */)
1216
1217// Response message to ViewHostMsg_CreateShared/DedicatedWorker.
1218// Sent when the worker has started.
1219IPC_MESSAGE_ROUTED0(ViewMsg_WorkerCreated)
1220
1221// The response to ViewHostMsg_AsyncOpenFile.
1222IPC_MESSAGE_ROUTED3(ViewMsg_AsyncOpenFile_ACK,
1223                    base::PlatformFileError /* error_code */,
1224                    IPC::PlatformFileForTransit /* file descriptor */,
1225                    int /* message_id */)
1226
1227// Tells the renderer that the network state has changed and that
1228// window.navigator.onLine should be updated for all WebViews.
1229IPC_MESSAGE_CONTROL1(ViewMsg_NetworkStateChanged,
1230                     bool /* online */)
1231
1232// Reply to ViewHostMsg_OpenChannelToPpapiBroker
1233// Tells the renderer that the channel to the broker has been created.
1234IPC_MESSAGE_ROUTED3(ViewMsg_PpapiBrokerChannelCreated,
1235                    int /* request_id */,
1236                    base::ProcessId /* broker_pid */,
1237                    IPC::ChannelHandle /* handle */)
1238
1239// Reply to ViewHostMsg_RequestPpapiBrokerPermission.
1240// Tells the renderer whether permission to access to PPAPI broker was granted
1241// or not.
1242IPC_MESSAGE_ROUTED2(ViewMsg_PpapiBrokerPermissionResult,
1243                    int /* request_id */,
1244                    bool /* result */)
1245
1246// Tells the renderer to empty its plugin list cache, optional reloading
1247// pages containing plugins.
1248IPC_MESSAGE_CONTROL1(ViewMsg_PurgePluginListCache,
1249                     bool /* reload_pages */)
1250
1251// Sent to the renderer when a popup window should no longer count against
1252// the current popup count (either because it's not a popup or because it was
1253// a generated by a user action).
1254IPC_MESSAGE_ROUTED0(ViewMsg_DisassociateFromPopupCount)
1255
1256// Used to instruct the RenderView to go into "view source" mode.
1257IPC_MESSAGE_ROUTED0(ViewMsg_EnableViewSourceMode)
1258
1259// Instructs the renderer to save the current page to MHTML.
1260IPC_MESSAGE_ROUTED2(ViewMsg_SavePageAsMHTML,
1261                    int /* job_id */,
1262                    IPC::PlatformFileForTransit /* file handle */)
1263
1264// Temporary message to diagnose an unexpected condition in WebContentsImpl.
1265IPC_MESSAGE_CONTROL1(ViewMsg_TempCrashWithData,
1266                     GURL /* data */)
1267
1268// Change the accessibility mode in the renderer process.
1269IPC_MESSAGE_ROUTED1(ViewMsg_SetAccessibilityMode,
1270                    AccessibilityMode)
1271
1272// An acknowledge to ViewHostMsg_MultipleTargetsTouched to notify the renderer
1273// process to release the magnified image.
1274IPC_MESSAGE_ROUTED1(ViewMsg_ReleaseDisambiguationPopupDIB,
1275                    TransportDIB::Handle /* DIB handle */)
1276
1277// Notifies the renderer that a snapshot has been retrieved.
1278IPC_MESSAGE_ROUTED3(ViewMsg_WindowSnapshotCompleted,
1279                    int /* snapshot_id */,
1280                    gfx::Size /* size */,
1281                    std::vector<unsigned char> /* png */)
1282
1283// Tells the renderer to suspend/resume the webkit timers.
1284IPC_MESSAGE_CONTROL1(ViewMsg_SetWebKitSharedTimersSuspended,
1285                     bool /* suspend */)
1286
1287#if defined(OS_ANDROID)
1288// Sent when the browser wants the bounding boxes of the current find matches.
1289//
1290// If match rects are already cached on the browser side, |current_version|
1291// should be the version number from the ViewHostMsg_FindMatchRects_Reply
1292// they came in, so the renderer can tell if it needs to send updated rects.
1293// Otherwise just pass -1 to always receive the list of rects.
1294//
1295// There must be an active search string (it is probably most useful to call
1296// this immediately after a ViewHostMsg_Find_Reply message arrives with
1297// final_update set to true).
1298IPC_MESSAGE_ROUTED1(ViewMsg_FindMatchRects,
1299                    int /* current_version */)
1300
1301// External popup menus.
1302IPC_MESSAGE_ROUTED2(ViewMsg_SelectPopupMenuItems,
1303                    bool /* user canceled the popup */,
1304                    std::vector<int> /* selected indices */)
1305
1306// Tells the renderer to try to revert to the zoom level we were at before
1307// ViewMsg_ScrollFocusedEditableNodeIntoView was called.
1308IPC_MESSAGE_ROUTED0(ViewMsg_UndoScrollFocusedEditableNodeIntoView)
1309
1310// This message relays the beginning or end of a batch event in the IME.
1311IPC_MESSAGE_ROUTED1(ViewMsg_ImeBatchStateChanged,
1312    bool /* is_begin */)
1313
1314// Notifies the renderer whether hiding/showing the top controls is enabled
1315// and whether or not to animate to the proper state.
1316IPC_MESSAGE_ROUTED3(ViewMsg_UpdateTopControlsState,
1317                    bool /* enable_hiding */,
1318                    bool /* enable_showing */,
1319                    bool /* animate */)
1320
1321IPC_MESSAGE_ROUTED0(ViewMsg_ShowImeIfNeeded)
1322
1323// Sent by the browser when the renderer should generate a new frame.
1324IPC_MESSAGE_ROUTED1(ViewMsg_BeginFrame,
1325                    cc::BeginFrameArgs /* args */)
1326
1327#elif defined(OS_MACOSX)
1328// Let the RenderView know its window has changed visibility.
1329IPC_MESSAGE_ROUTED1(ViewMsg_SetWindowVisibility,
1330                    bool /* visibile */)
1331
1332// Let the RenderView know its window's frame has changed.
1333IPC_MESSAGE_ROUTED2(ViewMsg_WindowFrameChanged,
1334                    gfx::Rect /* window frame */,
1335                    gfx::Rect /* content view frame */)
1336
1337// Message sent from the browser to the renderer when the user starts or stops
1338// resizing the view.
1339IPC_MESSAGE_ROUTED1(ViewMsg_SetInLiveResize,
1340                    bool /* enable */)
1341
1342// Tell the renderer that plugin IME has completed.
1343IPC_MESSAGE_ROUTED2(ViewMsg_PluginImeCompositionCompleted,
1344                    string16 /* text */,
1345                    int /* plugin_id */)
1346
1347// External popup menus.
1348IPC_MESSAGE_ROUTED1(ViewMsg_SelectPopupMenuItem,
1349                    int /* selected index, -1 means no selection */)
1350#endif
1351
1352// Sent by the browser as a reply to ViewHostMsg_SwapCompositorFrame.
1353IPC_MESSAGE_ROUTED2(ViewMsg_SwapCompositorFrameAck,
1354                    uint32 /* output_surface_id */,
1355                    cc::CompositorFrameAck /* ack */)
1356
1357// Sent by the browser to ask the renderer for a snapshot of the current view.
1358IPC_MESSAGE_ROUTED1(ViewMsg_Snapshot,
1359                    gfx::Rect /* src_subrect */)
1360
1361// -----------------------------------------------------------------------------
1362// Messages sent from the renderer to the browser.
1363
1364// Sent by the renderer when it is creating a new window.  The browser creates
1365// a tab for it and responds with a ViewMsg_CreatingNew_ACK.  If route_id is
1366// MSG_ROUTING_NONE, the view couldn't be created.
1367IPC_SYNC_MESSAGE_CONTROL1_4(ViewHostMsg_CreateWindow,
1368                            ViewHostMsg_CreateWindow_Params,
1369                            int /* route_id */,
1370                            int /* main_frame_route_id */,
1371                            int32 /* surface_id */,
1372                            int64 /* cloned_session_storage_namespace_id */)
1373
1374// Similar to ViewHostMsg_CreateWindow, except used for sub-widgets, like
1375// <select> dropdowns.  This message is sent to the WebContentsImpl that
1376// contains the widget being created.
1377IPC_SYNC_MESSAGE_CONTROL2_2(ViewHostMsg_CreateWidget,
1378                            int /* opener_id */,
1379                            WebKit::WebPopupType /* popup type */,
1380                            int /* route_id */,
1381                            int32 /* surface_id */)
1382
1383// Similar to ViewHostMsg_CreateWidget except the widget is a full screen
1384// window.
1385IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_CreateFullscreenWidget,
1386                            int /* opener_id */,
1387                            int /* route_id */,
1388                            int32 /* surface_id */)
1389
1390// Asks the browser for a unique routing ID.
1391IPC_SYNC_MESSAGE_CONTROL0_1(ViewHostMsg_GenerateRoutingID,
1392                            int /* routing_id */)
1393
1394// Asks the browser for the default audio hardware configuration.
1395IPC_SYNC_MESSAGE_CONTROL0_2(ViewHostMsg_GetAudioHardwareConfig,
1396                            media::AudioParameters /* input parameters */,
1397                            media::AudioParameters /* output parameters */)
1398
1399// Asks the browser for CPU usage of the renderer process in percents.
1400IPC_SYNC_MESSAGE_CONTROL0_1(ViewHostMsg_GetCPUUsage,
1401                            int /* CPU usage in percents */)
1402
1403// Asks the browser for the user's monitor profile.
1404IPC_SYNC_MESSAGE_CONTROL0_1(ViewHostMsg_GetMonitorColorProfile,
1405                            std::vector<char> /* profile */)
1406
1407// Asks the browser for the renderer process memory size stats.
1408IPC_SYNC_MESSAGE_CONTROL0_2(ViewHostMsg_GetProcessMemorySizes,
1409                            size_t /* private_bytes */,
1410                            size_t /* shared_bytes */)
1411
1412// These three messages are sent to the parent RenderViewHost to display the
1413// page/widget that was created by
1414// CreateWindow/CreateWidget/CreateFullscreenWidget. routing_id
1415// refers to the id that was returned from the Create message above.
1416// The initial_position parameter is a rectangle in screen coordinates.
1417//
1418// FUTURE: there will probably be flags here to control if the result is
1419// in a new window.
1420IPC_MESSAGE_ROUTED4(ViewHostMsg_ShowView,
1421                    int /* route_id */,
1422                    WindowOpenDisposition /* disposition */,
1423                    gfx::Rect /* initial_pos */,
1424                    bool /* opened_by_user_gesture */)
1425
1426IPC_MESSAGE_ROUTED2(ViewHostMsg_ShowWidget,
1427                    int /* route_id */,
1428                    gfx::Rect /* initial_pos */)
1429
1430// Message to show a full screen widget.
1431IPC_MESSAGE_ROUTED1(ViewHostMsg_ShowFullscreenWidget,
1432                    int /* route_id */)
1433
1434// This message is sent after ViewHostMsg_ShowView to cause the RenderView
1435// to run in a modal fashion until it is closed.
1436IPC_SYNC_MESSAGE_ROUTED1_0(ViewHostMsg_RunModal,
1437                           int /* opener_id */)
1438
1439// Indicates the renderer is ready in response to a ViewMsg_New or
1440// a ViewMsg_CreatingNew_ACK.
1441IPC_MESSAGE_ROUTED0(ViewHostMsg_RenderViewReady)
1442
1443// Indicates the renderer process is gone.  This actually is sent by the
1444// browser process to itself, but keeps the interface cleaner.
1445IPC_MESSAGE_ROUTED2(ViewHostMsg_RenderProcessGone,
1446                    int, /* this really is base::TerminationStatus */
1447                    int /* exit_code */)
1448
1449// Sent by the renderer process to request that the browser close the view.
1450// This corresponds to the window.close() API, and the browser may ignore
1451// this message.  Otherwise, the browser will generates a ViewMsg_Close
1452// message to close the view.
1453IPC_MESSAGE_ROUTED0(ViewHostMsg_Close)
1454
1455// Send in response to a ViewMsg_UpdateScreenRects so that the renderer can
1456// throttle these messages.
1457IPC_MESSAGE_ROUTED0(ViewHostMsg_UpdateScreenRects_ACK)
1458
1459// Sent by the renderer process to request that the browser move the view.
1460// This corresponds to the window.resizeTo() and window.moveTo() APIs, and
1461// the browser may ignore this message.
1462IPC_MESSAGE_ROUTED1(ViewHostMsg_RequestMove,
1463                    gfx::Rect /* position */)
1464
1465// Sent by the renderer process to notify the browser that the web page has
1466// programmatically scrolled.
1467IPC_MESSAGE_ROUTED1(ViewHostMsg_DidProgrammaticallyScroll,
1468                    gfx::Vector2d /* scroll_point */)
1469
1470// Notifies the browser that a frame in the view has changed. This message
1471// has a lot of parameters and is packed/unpacked by functions defined in
1472// render_messages.h.
1473IPC_MESSAGE_ROUTED1(ViewHostMsg_FrameNavigate,
1474                    ViewHostMsg_FrameNavigate_Params)
1475
1476// Used to tell the parent that the user right clicked on an area of the
1477// content area, and a context menu should be shown for it. The params
1478// object contains information about the node(s) that were selected when the
1479// user right clicked.
1480IPC_MESSAGE_ROUTED1(ViewHostMsg_ContextMenu, content::ContextMenuParams)
1481
1482// Message to show a popup menu using native cocoa controls (Mac only).
1483IPC_MESSAGE_ROUTED1(ViewHostMsg_ShowPopup,
1484                    ViewHostMsg_ShowPopup_Params)
1485
1486// Response from ViewMsg_ScriptEvalRequest. The ID is the parameter supplied
1487// to ViewMsg_ScriptEvalRequest. The result has the value returned by the
1488// script as its only element, one of Null, Boolean, Integer, Real, Date, or
1489// String.
1490IPC_MESSAGE_ROUTED2(ViewHostMsg_ScriptEvalResponse,
1491                    int  /* id */,
1492                    base::ListValue  /* result */)
1493
1494// Result of string search in the page.
1495// Response to ViewMsg_Find with the results of the requested find-in-page
1496// search, the number of matches found and the selection rect (in screen
1497// coordinates) for the string found. If |final_update| is false, it signals
1498// that this is not the last Find_Reply message - more will be sent as the
1499// scoping effort continues.
1500IPC_MESSAGE_ROUTED5(ViewHostMsg_Find_Reply,
1501                    int /* request_id */,
1502                    int /* number of matches */,
1503                    gfx::Rect /* selection_rect */,
1504                    int /* active_match_ordinal */,
1505                    bool /* final_update */)
1506
1507// Provides the result from running OnMsgShouldClose.  |proceed| matches the
1508// return value of the the frame's shouldClose method (which includes the
1509// onbeforeunload handler): true if the user decided to proceed with leaving
1510// the page.
1511IPC_MESSAGE_ROUTED3(ViewHostMsg_ShouldClose_ACK,
1512                    bool /* proceed */,
1513                    base::TimeTicks /* before_unload_start_time */,
1514                    base::TimeTicks /* before_unload_end_time */)
1515
1516// Indicates that the current renderer has swapped out, after a SwapOut
1517// message.
1518IPC_MESSAGE_ROUTED0(ViewHostMsg_SwapOut_ACK)
1519
1520// Indicates that the current page has been closed, after a ClosePage
1521// message.
1522IPC_MESSAGE_ROUTED0(ViewHostMsg_ClosePage_ACK)
1523
1524// Notifies the browser that media has started/stopped playing.
1525IPC_MESSAGE_ROUTED4(ViewHostMsg_MediaNotification,
1526                    int64 /* player_cookie, distinguishes instances */,
1527                    bool /* has_video */,
1528                    bool /* has_audio */,
1529                    bool /* is_playing */)
1530
1531// Notifies the browser that we have session history information.
1532// page_id: unique ID that allows us to distinguish between history entries.
1533IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateState,
1534                    int32 /* page_id */,
1535                    content::PageState /* state */)
1536
1537// Notifies the browser that a document has been loaded in a frame.
1538IPC_MESSAGE_ROUTED1(ViewHostMsg_DocumentLoadedInFrame,
1539                    int64 /* frame_id */)
1540
1541// Notifies the browser that a frame finished loading.
1542IPC_MESSAGE_ROUTED3(ViewHostMsg_DidFinishLoad,
1543                    int64 /* frame_id */,
1544                    GURL /* validated_url */,
1545                    bool /* is_main_frame */)
1546
1547// Changes the title for the page in the UI when the page is navigated or the
1548// title changes.
1549IPC_MESSAGE_ROUTED3(ViewHostMsg_UpdateTitle,
1550                    int32 /* page_id */,
1551                    string16 /* title */,
1552                    WebKit::WebTextDirection /* title direction */)
1553
1554// Change the encoding name of the page in UI when the page has detected
1555// proper encoding name.
1556IPC_MESSAGE_ROUTED1(ViewHostMsg_UpdateEncoding,
1557                    std::string /* new encoding name */)
1558
1559// Notifies the browser that we want to show a destination url for a potential
1560// action (e.g. when the user is hovering over a link).
1561IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateTargetURL,
1562                    int32,
1563                    GURL)
1564
1565// Sent when the renderer starts loading the page. This corresponds to
1566// WebKit's notion of the throbber starting. Note that sometimes you may get
1567// duplicates of these during a single load.
1568IPC_MESSAGE_ROUTED0(ViewHostMsg_DidStartLoading)
1569
1570// Sent when the renderer is done loading a page. This corresponds to WebKit's
1571// notion of the throbber stopping.
1572IPC_MESSAGE_ROUTED0(ViewHostMsg_DidStopLoading)
1573
1574// Sent when the renderer main frame has made progress loading.
1575IPC_MESSAGE_ROUTED1(ViewHostMsg_DidChangeLoadProgress,
1576                    double /* load_progress */)
1577
1578// Sent when the renderer main frame sets its opener to null, disowning it for
1579// the lifetime of the window.
1580IPC_MESSAGE_ROUTED0(ViewHostMsg_DidDisownOpener)
1581
1582// Sent when the document element is available for the top-level frame.  This
1583// happens after the page starts loading, but before all resources are
1584// finished.
1585IPC_MESSAGE_ROUTED0(ViewHostMsg_DocumentAvailableInMainFrame)
1586
1587// Sent when after the onload handler has been invoked for the document
1588// in the top-level frame.
1589IPC_MESSAGE_ROUTED1(ViewHostMsg_DocumentOnLoadCompletedInMainFrame,
1590                    int32 /* page_id */)
1591
1592// Sent when the renderer loads a resource from its memory cache.
1593// The security info is non empty if the resource was originally loaded over
1594// a secure connection.
1595// Note: May only be sent once per URL per frame per committed load.
1596IPC_MESSAGE_ROUTED5(ViewHostMsg_DidLoadResourceFromMemoryCache,
1597                    GURL /* url */,
1598                    std::string  /* security info */,
1599                    std::string  /* http method */,
1600                    std::string  /* mime type */,
1601                    ResourceType::Type /* resource type */)
1602
1603// Sent when the renderer displays insecure content in a secure page.
1604IPC_MESSAGE_ROUTED0(ViewHostMsg_DidDisplayInsecureContent)
1605
1606// Sent when the renderer runs insecure content in a secure origin.
1607IPC_MESSAGE_ROUTED2(ViewHostMsg_DidRunInsecureContent,
1608                    std::string  /* security_origin */,
1609                    GURL         /* target URL */)
1610
1611// Sent when the renderer starts a provisional load for a frame.
1612IPC_MESSAGE_ROUTED4(ViewHostMsg_DidStartProvisionalLoadForFrame,
1613                    int64 /* frame_id */,
1614                    int64 /* parent_frame_id */,
1615                    bool /* true if it is the main frame */,
1616                    GURL /* url */)
1617
1618IPC_MESSAGE_ROUTED5(ViewHostMsg_DidFailLoadWithError,
1619                    int64 /* frame_id */,
1620                    GURL /* validated_url */,
1621                    bool /* is_main_frame */,
1622                    int /* error_code */,
1623                    string16 /* error_description */)
1624
1625// Sent when the renderer fails a provisional load with an error.
1626IPC_MESSAGE_ROUTED1(ViewHostMsg_DidFailProvisionalLoadWithError,
1627                    ViewHostMsg_DidFailProvisionalLoadWithError_Params)
1628
1629// Tells the render view that a ViewHostMsg_PaintAtSize message was
1630// processed, and the DIB is ready for use. |tag| has the same value that
1631// the tag sent along with ViewMsg_PaintAtSize.
1632IPC_MESSAGE_ROUTED2(ViewHostMsg_PaintAtSize_ACK,
1633                    int /* tag */,
1634                    gfx::Size /* size */)
1635
1636// Sent to update part of the view.  In response to this message, the host
1637// generates a ViewMsg_UpdateRect_ACK message.
1638IPC_MESSAGE_ROUTED1(ViewHostMsg_UpdateRect,
1639                    ViewHostMsg_UpdateRect_Params)
1640
1641// Sent to unblock the browser's UI thread if it is waiting on an UpdateRect,
1642// which may get delayed until the browser's UI unblocks.
1643IPC_MESSAGE_ROUTED0(ViewHostMsg_UpdateIsDelayed)
1644
1645// Sent by the renderer when accelerated compositing is enabled or disabled to
1646// notify the browser whether or not is should do painting.
1647IPC_MESSAGE_ROUTED1(ViewHostMsg_DidActivateAcceleratedCompositing,
1648                    bool /* true if the accelerated compositor is actve */)
1649
1650IPC_STRUCT_BEGIN(ViewHostMsg_BeginSmoothScroll_Params)
1651  IPC_STRUCT_MEMBER(bool, scroll_down)
1652  IPC_STRUCT_MEMBER(int, pixels_to_scroll)
1653  IPC_STRUCT_MEMBER(int, mouse_event_x)
1654  IPC_STRUCT_MEMBER(int, mouse_event_y)
1655IPC_STRUCT_END()
1656
1657IPC_MESSAGE_ROUTED1(ViewHostMsg_BeginSmoothScroll,
1658                    ViewHostMsg_BeginSmoothScroll_Params /* params */)
1659
1660IPC_MESSAGE_ROUTED0(ViewHostMsg_Focus)
1661IPC_MESSAGE_ROUTED0(ViewHostMsg_Blur)
1662
1663// Message sent from renderer to the browser when focus changes inside the
1664// webpage. The parameter says whether the newly focused element needs
1665// keyboard input (true for textfields, text areas and content editable divs).
1666IPC_MESSAGE_ROUTED1(ViewHostMsg_FocusedNodeChanged,
1667    bool /* is_editable_node */)
1668
1669IPC_MESSAGE_ROUTED1(ViewHostMsg_SetCursor,
1670                    WebCursor)
1671
1672// Used to set a cookie. The cookie is set asynchronously, but will be
1673// available to a subsequent ViewHostMsg_GetCookies request.
1674IPC_MESSAGE_ROUTED3(ViewHostMsg_SetCookie,
1675                    GURL /* url */,
1676                    GURL /* first_party_for_cookies */,
1677                    std::string /* cookie */)
1678
1679// Used to get cookies for the given URL. This may block waiting for a
1680// previous SetCookie message to be processed.
1681IPC_SYNC_MESSAGE_ROUTED2_1(ViewHostMsg_GetCookies,
1682                           GURL /* url */,
1683                           GURL /* first_party_for_cookies */,
1684                           std::string /* cookies */)
1685
1686// Used to get raw cookie information for the given URL. This may block
1687// waiting for a previous SetCookie message to be processed.
1688IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_GetRawCookies,
1689                            GURL /* url */,
1690                            GURL /* first_party_for_cookies */,
1691                            std::vector<content::CookieData>
1692                                /* raw_cookies */)
1693
1694// Used to delete cookie for the given URL and name
1695IPC_SYNC_MESSAGE_CONTROL2_0(ViewHostMsg_DeleteCookie,
1696                            GURL /* url */,
1697                            std::string /* cookie_name */)
1698
1699// Used to check if cookies are enabled for the given URL. This may block
1700// waiting for a previous SetCookie message to be processed.
1701IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_CookiesEnabled,
1702                            GURL /* url */,
1703                            GURL /* first_party_for_cookies */,
1704                            bool /* cookies_enabled */)
1705
1706// Used to get the list of plugins
1707IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_GetPlugins,
1708    bool /* refresh*/,
1709    std::vector<content::WebPluginInfo> /* plugins */)
1710
1711// Return information about a plugin for the given URL and MIME
1712// type. If there is no matching plugin, |found| is false.
1713// |actual_mime_type| is the actual mime type supported by the
1714// found plugin.
1715IPC_SYNC_MESSAGE_CONTROL4_3(ViewHostMsg_GetPluginInfo,
1716                            int /* routing_id */,
1717                            GURL /* url */,
1718                            GURL /* page_url */,
1719                            std::string /* mime_type */,
1720                            bool /* found */,
1721                            content::WebPluginInfo /* plugin info */,
1722                            std::string /* actual_mime_type */)
1723
1724// A renderer sends this to the browser process when it wants to
1725// create a plugin.  The browser will create the plugin process if
1726// necessary, and will return a handle to the channel on success.
1727// On error an empty string is returned.
1728IPC_SYNC_MESSAGE_CONTROL4_2(ViewHostMsg_OpenChannelToPlugin,
1729                            int /* routing_id */,
1730                            GURL /* url */,
1731                            GURL /* page_url */,
1732                            std::string /* mime_type */,
1733                            IPC::ChannelHandle /* channel_handle */,
1734                            content::WebPluginInfo /* info */)
1735
1736#if defined(OS_WIN)
1737IPC_MESSAGE_ROUTED1(ViewHostMsg_WindowlessPluginDummyWindowCreated,
1738                    gfx::NativeViewId /* dummy_activation_window */)
1739
1740IPC_MESSAGE_ROUTED1(ViewHostMsg_WindowlessPluginDummyWindowDestroyed,
1741                    gfx::NativeViewId /* dummy_activation_window */)
1742#endif
1743
1744// Get the list of proxies to use for |url|, as a semicolon delimited list
1745// of "<TYPE> <HOST>:<PORT>" | "DIRECT".
1746IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_ResolveProxy,
1747                            GURL /* url */,
1748                            bool /* result */,
1749                            std::string /* proxy list */)
1750
1751// A renderer sends this to the browser process when it wants to create a
1752// worker.  The browser will create the worker process if necessary, and
1753// will return the route id on success.  On error returns MSG_ROUTING_NONE.
1754IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_CreateWorker,
1755                            ViewHostMsg_CreateWorker_Params,
1756                            int /* route_id */)
1757
1758// This message is sent to the browser to see if an instance of this shared
1759// worker already exists. If so, it returns exists == true. If a
1760// non-empty name is passed, also validates that the url matches the url of
1761// the existing worker. If a matching worker is found, the passed-in
1762// document_id is associated with that worker, to ensure that the worker
1763// stays alive until the document is detached.
1764// The route_id returned can be used to forward messages to the worker via
1765// ForwardToWorker if it exists, otherwise it should be passed in to any
1766// future call to CreateWorker to avoid creating duplicate workers.
1767IPC_SYNC_MESSAGE_CONTROL1_3(ViewHostMsg_LookupSharedWorker,
1768                            ViewHostMsg_CreateWorker_Params,
1769                            bool /* exists */,
1770                            int /* route_id */,
1771                            bool /* url_mismatch */)
1772
1773// A renderer sends this to the browser process when a document has been
1774// detached. The browser will use this to constrain the lifecycle of worker
1775// processes (SharedWorkers are shut down when their last associated document
1776// is detached).
1777IPC_MESSAGE_CONTROL1(ViewHostMsg_DocumentDetached,
1778                     uint64 /* document_id */)
1779
1780// Wraps an IPC message that's destined to the worker on the renderer->browser
1781// hop.
1782IPC_MESSAGE_CONTROL1(ViewHostMsg_ForwardToWorker,
1783                     IPC::Message /* message */)
1784
1785// Tells the browser that a specific Appcache manifest in the current page
1786// was accessed.
1787IPC_MESSAGE_ROUTED2(ViewHostMsg_AppCacheAccessed,
1788                    GURL /* manifest url */,
1789                    bool /* blocked by policy */)
1790
1791// Initiates a download based on user actions like 'ALT+click'.
1792IPC_MESSAGE_ROUTED3(ViewHostMsg_DownloadUrl,
1793                    GURL     /* url */,
1794                    content::Referrer /* referrer */,
1795                    string16 /* suggested_name */)
1796
1797// Used to go to the session history entry at the given offset (ie, -1 will
1798// return the "back" item).
1799IPC_MESSAGE_ROUTED1(ViewHostMsg_GoToEntryAtOffset,
1800                    int /* offset (from current) of history item to get */)
1801
1802// Sent from an inactive renderer for the browser to route to the active
1803// renderer, instructing it to close.
1804IPC_MESSAGE_ROUTED0(ViewHostMsg_RouteCloseEvent)
1805
1806// Sent to the browser from an inactive renderer to post a message to the
1807// active renderer.
1808IPC_MESSAGE_ROUTED1(ViewHostMsg_RouteMessageEvent,
1809                    ViewMsg_PostMessage_Params)
1810
1811IPC_SYNC_MESSAGE_ROUTED4_2(ViewHostMsg_RunJavaScriptMessage,
1812                           string16     /* in - alert message */,
1813                           string16     /* in - default prompt */,
1814                           GURL         /* in - originating page URL */,
1815                           content::JavaScriptMessageType /* in - type */,
1816                           bool         /* out - success */,
1817                           string16     /* out - user_input field */)
1818
1819// Requests that the given URL be opened in the specified manner.
1820IPC_MESSAGE_ROUTED1(ViewHostMsg_OpenURL, ViewHostMsg_OpenURL_Params)
1821
1822// Notifies that the preferred size of the content changed.
1823IPC_MESSAGE_ROUTED1(ViewHostMsg_DidContentsPreferredSizeChange,
1824                    gfx::Size /* pref_size */)
1825
1826// Notifies that the scroll offset changed.
1827// This is different from ViewHostMsg_UpdateRect in that ViewHostMsg_UpdateRect
1828// is not sent at all when threaded compositing is enabled while
1829// ViewHostMsg_DidChangeScrollOffset works properly in this case.
1830IPC_MESSAGE_ROUTED0(ViewHostMsg_DidChangeScrollOffset)
1831
1832// Notifies that the pinned-to-side state of the content changed.
1833IPC_MESSAGE_ROUTED2(ViewHostMsg_DidChangeScrollOffsetPinningForMainFrame,
1834                    bool /* pinned_to_left */,
1835                    bool /* pinned_to_right */)
1836
1837// Notifies that the scrollbars-visible state of the content changed.
1838IPC_MESSAGE_ROUTED2(ViewHostMsg_DidChangeScrollbarsForMainFrame,
1839                    bool /* has_horizontal_scrollbar */,
1840                    bool /* has_vertical_scrollbar */)
1841
1842// Notifies that the number of JavaScript scroll handlers changed.
1843IPC_MESSAGE_ROUTED1(ViewHostMsg_DidChangeNumWheelEvents,
1844                    int /* count */)
1845
1846// Notifies whether there are JavaScript touch event handlers or not.
1847IPC_MESSAGE_ROUTED1(ViewHostMsg_HasTouchEventHandlers,
1848                    bool /* has_handlers */)
1849
1850// A message from HTML-based UI.  When (trusted) Javascript calls
1851// send(message, args), this message is sent to the browser.
1852IPC_MESSAGE_ROUTED3(ViewHostMsg_WebUISend,
1853                    GURL /* source_url */,
1854                    std::string  /* message */,
1855                    base::ListValue /* args */)
1856
1857// Requests a snapshot of the given window.
1858IPC_MESSAGE_ROUTED1(ViewHostMsg_GetWindowSnapshot,
1859                    int /* snapshot_id */)
1860
1861// A renderer sends this to the browser process when it wants to create a ppapi
1862// plugin.  The browser will create the plugin process if necessary, and will
1863// return a handle to the channel on success.
1864//
1865// The plugin_child_id is the ChildProcessHost ID assigned in the browser
1866// process. This ID is valid only in the context of the browser process and is
1867// used to identify the proper process when the renderer notifies it that the
1868// plugin is hung.
1869//
1870// On error an empty string and null handles are returned.
1871IPC_SYNC_MESSAGE_CONTROL1_3(ViewHostMsg_OpenChannelToPepperPlugin,
1872                            base::FilePath /* path */,
1873                            IPC::ChannelHandle /* handle to channel */,
1874                            base::ProcessId /* plugin_pid */,
1875                            int /* plugin_child_id */)
1876
1877// Notification that a plugin has created a new plugin instance. The parameters
1878// indicate:
1879// -The plugin process ID that we're creating the instance for.
1880// -The instance ID of the instance being created.
1881// -A PepperRendererInstanceData struct which contains properties from the
1882// renderer which are associated with the plugin instance. This includes the
1883// routing ID of the associated render view and the URL of plugin.
1884// -Whether the plugin we're creating an instance for is external or internal.
1885//
1886// This message must be sync even though it returns no parameters to avoid
1887// a race condition with the plugin process. The plugin process sends messages
1888// to the browser that assume the browser knows about the instance. We need to
1889// make sure that the browser actually knows about the instance before we tell
1890// the plugin to run.
1891IPC_SYNC_MESSAGE_CONTROL4_0(
1892    ViewHostMsg_DidCreateOutOfProcessPepperInstance,
1893    int /* plugin_child_id */,
1894    int32 /* pp_instance */,
1895    content::PepperRendererInstanceData /* creation_data */,
1896    bool /* is_external */)
1897
1898// Notification that a plugin has destroyed an instance. This is the opposite of
1899// the "DidCreate" message above.
1900IPC_MESSAGE_CONTROL3(ViewHostMsg_DidDeleteOutOfProcessPepperInstance,
1901                     int /* plugin_child_id */,
1902                     int32 /* pp_instance */,
1903                     bool /* is_external */)
1904
1905// A renderer sends this to the browser process when it wants to
1906// create a ppapi broker.  The browser will create the broker process
1907// if necessary, and will return a handle to the channel on success.
1908// On error an empty string is returned.
1909// The browser will respond with ViewMsg_PpapiBrokerChannelCreated.
1910IPC_MESSAGE_CONTROL3(ViewHostMsg_OpenChannelToPpapiBroker,
1911                     int /* routing_id */,
1912                     int /* request_id */,
1913                     base::FilePath /* path */)
1914
1915// A renderer sends this to the browser process when it wants to access a PPAPI
1916// broker. In contrast to ViewHostMsg_OpenChannelToPpapiBroker, this is called
1917// for every connection.
1918// The browser will respond with ViewMsg_PpapiBrokerPermissionResult.
1919IPC_MESSAGE_ROUTED3(ViewHostMsg_RequestPpapiBrokerPermission,
1920                    int /* request_id */,
1921                    GURL /* document_url */,
1922                    base::FilePath /* plugin_path */)
1923
1924#if defined(USE_X11)
1925// A renderer sends this when it needs a browser-side widget for
1926// hosting a windowed plugin. id is the XID of the plugin window, for which
1927// the container is created.
1928IPC_SYNC_MESSAGE_ROUTED1_0(ViewHostMsg_CreatePluginContainer,
1929                           gfx::PluginWindowHandle /* id */)
1930
1931// Destroy a plugin container previously created using CreatePluginContainer.
1932// id is the XID of the plugin window corresponding to the container that is
1933// to be destroyed.
1934IPC_SYNC_MESSAGE_ROUTED1_0(ViewHostMsg_DestroyPluginContainer,
1935                           gfx::PluginWindowHandle /* id */)
1936#endif
1937
1938// Send the tooltip text for the current mouse position to the browser.
1939IPC_MESSAGE_ROUTED2(ViewHostMsg_SetTooltipText,
1940                    string16 /* tooltip text string */,
1941                    WebKit::WebTextDirection /* text direction hint */)
1942
1943IPC_MESSAGE_ROUTED0(ViewHostMsg_SelectRange_ACK)
1944IPC_MESSAGE_ROUTED0(ViewHostMsg_MoveCaret_ACK)
1945
1946// Notification that the text selection has changed.
1947// Note: The secound parameter is the character based offset of the string16
1948// text in the document.
1949IPC_MESSAGE_ROUTED3(ViewHostMsg_SelectionChanged,
1950                    string16 /* text covers the selection range */,
1951                    size_t /* the offset of the text in the document */,
1952                    ui::Range /* selection range in the document */)
1953
1954// Notification that the selection bounds have changed.
1955IPC_MESSAGE_ROUTED1(ViewHostMsg_SelectionBoundsChanged,
1956                    ViewHostMsg_SelectionBounds_Params)
1957
1958// Asks the browser to open the color chooser.
1959IPC_MESSAGE_ROUTED2(ViewHostMsg_OpenColorChooser,
1960                    int /* id */,
1961                    SkColor /* color */)
1962
1963// Asks the browser to end the color chooser.
1964IPC_MESSAGE_ROUTED1(ViewHostMsg_EndColorChooser, int /* id */)
1965
1966// Change the selected color in the color chooser.
1967IPC_MESSAGE_ROUTED2(ViewHostMsg_SetSelectedColorInColorChooser,
1968                    int /* id */,
1969                    SkColor /* color */)
1970
1971// Asks the browser to display the file chooser.  The result is returned in a
1972// ViewHost_RunFileChooserResponse message.
1973IPC_MESSAGE_ROUTED1(ViewHostMsg_RunFileChooser,
1974                    content::FileChooserParams)
1975
1976// Asks the browser to enumerate a directory.  This is equivalent to running
1977// the file chooser in directory-enumeration mode and having the user select
1978// the given directory.  The result is returned in a
1979// ViewMsg_EnumerateDirectoryResponse message.
1980IPC_MESSAGE_ROUTED2(ViewHostMsg_EnumerateDirectory,
1981                    int /* request_id */,
1982                    base::FilePath /* file_path */)
1983
1984// Tells the browser to move the focus to the next (previous if reverse is
1985// true) focusable element.
1986IPC_MESSAGE_ROUTED1(ViewHostMsg_TakeFocus,
1987                    bool /* reverse */)
1988
1989// Required for opening a date/time dialog
1990IPC_MESSAGE_ROUTED1(ViewHostMsg_OpenDateTimeDialog,
1991                    ViewHostMsg_DateTimeDialogValue_Params /* value */)
1992
1993IPC_MESSAGE_ROUTED3(ViewHostMsg_TextInputTypeChanged,
1994                    ui::TextInputType /* TextInputType of the focused node */,
1995                    bool /* can_compose_inline in the focused node */,
1996                    ui::TextInputMode /* TextInputMode of the focused node */)
1997
1998// Required for updating text input state.
1999IPC_MESSAGE_ROUTED1(ViewHostMsg_TextInputStateChanged,
2000                    ViewHostMsg_TextInputState_Params /* input state params */)
2001
2002// Required for cancelling an ongoing input method composition.
2003IPC_MESSAGE_ROUTED0(ViewHostMsg_ImeCancelComposition)
2004
2005// WebKit and JavaScript error messages to log to the console
2006// or debugger UI.
2007IPC_MESSAGE_ROUTED4(ViewHostMsg_AddMessageToConsole,
2008                    int32, /* log level */
2009                    string16, /* msg */
2010                    int32, /* line number */
2011                    string16 /* source id */)
2012
2013// Sent by the renderer process to indicate that a plugin instance has crashed.
2014// Note: |plugin_pid| should not be trusted. The corresponding process has
2015// probably died. Moreover, the ID may have been reused by a new process. Any
2016// usage other than displaying it in a prompt to the user is very likely to be
2017// wrong.
2018IPC_MESSAGE_ROUTED2(ViewHostMsg_CrashedPlugin,
2019                    base::FilePath /* plugin_path */,
2020                    base::ProcessId /* plugin_pid */)
2021
2022// Displays a box to confirm that the user wants to navigate away from the
2023// page. Replies true if yes, false otherwise, the reply string is ignored,
2024// but is included so that we can use OnJavaScriptMessageBoxClosed.
2025IPC_SYNC_MESSAGE_ROUTED3_2(ViewHostMsg_RunBeforeUnloadConfirm,
2026                           GURL,     /* in - originating frame URL */
2027                           string16  /* in - alert message */,
2028                           bool      /* in - is a reload */,
2029                           bool      /* out - success */,
2030                           string16  /* out - This is ignored.*/)
2031
2032// Sent when a provisional load on the main frame redirects.
2033IPC_MESSAGE_ROUTED3(ViewHostMsg_DidRedirectProvisionalLoad,
2034                    int /* page_id */,
2035                    GURL /* last url */,
2036                    GURL /* url redirected to */)
2037
2038// Sent when the renderer changes the zoom level for a particular url, so the
2039// browser can update its records.  If remember is true, then url is used to
2040// update the zoom level for all pages in that site.  Otherwise, the render
2041// view's id is used so that only the menu is updated.
2042IPC_MESSAGE_ROUTED3(ViewHostMsg_DidZoomURL,
2043                    double /* zoom_level */,
2044                    bool /* remember */,
2045                    GURL /* url */)
2046
2047// Updates the minimum/maximum allowed zoom percent for this tab from the
2048// default values.  If |remember| is true, then the zoom setting is applied to
2049// other pages in the site and is saved, otherwise it only applies to this
2050// tab.
2051IPC_MESSAGE_ROUTED3(ViewHostMsg_UpdateZoomLimits,
2052                    int /* minimum_percent */,
2053                    int /* maximum_percent */,
2054                    bool /* remember */)
2055
2056// Notify the browser that this render process can or can't be suddenly
2057// terminated.
2058IPC_MESSAGE_CONTROL1(ViewHostMsg_SuddenTerminationChanged,
2059                     bool /* enabled */)
2060
2061// Informs the browser of updated frame names.
2062IPC_MESSAGE_ROUTED3(ViewHostMsg_UpdateFrameName,
2063                    int /* frame_id */,
2064                    bool /* is_top_level */,
2065                    std::string /* name */)
2066
2067
2068IPC_STRUCT_BEGIN(ViewHostMsg_CompositorSurfaceBuffersSwapped_Params)
2069  IPC_STRUCT_MEMBER(int32, surface_id)
2070  IPC_STRUCT_MEMBER(uint64, surface_handle)
2071  IPC_STRUCT_MEMBER(int32, route_id)
2072  IPC_STRUCT_MEMBER(gfx::Size, size)
2073  IPC_STRUCT_MEMBER(float, scale_factor)
2074  IPC_STRUCT_MEMBER(int32, gpu_process_host_id)
2075  IPC_STRUCT_MEMBER(ui::LatencyInfo, latency_info)
2076IPC_STRUCT_END()
2077
2078// This message is synthesized by GpuProcessHost to pass through a swap message
2079// to the RenderWidgetHelper. This allows GetBackingStore to block for either a
2080// software or GPU frame.
2081IPC_MESSAGE_ROUTED1(
2082    ViewHostMsg_CompositorSurfaceBuffersSwapped,
2083    ViewHostMsg_CompositorSurfaceBuffersSwapped_Params /* params */)
2084
2085IPC_MESSAGE_ROUTED2(ViewHostMsg_SwapCompositorFrame,
2086                    uint32 /* output_surface_id */,
2087                    cc::CompositorFrame /* frame */)
2088
2089// Sent by the compositor when input scroll events are dropped due to bounds
2090// restricions on the root scroll offset.
2091IPC_MESSAGE_ROUTED2(ViewHostMsg_DidOverscroll,
2092                    gfx::Vector2dF /* accumulated_overscroll */,
2093                    gfx::Vector2dF /* current_fling_velocity */)
2094
2095// Opens a file asynchronously. The response returns a file descriptor
2096// and an error code from base/platform_file.h.
2097IPC_MESSAGE_ROUTED3(ViewHostMsg_AsyncOpenFile,
2098                    base::FilePath /* file path */,
2099                    int /* flags */,
2100                    int /* message_id */)
2101
2102// Reply to a snapshot request containing whether snapshotting succeeded and the
2103// SkBitmap if it succeeded.
2104IPC_MESSAGE_ROUTED2(ViewHostMsg_Snapshot,
2105                    bool, /* success */
2106                    SkBitmap /* bitmap */)
2107
2108//---------------------------------------------------------------------------
2109// Request for cryptographic operation messages:
2110// These are messages from the renderer to the browser to perform a
2111// cryptographic operation.
2112
2113// Asks the browser process to generate a keypair for grabbing a client
2114// certificate from a CA (<keygen> tag), and returns the signed public
2115// key and challenge string.
2116IPC_SYNC_MESSAGE_CONTROL3_1(ViewHostMsg_Keygen,
2117                            uint32 /* key size index */,
2118                            std::string /* challenge string */,
2119                            GURL /* URL of requestor */,
2120                            std::string /* signed public key and challenge */)
2121
2122// Message sent from the renderer to the browser to request that the browser
2123// cache |data| associated with |url|.
2124IPC_MESSAGE_CONTROL3(ViewHostMsg_DidGenerateCacheableMetadata,
2125                     GURL /* url */,
2126                     double /* expected_response_time */,
2127                     std::vector<char> /* data */)
2128
2129// Displays a JavaScript out-of-memory message in the infobar.
2130IPC_MESSAGE_ROUTED0(ViewHostMsg_JSOutOfMemory)
2131
2132// Register a new handler for URL requests with the given scheme.
2133IPC_MESSAGE_ROUTED4(ViewHostMsg_RegisterProtocolHandler,
2134                    std::string /* scheme */,
2135                    GURL /* url */,
2136                    string16 /* title */,
2137                    bool /* user_gesture */)
2138
2139// Stores new inspector setting in the profile.
2140// TODO(jam): this should be in the chrome module
2141IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateInspectorSetting,
2142                    std::string,  /* key */
2143                    std::string /* value */)
2144
2145// Puts the browser into "tab fullscreen" mode for the sending renderer.
2146// See the comment in chrome/browser/ui/browser.h for more details.
2147IPC_MESSAGE_ROUTED1(ViewHostMsg_ToggleFullscreen,
2148                    bool /* enter_fullscreen */)
2149
2150// Send back a string to be recorded by UserMetrics.
2151IPC_MESSAGE_CONTROL1(ViewHostMsg_UserMetricsRecordAction,
2152                     std::string /* action */)
2153
2154// Notifies the browser that the page was or was not saved as MHTML.
2155IPC_MESSAGE_CONTROL2(ViewHostMsg_SavedPageAsMHTML,
2156                     int /* job_id */,
2157                     int64 /* size of the MHTML file, -1 if error */)
2158
2159IPC_MESSAGE_ROUTED3(ViewHostMsg_SendCurrentPageAllSavableResourceLinks,
2160                    std::vector<GURL> /* all savable resource links */,
2161                    std::vector<content::Referrer> /* all referrers */,
2162                    std::vector<GURL> /* all frame links */)
2163
2164IPC_MESSAGE_ROUTED3(ViewHostMsg_SendSerializedHtmlData,
2165                    GURL /* frame's url */,
2166                    std::string /* data buffer */,
2167                    int32 /* complete status */)
2168
2169// Notifies the browser of an event occurring in the media pipeline.
2170IPC_MESSAGE_CONTROL1(ViewHostMsg_MediaLogEvents,
2171                     std::vector<media::MediaLogEvent> /* events */)
2172
2173// Requests to lock the mouse. Will result in a ViewMsg_LockMouse_ACK message
2174// being sent back.
2175// |privileged| is used by Pepper Flash. If this flag is set to true, we won't
2176// pop up a bubble to ask for user permission or take mouse lock content into
2177// account.
2178IPC_MESSAGE_ROUTED3(ViewHostMsg_LockMouse,
2179                    bool /* user_gesture */,
2180                    bool /* last_unlocked_by_target */,
2181                    bool /* privileged */)
2182
2183// Requests to unlock the mouse. A ViewMsg_MouseLockLost message will be sent
2184// whenever the mouse is unlocked (which may or may not be caused by
2185// ViewHostMsg_UnlockMouse).
2186IPC_MESSAGE_ROUTED0(ViewHostMsg_UnlockMouse)
2187
2188// Notifies that the initial empty document of a view has been accessed.
2189// After this, it is no longer safe to show a pending navigation's URL without
2190// making a URL spoof possible.
2191IPC_MESSAGE_ROUTED0(ViewHostMsg_DidAccessInitialDocument)
2192
2193// Following message is used to communicate the values received by the
2194// callback binding the JS to Cpp.
2195// An instance of browser that has an automation host listening to it can
2196// have a javascript send a native value (string, number, boolean) to the
2197// listener in Cpp. (DomAutomationController)
2198IPC_MESSAGE_ROUTED2(ViewHostMsg_DomOperationResponse,
2199                    std::string  /* json_string */,
2200                    int  /* automation_id */)
2201
2202// Sent to the browser when the renderer detects it is blocked on a pepper
2203// plugin message for too long. This is also sent when it becomes unhung
2204// (according to the value of is_hung). The browser can give the user the
2205// option of killing the plugin.
2206IPC_MESSAGE_ROUTED3(ViewHostMsg_PepperPluginHung,
2207                    int /* plugin_child_id */,
2208                    base::FilePath /* path */,
2209                    bool /* is_hung */)
2210
2211// Notifies that multiple touch targets may have been pressed, and to show
2212// the disambiguation popup.
2213IPC_MESSAGE_ROUTED3(ViewHostMsg_ShowDisambiguationPopup,
2214                    gfx::Rect, /* Border of touched targets */
2215                    gfx::Size, /* Size of zoomed image */
2216                    TransportDIB::Id /* DIB of zoomed image */)
2217
2218// Sent by the renderer process to check whether client 3D APIs
2219// (Pepper 3D, WebGL) are explicitly blocked.
2220IPC_SYNC_MESSAGE_CONTROL3_1(ViewHostMsg_Are3DAPIsBlocked,
2221                            int /* render_view_id */,
2222                            GURL /* top_origin_url */,
2223                            content::ThreeDAPIType /* requester */,
2224                            bool /* blocked */)
2225
2226// Sent by the renderer process to indicate that a context was lost by
2227// client 3D content (Pepper 3D, WebGL) running on the page at the
2228// given URL.
2229IPC_MESSAGE_CONTROL3(ViewHostMsg_DidLose3DContext,
2230                     GURL /* top_origin_url */,
2231                     content::ThreeDAPIType /* context_type */,
2232                     int /* arb_robustness_status_code */)
2233
2234// This message is sent when a frame is added to the DOM.
2235IPC_MESSAGE_ROUTED3(ViewHostMsg_FrameAttached,
2236                    int64 /* parent_frame_id*/,
2237                    int64 /* frame_id */,
2238                    std::string /* frame_name */)
2239
2240// Notifies the browser that the frame with the given id was detached. The
2241// |parent_frame_id| is -1 for the top level frame, otherwise the id of the
2242// immediate parent of the detached frame.
2243IPC_MESSAGE_ROUTED2(ViewHostMsg_FrameDetached,
2244                    int64 /* parent_frame_id */,
2245                    int64 /* frame_id */)
2246
2247// Notifies the browser that document has parsed the body. This is used by the
2248// ResourceScheduler as an indication that bandwidth contention won't block
2249// first paint.
2250IPC_MESSAGE_ROUTED0(ViewHostMsg_WillInsertBody)
2251
2252// Notification that the urls for the favicon of a site has been determined.
2253IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateFaviconURL,
2254                    int32 /* page_id */,
2255                    std::vector<content::FaviconURL> /* candidates */)
2256
2257// Sent once a paint happens after the first non empty layout. In other words
2258// after the page has painted something.
2259IPC_MESSAGE_ROUTED1(ViewHostMsg_DidFirstVisuallyNonEmptyPaint,
2260                    int /* page_id */)
2261
2262#if defined(OS_ANDROID)
2263// Response to ViewMsg_FindMatchRects.
2264//
2265// |version| will contain the current version number of the renderer's find
2266// match list (incremented whenever they change), which should be passed in the
2267// next call to ViewMsg_FindMatchRects.
2268//
2269// |rects| will either contain a list of the enclosing rects of all matches
2270// found by the most recent Find operation, or will be empty if |version| is not
2271// greater than the |current_version| passed to ViewMsg_FindMatchRects (hence
2272// your locally cached rects should still be valid). The rect coords will be
2273// custom normalized fractions of the document size. The rects will be sorted by
2274// frame traversal order starting in the main frame, then by dom order.
2275//
2276// |active_rect| will contain the bounding box of the active find-in-page match
2277// marker, in similarly normalized coords (or an empty rect if there isn't one).
2278IPC_MESSAGE_ROUTED3(ViewHostMsg_FindMatchRects_Reply,
2279                    int /* version */,
2280                    std::vector<gfx::RectF> /* rects */,
2281                    gfx::RectF /* active_rect */)
2282
2283// Start an android intent with the given URI.
2284IPC_MESSAGE_ROUTED1(ViewHostMsg_StartContentIntent,
2285                    GURL /* content_url */)
2286
2287// Message sent when the renderer changed the background color for the view.
2288IPC_MESSAGE_ROUTED1(ViewHostMsg_DidChangeBodyBackgroundColor,
2289                    uint32  /* bg_color */)
2290
2291// This message is an ACK that the batch state change has been received by
2292// the renderer and all IME related messages should be processed accordingly.
2293IPC_MESSAGE_ROUTED1(ViewHostMsg_ImeBatchStateChanged_ACK,
2294                    bool /* is_begin */)
2295
2296// This message runs the MediaCodec for decoding audio for webaudio.
2297IPC_MESSAGE_CONTROL3(ViewHostMsg_RunWebAudioMediaCodec,
2298                     base::SharedMemoryHandle /* encoded_data_handle */,
2299                     base::FileDescriptor /* pcm_output */,
2300                     uint32_t /* data_size*/)
2301
2302// Sent by renderer to request a ViewMsg_BeginFrame message for upcoming
2303// display events. If |enabled| is true, the BeginFrame message will continue
2304// to be be delivered until the notification is disabled.
2305IPC_MESSAGE_ROUTED1(ViewHostMsg_SetNeedsBeginFrame,
2306                    bool /* enabled */)
2307
2308// Sent by the renderer to the browser to start a vibration with the given
2309// duration.
2310IPC_MESSAGE_CONTROL1(ViewHostMsg_Vibrate,
2311                     int64 /* milliseconds */)
2312
2313// Sent by the renderer to the browser to cancel the currently running
2314// vibration, if there is one.
2315IPC_MESSAGE_CONTROL0(ViewHostMsg_CancelVibration)
2316
2317#elif defined(OS_MACOSX)
2318// Request that the browser load a font into shared memory for us.
2319IPC_SYNC_MESSAGE_CONTROL1_3(ViewHostMsg_LoadFont,
2320                           FontDescriptor /* font to load */,
2321                           uint32 /* buffer size */,
2322                           base::SharedMemoryHandle /* font data */,
2323                           uint32 /* font id */)
2324
2325// Informs the browser that a plugin has gained or lost focus.
2326IPC_MESSAGE_ROUTED2(ViewHostMsg_PluginFocusChanged,
2327                    bool, /* focused */
2328                    int /* plugin_id */)
2329
2330// Instructs the browser to start plugin IME.
2331IPC_MESSAGE_ROUTED0(ViewHostMsg_StartPluginIme)
2332
2333#elif defined(OS_WIN)
2334// Request that the given font characters be loaded by the browser so it's
2335// cached by the OS. Please see RenderMessageFilter::OnPreCacheFontCharacters
2336// for details.
2337IPC_SYNC_MESSAGE_CONTROL2_0(ViewHostMsg_PreCacheFontCharacters,
2338                            LOGFONT /* font_data */,
2339                            string16 /* characters */)
2340#endif
2341
2342#if defined(OS_POSIX)
2343// On POSIX, we cannot allocated shared memory from within the sandbox, so
2344// this call exists for the renderer to ask the browser to allocate memory
2345// on its behalf. We return a file descriptor to the POSIX shared memory.
2346// If the |cache_in_browser| flag is |true|, then a copy of the shmem is kept
2347// by the browser, and it is the caller's repsonsibility to send a
2348// ViewHostMsg_FreeTransportDIB message in order to release the cached shmem.
2349// In all cases, the caller is responsible for deleting the resulting
2350// TransportDIB.
2351IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_AllocTransportDIB,
2352                            uint32_t, /* bytes requested */
2353                            bool, /* cache in the browser */
2354                            TransportDIB::Handle /* DIB */)
2355
2356// Since the browser keeps handles to the allocated transport DIBs, this
2357// message is sent to tell the browser that it may release them when the
2358// renderer is finished with them.
2359IPC_MESSAGE_CONTROL1(ViewHostMsg_FreeTransportDIB,
2360                     TransportDIB::Id /* DIB id */)
2361#endif
2362
2363#if defined(OS_MACOSX) || defined(OS_WIN) || defined(USE_AURA)
2364// On MACOSX, WIN and AURA IME can request composition character bounds
2365// synchronously (see crbug.com/120597). This IPC message sends the character
2366// bounds after every composition change to always have correct bound info.
2367IPC_MESSAGE_ROUTED2(ViewHostMsg_ImeCompositionRangeChanged,
2368                    ui::Range /* composition range */,
2369                    std::vector<gfx::Rect> /* character bounds */)
2370#endif
2371
2372// Adding a new message? Stick to the sort order above: first platform
2373// independent ViewMsg, then ifdefs for platform specific ViewMsg, then platform
2374// independent ViewHostMsg, then ifdefs for platform specific ViewHostMsg.
2375