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