1 // Copyright 2013 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.
5 // IPC messages for interacting with frames.
6 // Multiply-included message file, hence no include guard.
8 #include "content/common/content_export.h"
9 #include "content/common/content_param_traits.h"
10 #include "content/common/frame_message_enums.h"
11 #include "content/common/frame_param.h"
12 #include "content/common/frame_replication_state.h"
13 #include "content/common/navigation_gesture.h"
14 #include "content/common/navigation_params.h"
15 #include "content/common/resource_request_body.h"
16 #include "content/public/common/color_suggestion.h"
17 #include "content/public/common/common_param_traits.h"
18 #include "content/public/common/context_menu_params.h"
19 #include "content/public/common/frame_navigate_params.h"
20 #include "content/public/common/javascript_message_type.h"
21 #include "content/public/common/message_port_types.h"
22 #include "content/public/common/page_state.h"
23 #include "content/public/common/resource_response.h"
24 #include "content/public/common/transition_element.h"
25 #include "ipc/ipc_message_macros.h"
26 #include "ui/gfx/ipc/gfx_param_traits.h"
28 #include "url/origin.h"
30 #undef IPC_MESSAGE_EXPORT
31 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT
33 #define IPC_MESSAGE_START FrameMsgStart
35 IPC_ENUM_TRAITS_MIN_MAX_VALUE(AccessibilityMode
,
37 AccessibilityModeComplete
)
38 IPC_ENUM_TRAITS_MIN_MAX_VALUE(content::JavaScriptMessageType
,
39 content::JAVASCRIPT_MESSAGE_TYPE_ALERT
,
40 content::JAVASCRIPT_MESSAGE_TYPE_PROMPT
)
41 IPC_ENUM_TRAITS_MAX_VALUE(FrameMsg_Navigate_Type::Value
,
42 FrameMsg_Navigate_Type::NAVIGATE_TYPE_LAST
)
43 IPC_ENUM_TRAITS_MAX_VALUE(FrameMsg_UILoadMetricsReportType::Value
,
44 FrameMsg_UILoadMetricsReportType::REPORT_TYPE_LAST
)
45 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebContextMenuData::MediaType
,
46 blink::WebContextMenuData::MediaTypeLast
)
47 IPC_ENUM_TRAITS_MAX_VALUE(ui::MenuSourceType
, ui::MENU_SOURCE_TYPE_LAST
)
48 IPC_ENUM_TRAITS(content::SandboxFlags
) // Bitmask.
50 IPC_STRUCT_TRAITS_BEGIN(content::ColorSuggestion
)
51 IPC_STRUCT_TRAITS_MEMBER(color
)
52 IPC_STRUCT_TRAITS_MEMBER(label
)
53 IPC_STRUCT_TRAITS_END()
55 IPC_STRUCT_TRAITS_BEGIN(content::ContextMenuParams
)
56 IPC_STRUCT_TRAITS_MEMBER(media_type
)
57 IPC_STRUCT_TRAITS_MEMBER(x
)
58 IPC_STRUCT_TRAITS_MEMBER(y
)
59 IPC_STRUCT_TRAITS_MEMBER(link_url
)
60 IPC_STRUCT_TRAITS_MEMBER(link_text
)
61 IPC_STRUCT_TRAITS_MEMBER(unfiltered_link_url
)
62 IPC_STRUCT_TRAITS_MEMBER(src_url
)
63 IPC_STRUCT_TRAITS_MEMBER(has_image_contents
)
64 IPC_STRUCT_TRAITS_MEMBER(page_url
)
65 IPC_STRUCT_TRAITS_MEMBER(keyword_url
)
66 IPC_STRUCT_TRAITS_MEMBER(frame_url
)
67 IPC_STRUCT_TRAITS_MEMBER(frame_page_state
)
68 IPC_STRUCT_TRAITS_MEMBER(media_flags
)
69 IPC_STRUCT_TRAITS_MEMBER(selection_text
)
70 IPC_STRUCT_TRAITS_MEMBER(suggested_filename
)
71 IPC_STRUCT_TRAITS_MEMBER(misspelled_word
)
72 IPC_STRUCT_TRAITS_MEMBER(misspelling_hash
)
73 IPC_STRUCT_TRAITS_MEMBER(dictionary_suggestions
)
74 IPC_STRUCT_TRAITS_MEMBER(spellcheck_enabled
)
75 IPC_STRUCT_TRAITS_MEMBER(is_editable
)
76 IPC_STRUCT_TRAITS_MEMBER(writing_direction_default
)
77 IPC_STRUCT_TRAITS_MEMBER(writing_direction_left_to_right
)
78 IPC_STRUCT_TRAITS_MEMBER(writing_direction_right_to_left
)
79 IPC_STRUCT_TRAITS_MEMBER(edit_flags
)
80 IPC_STRUCT_TRAITS_MEMBER(security_info
)
81 IPC_STRUCT_TRAITS_MEMBER(frame_charset
)
82 IPC_STRUCT_TRAITS_MEMBER(referrer_policy
)
83 IPC_STRUCT_TRAITS_MEMBER(custom_context
)
84 IPC_STRUCT_TRAITS_MEMBER(custom_items
)
85 IPC_STRUCT_TRAITS_MEMBER(source_type
)
86 #if defined(OS_ANDROID)
87 IPC_STRUCT_TRAITS_MEMBER(selection_start
)
88 IPC_STRUCT_TRAITS_MEMBER(selection_end
)
90 IPC_STRUCT_TRAITS_END()
92 IPC_STRUCT_TRAITS_BEGIN(content::CustomContextMenuContext
)
93 IPC_STRUCT_TRAITS_MEMBER(is_pepper_menu
)
94 IPC_STRUCT_TRAITS_MEMBER(request_id
)
95 IPC_STRUCT_TRAITS_MEMBER(render_widget_id
)
96 IPC_STRUCT_TRAITS_MEMBER(link_followed
)
97 IPC_STRUCT_TRAITS_END()
99 IPC_STRUCT_TRAITS_BEGIN(content::TransitionElement
)
100 IPC_STRUCT_TRAITS_MEMBER(id
)
101 IPC_STRUCT_TRAITS_MEMBER(rect
)
102 IPC_STRUCT_TRAITS_END()
104 IPC_STRUCT_BEGIN(FrameHostMsg_AddNavigationTransitionData_Params
)
105 IPC_STRUCT_MEMBER(int, render_frame_id
)
106 IPC_STRUCT_MEMBER(std::string
, allowed_destination_host_pattern
)
107 IPC_STRUCT_MEMBER(std::string
, selector
)
108 IPC_STRUCT_MEMBER(std::string
, markup
)
109 IPC_STRUCT_MEMBER(std::vector
<content::TransitionElement
>, elements
)
112 IPC_STRUCT_BEGIN(FrameHostMsg_DidFailProvisionalLoadWithError_Params
)
113 // Error code as reported in the DidFailProvisionalLoad callback.
114 IPC_STRUCT_MEMBER(int, error_code
)
115 // An error message generated from the error_code. This can be an empty
116 // string if we were unable to find a meaningful description.
117 IPC_STRUCT_MEMBER(base::string16
, error_description
)
118 // The URL that the error is reported for.
119 IPC_STRUCT_MEMBER(GURL
, url
)
120 // True if the failure is the result of navigating to a POST again
121 // and we're going to show the POST interstitial.
122 IPC_STRUCT_MEMBER(bool, showing_repost_interstitial
)
125 IPC_STRUCT_TRAITS_BEGIN(content::FrameNavigateParams
)
126 IPC_STRUCT_TRAITS_MEMBER(page_id
)
127 IPC_STRUCT_TRAITS_MEMBER(url
)
128 IPC_STRUCT_TRAITS_MEMBER(base_url
)
129 IPC_STRUCT_TRAITS_MEMBER(referrer
)
130 IPC_STRUCT_TRAITS_MEMBER(transition
)
131 IPC_STRUCT_TRAITS_MEMBER(redirects
)
132 IPC_STRUCT_TRAITS_MEMBER(should_update_history
)
133 IPC_STRUCT_TRAITS_MEMBER(searchable_form_url
)
134 IPC_STRUCT_TRAITS_MEMBER(searchable_form_encoding
)
135 IPC_STRUCT_TRAITS_MEMBER(contents_mime_type
)
136 IPC_STRUCT_TRAITS_MEMBER(socket_address
)
137 IPC_STRUCT_TRAITS_END()
139 // Parameters structure for FrameHostMsg_DidCommitProvisionalLoad, which has
140 // too many data parameters to be reasonably put in a predefined IPC message.
141 IPC_STRUCT_BEGIN_WITH_PARENT(FrameHostMsg_DidCommitProvisionalLoad_Params
,
142 content::FrameNavigateParams
)
143 IPC_STRUCT_TRAITS_PARENT(content::FrameNavigateParams
)
145 // Information regarding the security of the connection (empty if the
146 // connection was not secure).
147 IPC_STRUCT_MEMBER(std::string
, security_info
)
149 // The gesture that initiated this navigation.
150 IPC_STRUCT_MEMBER(content::NavigationGesture
, gesture
)
152 // True if this was a post request.
153 IPC_STRUCT_MEMBER(bool, is_post
)
155 // The POST body identifier. -1 if it doesn't exist.
156 IPC_STRUCT_MEMBER(int64
, post_id
)
158 // Whether the frame navigation resulted in no change to the documents within
159 // the page. For example, the navigation may have just resulted in scrolling
160 // to a named anchor.
161 IPC_STRUCT_MEMBER(bool, was_within_same_page
)
163 // The status code of the HTTP request.
164 IPC_STRUCT_MEMBER(int, http_status_code
)
166 // This flag is used to warn if the renderer is displaying an error page,
167 // so that we can set the appropriate page type.
168 IPC_STRUCT_MEMBER(bool, url_is_unreachable
)
170 // True if the connection was proxied. In this case, socket_address
171 // will represent the address of the proxy, rather than the remote host.
172 IPC_STRUCT_MEMBER(bool, was_fetched_via_proxy
)
174 // Serialized history item state to store in the navigation entry.
175 IPC_STRUCT_MEMBER(content::PageState
, page_state
)
177 // Original request's URL.
178 IPC_STRUCT_MEMBER(GURL
, original_request_url
)
180 // User agent override used to navigate.
181 IPC_STRUCT_MEMBER(bool, is_overriding_user_agent
)
183 // Notifies the browser that for this navigation, the session history was
184 // successfully cleared.
185 IPC_STRUCT_MEMBER(bool, history_list_was_cleared
)
187 // The routing_id of the render view associated with the navigation.
188 // We need to track the RenderViewHost routing_id because of downstream
189 // dependencies (crbug.com/392171 DownloadRequestHandle, SaveFileManager,
190 // ResourceDispatcherHostImpl, MediaStreamUIProxy,
191 // SpeechRecognitionDispatcherHost and possibly others). They look up the view
192 // based on the ID stored in the resource requests. Once those dependencies
193 // are unwound or moved to RenderFrameHost (crbug.com/304341) we can move the
194 // client to be based on the routing_id of the RenderFrameHost.
195 IPC_STRUCT_MEMBER(int, render_view_routing_id
)
197 // Origin of the frame. This will be replicated to any associated
198 // RenderFrameProxies.
199 IPC_STRUCT_MEMBER(url::Origin
, origin
)
201 // How navigation metrics starting on UI action for this load should be
203 IPC_STRUCT_MEMBER(FrameMsg_UILoadMetricsReportType::Value
, report_type
)
205 // Timestamp at which the UI action that triggered the navigation originated.
206 IPC_STRUCT_MEMBER(base::TimeTicks
, ui_timestamp
)
209 IPC_STRUCT_BEGIN(FrameMsg_PostMessage_Params
)
210 // Whether the data format is supplied as serialized script value, or as
211 // a simple string. If it is a raw string, must be converted from string to a
212 // WebSerializedScriptValue in the renderer process.
213 IPC_STRUCT_MEMBER(bool, is_data_raw_string
)
215 // The serialized script value.
216 IPC_STRUCT_MEMBER(base::string16
, data
)
218 // When sent to the browser, this is the routing ID of the source frame in
219 // the source process. The browser replaces it with the routing ID of the
220 // equivalent frame proxy in the destination process.
221 IPC_STRUCT_MEMBER(int, source_routing_id
)
223 // When sent from the browser, this is the routing ID of the source view in
224 // the destination process. This currently exists only to support legacy
225 // postMessage to Android WebView and will be removed once crbug.com/473258
227 IPC_STRUCT_MEMBER(int, source_view_routing_id
)
229 // The origin of the source frame.
230 IPC_STRUCT_MEMBER(base::string16
, source_origin
)
232 // The origin for the message's target.
233 IPC_STRUCT_MEMBER(base::string16
, target_origin
)
235 // Information about the MessagePorts this message contains.
236 IPC_STRUCT_MEMBER(std::vector
<content::TransferredMessagePort
>, message_ports
)
237 IPC_STRUCT_MEMBER(std::vector
<int>, new_routing_ids
)
240 IPC_STRUCT_TRAITS_BEGIN(content::CommonNavigationParams
)
241 IPC_STRUCT_TRAITS_MEMBER(url
)
242 IPC_STRUCT_TRAITS_MEMBER(referrer
)
243 IPC_STRUCT_TRAITS_MEMBER(transition
)
244 IPC_STRUCT_TRAITS_MEMBER(navigation_type
)
245 IPC_STRUCT_TRAITS_MEMBER(allow_download
)
246 IPC_STRUCT_TRAITS_MEMBER(ui_timestamp
)
247 IPC_STRUCT_TRAITS_MEMBER(report_type
)
248 IPC_STRUCT_TRAITS_MEMBER(base_url_for_data_url
)
249 IPC_STRUCT_TRAITS_MEMBER(history_url_for_data_url
)
250 IPC_STRUCT_TRAITS_END()
252 IPC_STRUCT_TRAITS_BEGIN(content::BeginNavigationParams
)
253 IPC_STRUCT_TRAITS_MEMBER(method
)
254 IPC_STRUCT_TRAITS_MEMBER(headers
)
255 IPC_STRUCT_TRAITS_MEMBER(load_flags
)
256 IPC_STRUCT_TRAITS_MEMBER(has_user_gesture
)
257 IPC_STRUCT_TRAITS_END()
259 IPC_STRUCT_TRAITS_BEGIN(content::StartNavigationParams
)
260 IPC_STRUCT_TRAITS_MEMBER(is_post
)
261 IPC_STRUCT_TRAITS_MEMBER(extra_headers
)
262 IPC_STRUCT_TRAITS_MEMBER(browser_initiated_post_data
)
263 IPC_STRUCT_TRAITS_MEMBER(should_replace_current_entry
)
264 IPC_STRUCT_TRAITS_MEMBER(transferred_request_child_id
)
265 IPC_STRUCT_TRAITS_MEMBER(transferred_request_request_id
)
266 IPC_STRUCT_TRAITS_END()
268 IPC_STRUCT_TRAITS_BEGIN(content::RequestNavigationParams
)
269 IPC_STRUCT_TRAITS_MEMBER(is_overriding_user_agent
)
270 IPC_STRUCT_TRAITS_MEMBER(browser_navigation_start
)
271 IPC_STRUCT_TRAITS_MEMBER(redirects
)
272 IPC_STRUCT_TRAITS_MEMBER(can_load_local_resources
)
273 IPC_STRUCT_TRAITS_MEMBER(request_time
)
274 IPC_STRUCT_TRAITS_MEMBER(page_state
)
275 IPC_STRUCT_TRAITS_MEMBER(page_id
)
276 IPC_STRUCT_TRAITS_MEMBER(pending_history_list_offset
)
277 IPC_STRUCT_TRAITS_MEMBER(current_history_list_offset
)
278 IPC_STRUCT_TRAITS_MEMBER(current_history_list_length
)
279 IPC_STRUCT_TRAITS_MEMBER(should_clear_history_list
)
280 IPC_STRUCT_TRAITS_END()
282 IPC_STRUCT_TRAITS_BEGIN(content::FrameReplicationState
)
283 IPC_STRUCT_TRAITS_MEMBER(origin
)
284 IPC_STRUCT_TRAITS_MEMBER(sandbox_flags
)
285 IPC_STRUCT_TRAITS_MEMBER(name
)
286 IPC_STRUCT_TRAITS_END()
288 IPC_STRUCT_BEGIN(FrameMsg_NewFrame_WidgetParams
)
289 // Gives the routing ID for the RenderWidget that will be attached to the
290 // new RenderFrame. If the RenderFrame does not need a RenderWidget, this
291 // is MSG_ROUTING_NONE and the other parameters are not read.
292 IPC_STRUCT_MEMBER(int, routing_id
)
294 // Identifier for the output surface for the new RenderWidget.
295 IPC_STRUCT_MEMBER(int, surface_id
)
297 // Tells the new RenderWidget whether it is initially hidden.
298 IPC_STRUCT_MEMBER(bool, hidden
)
301 IPC_STRUCT_BEGIN(FrameHostMsg_OpenURL_Params
)
302 IPC_STRUCT_MEMBER(GURL
, url
)
303 IPC_STRUCT_MEMBER(content::Referrer
, referrer
)
304 IPC_STRUCT_MEMBER(WindowOpenDisposition
, disposition
)
305 IPC_STRUCT_MEMBER(bool, should_replace_current_entry
)
306 IPC_STRUCT_MEMBER(bool, user_gesture
)
309 IPC_STRUCT_BEGIN(FrameMsg_TextTrackSettings_Params
)
310 // Background color of the text track.
311 IPC_STRUCT_MEMBER(std::string
, text_track_background_color
)
313 // Font family of the text track text.
314 IPC_STRUCT_MEMBER(std::string
, text_track_font_family
)
316 // Font style of the text track text.
317 IPC_STRUCT_MEMBER(std::string
, text_track_font_style
)
319 // Font variant of the text track text.
320 IPC_STRUCT_MEMBER(std::string
, text_track_font_variant
)
322 // Color of the text track text.
323 IPC_STRUCT_MEMBER(std::string
, text_track_text_color
)
325 // Text shadow (edge style) of the text track text.
326 IPC_STRUCT_MEMBER(std::string
, text_track_text_shadow
)
328 // Size of the text track text.
329 IPC_STRUCT_MEMBER(std::string
, text_track_text_size
)
332 #if defined(OS_MACOSX) || defined(OS_ANDROID)
333 // This message is used for supporting popup menus on Mac OS X and Android using
334 // native controls. See the FrameHostMsg_ShowPopup message.
335 IPC_STRUCT_BEGIN(FrameHostMsg_ShowPopup_Params
)
336 // Position on the screen.
337 IPC_STRUCT_MEMBER(gfx::Rect
, bounds
)
339 // The height of each item in the menu.
340 IPC_STRUCT_MEMBER(int, item_height
)
342 // The size of the font to use for those items.
343 IPC_STRUCT_MEMBER(double, item_font_size
)
345 // The currently selected (displayed) item in the menu.
346 IPC_STRUCT_MEMBER(int, selected_item
)
348 // The entire list of items in the popup menu.
349 IPC_STRUCT_MEMBER(std::vector
<content::MenuItem
>, popup_items
)
351 // Whether items should be right-aligned.
352 IPC_STRUCT_MEMBER(bool, right_aligned
)
354 // Whether this is a multi-select popup.
355 IPC_STRUCT_MEMBER(bool, allow_multiple_selection
)
359 // -----------------------------------------------------------------------------
360 // Messages sent from the browser to the renderer.
362 // Notifies the embedding frame that a new CompositorFrame is ready to be
363 // presented. When the frame finishes presenting, a matching
364 // FrameHostMsg_CompositorFrameSwappedACK should be sent back to the
365 // RenderViewHost that was produced the CompositorFrame.
367 // This is used in the ubercomp compositing path.
368 IPC_MESSAGE_ROUTED1(FrameMsg_CompositorFrameSwapped
,
369 FrameMsg_CompositorFrameSwapped_Params
/* params */)
371 // Notifies the embedding frame that the process rendering the child frame's
372 // contents has terminated.
373 IPC_MESSAGE_ROUTED0(FrameMsg_ChildFrameProcessGone
)
375 // Sent in response to a FrameHostMsg_ContextMenu to let the renderer know that
376 // the menu has been closed.
377 IPC_MESSAGE_ROUTED1(FrameMsg_ContextMenuClosed
,
378 content::CustomContextMenuContext
/* custom_context */)
380 // Executes custom context menu action that was provided from Blink.
381 IPC_MESSAGE_ROUTED2(FrameMsg_CustomContextMenuAction
,
382 content::CustomContextMenuContext
/* custom_context */,
383 unsigned /* action */)
385 // Requests that the RenderFrame or RenderFrameProxy sets its opener to null.
386 IPC_MESSAGE_ROUTED0(FrameMsg_DisownOpener
)
388 // Requests that the RenderFrame send back a response after waiting for the
389 // commit, activation and frame swap of the current DOM tree in blink.
390 IPC_MESSAGE_ROUTED1(FrameMsg_VisualStateRequest
, uint64
/* id */)
392 // Instructs the renderer to create a new RenderFrame object with |routing_id|.
393 // The new frame should be created as a child of the object identified by
394 // |parent_routing_id| or as top level if that is MSG_ROUTING_NONE.
395 // If a valid |proxy_routing_id| is provided, the new frame will be configured
396 // to replace the proxy on commit. When the new frame has a parent,
397 // |replication_state| holds properties replicated from the process rendering
398 // the parent frame, such as the new frame's sandbox flags.
399 IPC_MESSAGE_CONTROL5(FrameMsg_NewFrame
,
400 int /* routing_id */,
401 int /* parent_routing_id */,
402 int /* proxy_routing_id */,
403 content::FrameReplicationState
/* replication_state */,
404 FrameMsg_NewFrame_WidgetParams
/* widget_params */)
406 // Instructs the renderer to create a new RenderFrameProxy object with
407 // |routing_id|. The new proxy should be created as a child of the object
408 // identified by |parent_routing_id| or as top level if that is
410 IPC_MESSAGE_CONTROL4(FrameMsg_NewFrameProxy
,
411 int /* routing_id */,
412 int /* parent_routing_id */,
413 int /* render_view_routing_id */,
414 content::FrameReplicationState
/* replication_state */)
416 // Tells the renderer to perform the specified navigation, interrupting any
417 // existing navigation.
418 IPC_MESSAGE_ROUTED3(FrameMsg_Navigate
,
419 content::CommonNavigationParams
, /* common_params */
420 content::StartNavigationParams
, /* start_params */
421 content::RequestNavigationParams
/* request_params */)
423 // Instructs the renderer to invoke the frame's beforeunload event handler.
424 // Expects the result to be returned via FrameHostMsg_BeforeUnload_ACK.
425 IPC_MESSAGE_ROUTED0(FrameMsg_BeforeUnload
)
427 // Instructs the frame to swap out for a cross-site transition, including
428 // running the unload event handler and creating a RenderFrameProxy with the
429 // given |proxy_routing_id|. Expects a SwapOut_ACK message when finished.
430 IPC_MESSAGE_ROUTED3(FrameMsg_SwapOut
,
431 int /* proxy_routing_id */,
432 bool /* is_loading */,
433 content::FrameReplicationState
/* replication_state */)
435 // Instructs the frame to stop the load in progress, if any.
436 IPC_MESSAGE_ROUTED0(FrameMsg_Stop
)
438 // A message sent to RenderFrameProxy to indicate that its corresponding
439 // RenderFrame has started loading a document.
440 IPC_MESSAGE_ROUTED0(FrameMsg_DidStartLoading
)
442 // A message sent to RenderFrameProxy to indicate that its corresponding
443 // RenderFrame has completed loading.
444 IPC_MESSAGE_ROUTED0(FrameMsg_DidStopLoading
)
446 // Request for the renderer to insert CSS into the frame.
447 IPC_MESSAGE_ROUTED1(FrameMsg_CSSInsertRequest
,
448 std::string
/* css */)
450 // Request for the renderer to execute JavaScript in the frame's context.
452 // javascript is the string containing the JavaScript to be executed in the
453 // target frame's context.
455 // If the third parameter is true the result is sent back to the browser using
456 // the message FrameHostMsg_JavaScriptExecuteResponse.
457 // FrameHostMsg_JavaScriptExecuteResponse is passed the ID parameter so that the
458 // host can uniquely identify the request.
459 IPC_MESSAGE_ROUTED3(FrameMsg_JavaScriptExecuteRequest
,
460 base::string16
, /* javascript */
462 bool /* if true, a reply is requested */)
464 // ONLY FOR TESTS: Same as above but adds a fake UserGestureindicator around
465 // execution. (crbug.com/408426)
466 IPC_MESSAGE_ROUTED3(FrameMsg_JavaScriptExecuteRequestForTests
,
467 base::string16
, /* javascript */
469 bool /* if true, a reply is requested */)
471 // Selects between the given start and end offsets in the currently focused
473 IPC_MESSAGE_ROUTED2(FrameMsg_SetEditableSelectionOffsets
,
477 // Requests a navigation to the supplied markup, in an iframe with sandbox
479 IPC_MESSAGE_ROUTED1(FrameMsg_SetupTransitionView
,
480 std::string
/* markup */)
482 // Tells the renderer to hide the elements specified by the supplied CSS
483 // selector, and activates any exiting-transition stylesheets.
484 IPC_MESSAGE_ROUTED2(FrameMsg_BeginExitTransition
,
485 std::string
/* css_selector */,
486 bool /* exit_to_native_app */)
488 // Tell the renderer to revert the exit transition done before
489 IPC_MESSAGE_ROUTED0(FrameMsg_RevertExitTransition
)
491 // Tell the renderer to hide transition elements.
492 IPC_MESSAGE_ROUTED1(FrameMsg_HideTransitionElements
,
493 std::string
/* css_selector */)
495 // Tell the renderer to hide transition elements.
496 IPC_MESSAGE_ROUTED1(FrameMsg_ShowTransitionElements
,
497 std::string
/* css_selector */)
499 // Tells the renderer to reload the frame, optionally ignoring the cache while
501 IPC_MESSAGE_ROUTED1(FrameMsg_Reload
,
502 bool /* ignore_cache */)
504 // Notifies the color chooser client that the user selected a color.
505 IPC_MESSAGE_ROUTED2(FrameMsg_DidChooseColorResponse
, unsigned, SkColor
)
507 // Notifies the color chooser client that the color chooser has ended.
508 IPC_MESSAGE_ROUTED1(FrameMsg_DidEndColorChooser
, unsigned)
510 // Notifies the corresponding RenderFrameProxy object to replace itself with the
511 // RenderFrame object it is associated with.
512 IPC_MESSAGE_ROUTED0(FrameMsg_DeleteProxy
)
514 // Request the text surrounding the selection with a |max_length|. The response
515 // will be sent via FrameHostMsg_TextSurroundingSelectionResponse.
516 IPC_MESSAGE_ROUTED1(FrameMsg_TextSurroundingSelectionRequest
,
517 size_t /* max_length */)
519 // Tells the renderer to insert a link to the specified stylesheet. This is
520 // needed to support navigation transitions.
521 IPC_MESSAGE_ROUTED1(FrameMsg_AddStyleSheetByURL
, std::string
)
523 // Change the accessibility mode in the renderer process.
524 IPC_MESSAGE_ROUTED1(FrameMsg_SetAccessibilityMode
,
527 // Dispatch a load event in the iframe element containing this frame.
528 IPC_MESSAGE_ROUTED0(FrameMsg_DispatchLoad
)
530 // Notifies the frame that its parent has changed the frame's sandbox flags.
531 IPC_MESSAGE_ROUTED1(FrameMsg_DidUpdateSandboxFlags
, content::SandboxFlags
)
533 // Update a proxy's window.name property. Used when the frame's name is
534 // changed in another process.
535 IPC_MESSAGE_ROUTED1(FrameMsg_DidUpdateName
, std::string
/* name */)
537 // Send to the RenderFrame to set text track style settings.
538 // Sent for top-level frames.
539 IPC_MESSAGE_ROUTED1(FrameMsg_SetTextTrackSettings
,
540 FrameMsg_TextTrackSettings_Params
/* params */)
542 // Posts a message from a frame in another process to the current renderer.
543 IPC_MESSAGE_ROUTED1(FrameMsg_PostMessageEvent
, FrameMsg_PostMessage_Params
)
545 #if defined(OS_ANDROID)
547 // External popup menus.
548 IPC_MESSAGE_ROUTED2(FrameMsg_SelectPopupMenuItems
,
549 bool /* user canceled the popup */,
550 std::vector
<int> /* selected indices */)
552 #elif defined(OS_MACOSX)
554 // External popup menus.
555 IPC_MESSAGE_ROUTED1(FrameMsg_SelectPopupMenuItem
,
556 int /* selected index, -1 means no selection */)
561 // Tells the renderer that a navigation is ready to commit. The renderer should
562 // request |stream_url| to get access to the stream containing the body of the
564 IPC_MESSAGE_ROUTED4(FrameMsg_CommitNavigation
,
565 content::ResourceResponseHead
, /* response */
566 GURL
, /* stream_url */
567 content::CommonNavigationParams
, /* common_params */
568 content::RequestNavigationParams
/* request_params */)
571 // Tells the renderer that a navigation failed with the error code |error_code|
572 // and that the renderer should display an appropriate error page.
573 IPC_MESSAGE_ROUTED4(FrameMsg_FailedNavigation
,
574 content::CommonNavigationParams
, /* common_params */
575 content::RequestNavigationParams
, /* request_params */
576 bool, /* stale_copy_in_cache */
577 int /* error_code */)
579 #if defined(ENABLE_PLUGINS)
580 // Notifies the renderer of updates to the Plugin Power Saver origin whitelist.
581 IPC_MESSAGE_ROUTED1(FrameMsg_UpdatePluginContentOriginWhitelist
,
582 std::set
<GURL
> /* origin_whitelist */)
583 #endif // defined(ENABLE_PLUGINS)
585 // -----------------------------------------------------------------------------
586 // Messages sent from the renderer to the browser.
588 // Blink and JavaScript error messages to log to the console
590 IPC_MESSAGE_ROUTED4(FrameHostMsg_AddMessageToConsole
,
591 int32
, /* log level */
592 base::string16
, /* msg */
593 int32
, /* line number */
594 base::string16
/* source id */ )
596 // Sent by the renderer when a child frame is created in the renderer.
598 // Each of these messages will have a corresponding FrameHostMsg_Detach message
599 // sent when the frame is detached from the DOM.
600 IPC_SYNC_MESSAGE_CONTROL3_1(FrameHostMsg_CreateChildFrame
,
601 int32
/* parent_routing_id */,
602 std::string
/* frame_name */,
603 content::SandboxFlags
/* sandbox flags */,
604 int32
/* new_routing_id */)
606 // Sent by the renderer to the parent RenderFrameHost when a child frame is
607 // detached from the DOM.
608 IPC_MESSAGE_ROUTED0(FrameHostMsg_Detach
)
610 // Indicates the renderer process is gone. This actually is sent by the
611 // browser process to itself, but keeps the interface cleaner.
612 IPC_MESSAGE_ROUTED2(FrameHostMsg_RenderProcessGone
,
613 int, /* this really is base::TerminationStatus */
616 // Sent by the renderer when the frame becomes focused.
617 IPC_MESSAGE_ROUTED0(FrameHostMsg_FrameFocused
)
619 // Sent when the renderer starts a provisional load for a frame.
620 // |is_transition_navigation| signals that the frame has defined transition
621 // elements which can be animated by the navigation destination to provide
622 // a transition effect during load.
623 IPC_MESSAGE_ROUTED2(FrameHostMsg_DidStartProvisionalLoadForFrame
,
625 bool /* is_transition_navigation */)
627 // Sent when the renderer fails a provisional load with an error.
628 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidFailProvisionalLoadWithError
,
629 FrameHostMsg_DidFailProvisionalLoadWithError_Params
)
631 // Notifies the browser that a frame in the view has changed. This message
632 // has a lot of parameters and is packed/unpacked by functions defined in
633 // render_messages.h.
634 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidCommitProvisionalLoad
,
635 FrameHostMsg_DidCommitProvisionalLoad_Params
)
637 // Notifies the browser that a document has been loaded.
638 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidFinishDocumentLoad
)
640 IPC_MESSAGE_ROUTED3(FrameHostMsg_DidFailLoadWithError
,
641 GURL
/* validated_url */,
642 int /* error_code */,
643 base::string16
/* error_description */)
645 // Sent when the renderer decides to ignore a navigation.
646 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidDropNavigation
)
648 // Sent when the renderer starts loading the page. |to_different_document| will
649 // be true unless the load is a fragment navigation, or triggered by
650 // history.pushState/replaceState.
651 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidStartLoading
,
652 bool /* to_different_document */)
654 // Sent when the renderer is done loading a page.
655 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidStopLoading
)
657 // Sent when the frame changes its window.name.
658 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidChangeName
, std::string
/* name */)
660 // Sent when the renderer changed the progress of a load.
661 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidChangeLoadProgress
,
662 double /* load_progress */)
664 // Requests that the given URL be opened in the specified manner.
665 IPC_MESSAGE_ROUTED1(FrameHostMsg_OpenURL
, FrameHostMsg_OpenURL_Params
)
667 // Notifies the browser that a frame finished loading.
668 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidFinishLoad
,
669 GURL
/* validated_url */)
671 // Sent when after the onload handler has been invoked for the document
672 // in this frame. Sent for top-level frames. |report_type| and |ui_timestamp|
673 // are used to report navigation metrics starting on the ui input event that
674 // triggered the navigation timestamp.
675 IPC_MESSAGE_ROUTED2(FrameHostMsg_DocumentOnLoadCompleted
,
676 FrameMsg_UILoadMetricsReportType::Value
/* report_type */,
677 base::TimeTicks
/* ui_timestamp */)
679 // Notifies that the initial empty document of a view has been accessed.
680 // After this, it is no longer safe to show a pending navigation's URL without
681 // making a URL spoof possible.
682 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidAccessInitialDocument
)
684 // Sent when the frame sets its opener to null, disowning it for the lifetime of
685 // the window. Sent for top-level frames.
686 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidDisownOpener
)
688 // Notifies the browser that a page id was assigned.
689 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidAssignPageId
,
692 // Notifies the browser that sandbox flags have changed for a subframe of this
694 IPC_MESSAGE_ROUTED2(FrameHostMsg_DidChangeSandboxFlags
,
695 int32
/* subframe_routing_id */,
696 content::SandboxFlags
/* updated_flags */)
698 // Changes the title for the page in the UI when the page is navigated or the
699 // title changes. Sent for top-level frames.
700 IPC_MESSAGE_ROUTED2(FrameHostMsg_UpdateTitle
,
701 base::string16
/* title */,
702 blink::WebTextDirection
/* title direction */)
704 // Change the encoding name of the page in UI when the page has detected
705 // proper encoding name. Sent for top-level frames.
706 IPC_MESSAGE_ROUTED1(FrameHostMsg_UpdateEncoding
,
707 std::string
/* new encoding name */)
709 // Following message is used to communicate the values received by the
710 // callback binding the JS to Cpp.
711 // An instance of browser that has an automation host listening to it can
712 // have a javascript send a native value (string, number, boolean) to the
713 // listener in Cpp. (DomAutomationController)
714 IPC_MESSAGE_ROUTED2(FrameHostMsg_DomOperationResponse
,
715 std::string
/* json_string */,
716 int /* automation_id */)
718 #if defined(ENABLE_PLUGINS)
719 // Sent to the browser when the renderer detects it is blocked on a pepper
720 // plugin message for too long. This is also sent when it becomes unhung
721 // (according to the value of is_hung). The browser can give the user the
722 // option of killing the plugin.
723 IPC_MESSAGE_ROUTED3(FrameHostMsg_PepperPluginHung
,
724 int /* plugin_child_id */,
725 base::FilePath
/* path */,
728 // Sent by the renderer process to indicate that a plugin instance has crashed.
729 // Note: |plugin_pid| should not be trusted. The corresponding process has
730 // probably died. Moreover, the ID may have been reused by a new process. Any
731 // usage other than displaying it in a prompt to the user is very likely to be
733 IPC_MESSAGE_ROUTED2(FrameHostMsg_PluginCrashed
,
734 base::FilePath
/* plugin_path */,
735 base::ProcessId
/* plugin_pid */)
737 // Return information about a plugin for the given URL and MIME
738 // type. If there is no matching plugin, |found| is false.
739 // |actual_mime_type| is the actual mime type supported by the
741 IPC_SYNC_MESSAGE_CONTROL4_3(FrameHostMsg_GetPluginInfo
,
742 int /* render_frame_id */,
745 std::string
/* mime_type */,
747 content::WebPluginInfo
/* plugin info */,
748 std::string
/* actual_mime_type */)
750 // A renderer sends this to the browser process when it wants to temporarily
751 // whitelist an origin's plugin content as essential. This temporary whitelist
752 // is specific to a top level frame, and is cleared when the whitelisting
753 // RenderFrame is destroyed.
754 IPC_MESSAGE_ROUTED1(FrameHostMsg_PluginContentOriginAllowed
,
755 GURL
/* content_origin */)
756 #endif // defined(ENABLE_PLUGINS)
758 // A renderer sends this to the browser process when it wants to
759 // create a plugin. The browser will create the plugin process if
760 // necessary, and will return a handle to the channel on success.
761 // On error an empty string is returned.
762 IPC_SYNC_MESSAGE_CONTROL4_2(FrameHostMsg_OpenChannelToPlugin
,
763 int /* render_frame_id */,
766 std::string
/* mime_type */,
767 IPC::ChannelHandle
/* channel_handle */,
768 content::WebPluginInfo
/* info */)
770 // Acknowledge that we presented an ubercomp frame.
772 // See FrameMsg_CompositorFrameSwapped
773 IPC_MESSAGE_ROUTED1(FrameHostMsg_CompositorFrameSwappedACK
,
774 FrameHostMsg_CompositorFrameSwappedACK_Params
/* params */)
776 // Provides the result from handling BeforeUnload. |proceed| matches the return
777 // value of the frame's beforeunload handler: true if the user decided to
778 // proceed with leaving the page.
779 IPC_MESSAGE_ROUTED3(FrameHostMsg_BeforeUnload_ACK
,
781 base::TimeTicks
/* before_unload_start_time */,
782 base::TimeTicks
/* before_unload_end_time */)
784 // Indicates that the current frame has swapped out, after a SwapOut message.
785 IPC_MESSAGE_ROUTED0(FrameHostMsg_SwapOut_ACK
)
787 IPC_MESSAGE_ROUTED1(FrameHostMsg_ReclaimCompositorResources
,
788 FrameHostMsg_ReclaimCompositorResources_Params
/* params */)
790 // Forwards an input event to a child.
791 // TODO(nick): Temporary bridge, revisit once the browser process can route
792 // input directly to subframes. http://crbug.com/339659
793 IPC_MESSAGE_ROUTED1(FrameHostMsg_ForwardInputEvent
,
794 IPC::WebInputEventPointer
/* event */)
796 // Used to tell the parent that the user right clicked on an area of the
797 // content area, and a context menu should be shown for it. The params
798 // object contains information about the node(s) that were selected when the
799 // user right clicked.
800 IPC_MESSAGE_ROUTED1(FrameHostMsg_ContextMenu
, content::ContextMenuParams
)
802 // Initial drawing parameters for a child frame that has been swapped out to
804 IPC_MESSAGE_ROUTED2(FrameHostMsg_InitializeChildFrame
,
805 gfx::Rect
/* frame_rect */,
806 float /* scale_factor */)
808 // Response for FrameMsg_JavaScriptExecuteRequest, sent when a reply was
809 // requested. The ID is the parameter supplied to
810 // FrameMsg_JavaScriptExecuteRequest. The result has the value returned by the
811 // script as its only element, one of Null, Boolean, Integer, Real, Date, or
813 IPC_MESSAGE_ROUTED2(FrameHostMsg_JavaScriptExecuteResponse
,
815 base::ListValue
/* result */)
817 // A request to run a JavaScript dialog.
818 IPC_SYNC_MESSAGE_ROUTED4_2(FrameHostMsg_RunJavaScriptMessage
,
819 base::string16
/* in - alert message */,
820 base::string16
/* in - default prompt */,
821 GURL
/* in - originating page URL */,
822 content::JavaScriptMessageType
/* in - type */,
823 bool /* out - success */,
824 base::string16
/* out - user_input field */)
826 // Displays a dialog to confirm that the user wants to navigate away from the
827 // page. Replies true if yes, and false otherwise. The reply string is ignored,
828 // but is included so that we can use OnJavaScriptMessageBoxClosed.
829 IPC_SYNC_MESSAGE_ROUTED3_2(FrameHostMsg_RunBeforeUnloadConfirm
,
830 GURL
, /* in - originating frame URL */
831 base::string16
/* in - alert message */,
832 bool /* in - is a reload */,
833 bool /* out - success */,
834 base::string16
/* out - This is ignored.*/)
836 // Asks the browser to open the color chooser.
837 IPC_MESSAGE_ROUTED3(FrameHostMsg_OpenColorChooser
,
840 std::vector
<content::ColorSuggestion
> /* suggestions */)
842 // Asks the browser to end the color chooser.
843 IPC_MESSAGE_ROUTED1(FrameHostMsg_EndColorChooser
, int /* id */)
845 // Change the selected color in the color chooser.
846 IPC_MESSAGE_ROUTED2(FrameHostMsg_SetSelectedColorInColorChooser
,
850 // Notifies the browser that media has started/stopped playing.
851 IPC_MESSAGE_ROUTED4(FrameHostMsg_MediaPlayingNotification
,
852 int64
/* player_cookie, distinguishes instances */,
853 bool /* has_video */,
854 bool /* has_audio */,
855 bool /* is_remote */)
857 IPC_MESSAGE_ROUTED1(FrameHostMsg_MediaPausedNotification
,
858 int64
/* player_cookie, distinguishes instances */)
860 // Notify browser the theme color has been changed.
861 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidChangeThemeColor
,
862 SkColor
/* theme_color */)
864 // Response for FrameMsg_TextSurroundingSelectionRequest, |startOffset| and
865 // |endOffset| are the offsets of the selection in the returned |content|.
866 IPC_MESSAGE_ROUTED3(FrameHostMsg_TextSurroundingSelectionResponse
,
867 base::string16
, /* content */
868 size_t, /* startOffset */
869 size_t /* endOffset */)
871 // Notifies the browser that the renderer has a pending navigation transition.
872 // The string parameters are all UTF8.
873 IPC_MESSAGE_CONTROL1(FrameHostMsg_AddNavigationTransitionData
,
874 FrameHostMsg_AddNavigationTransitionData_Params
)
877 // Tells the browser to perform a navigation.
878 IPC_MESSAGE_ROUTED3(FrameHostMsg_BeginNavigation
,
879 content::CommonNavigationParams
,
880 content::BeginNavigationParams
,
881 scoped_refptr
<content::ResourceRequestBody
>)
883 // Sent once a paint happens after the first non empty layout. In other words
884 // after the frame has painted something.
885 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidFirstVisuallyNonEmptyPaint
)
887 // Sent as a response to FrameMsg_VisualStateRequest.
888 // The message is delivered using RenderWidget::QueueMessage.
889 IPC_MESSAGE_ROUTED1(FrameHostMsg_VisualStateResponse
, uint64
/* id */)
891 // Puts the browser into "tab fullscreen" mode for the sending renderer.
892 // See the comment in chrome/browser/ui/browser.h for more details.
893 IPC_MESSAGE_ROUTED1(FrameHostMsg_ToggleFullscreen
, bool /* enter_fullscreen */)
895 // Dispatch a load event for this frame in the iframe element of an
896 // out-of-process parent frame.
897 IPC_MESSAGE_ROUTED0(FrameHostMsg_DispatchLoad
)
899 // Sent to the browser from a frame proxy to post a message to the frame's
901 IPC_MESSAGE_ROUTED1(FrameHostMsg_RouteMessageEvent
,
902 FrameMsg_PostMessage_Params
)
904 #if defined(OS_MACOSX) || defined(OS_ANDROID)
906 // Message to show/hide a popup menu using native controls.
907 IPC_MESSAGE_ROUTED1(FrameHostMsg_ShowPopup
,
908 FrameHostMsg_ShowPopup_Params
)
909 IPC_MESSAGE_ROUTED0(FrameHostMsg_HidePopup
)