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(frame_to_navigate
)
274 IPC_STRUCT_TRAITS_MEMBER(request_time
)
275 IPC_STRUCT_TRAITS_MEMBER(page_state
)
276 IPC_STRUCT_TRAITS_MEMBER(page_id
)
277 IPC_STRUCT_TRAITS_MEMBER(pending_history_list_offset
)
278 IPC_STRUCT_TRAITS_MEMBER(current_history_list_offset
)
279 IPC_STRUCT_TRAITS_MEMBER(current_history_list_length
)
280 IPC_STRUCT_TRAITS_MEMBER(should_clear_history_list
)
281 IPC_STRUCT_TRAITS_END()
283 IPC_STRUCT_TRAITS_BEGIN(content::FrameReplicationState
)
284 IPC_STRUCT_TRAITS_MEMBER(origin
)
285 IPC_STRUCT_TRAITS_MEMBER(sandbox_flags
)
286 IPC_STRUCT_TRAITS_MEMBER(name
)
287 IPC_STRUCT_TRAITS_END()
289 IPC_STRUCT_BEGIN(FrameMsg_NewFrame_WidgetParams
)
290 // Gives the routing ID for the RenderWidget that will be attached to the
291 // new RenderFrame. If the RenderFrame does not need a RenderWidget, this
292 // is MSG_ROUTING_NONE and the other parameters are not read.
293 IPC_STRUCT_MEMBER(int, routing_id
)
295 // Identifier for the output surface for the new RenderWidget.
296 IPC_STRUCT_MEMBER(int, surface_id
)
298 // Tells the new RenderWidget whether it is initially hidden.
299 IPC_STRUCT_MEMBER(bool, hidden
)
302 IPC_STRUCT_BEGIN(FrameHostMsg_OpenURL_Params
)
303 IPC_STRUCT_MEMBER(GURL
, url
)
304 IPC_STRUCT_MEMBER(content::Referrer
, referrer
)
305 IPC_STRUCT_MEMBER(WindowOpenDisposition
, disposition
)
306 IPC_STRUCT_MEMBER(bool, should_replace_current_entry
)
307 IPC_STRUCT_MEMBER(bool, user_gesture
)
310 IPC_STRUCT_BEGIN(FrameMsg_TextTrackSettings_Params
)
311 // Background color of the text track.
312 IPC_STRUCT_MEMBER(std::string
, text_track_background_color
)
314 // Font family of the text track text.
315 IPC_STRUCT_MEMBER(std::string
, text_track_font_family
)
317 // Font style of the text track text.
318 IPC_STRUCT_MEMBER(std::string
, text_track_font_style
)
320 // Font variant of the text track text.
321 IPC_STRUCT_MEMBER(std::string
, text_track_font_variant
)
323 // Color of the text track text.
324 IPC_STRUCT_MEMBER(std::string
, text_track_text_color
)
326 // Text shadow (edge style) of the text track text.
327 IPC_STRUCT_MEMBER(std::string
, text_track_text_shadow
)
329 // Size of the text track text.
330 IPC_STRUCT_MEMBER(std::string
, text_track_text_size
)
333 #if defined(OS_MACOSX) || defined(OS_ANDROID)
334 // This message is used for supporting popup menus on Mac OS X and Android using
335 // native controls. See the FrameHostMsg_ShowPopup message.
336 IPC_STRUCT_BEGIN(FrameHostMsg_ShowPopup_Params
)
337 // Position on the screen.
338 IPC_STRUCT_MEMBER(gfx::Rect
, bounds
)
340 // The height of each item in the menu.
341 IPC_STRUCT_MEMBER(int, item_height
)
343 // The size of the font to use for those items.
344 IPC_STRUCT_MEMBER(double, item_font_size
)
346 // The currently selected (displayed) item in the menu.
347 IPC_STRUCT_MEMBER(int, selected_item
)
349 // The entire list of items in the popup menu.
350 IPC_STRUCT_MEMBER(std::vector
<content::MenuItem
>, popup_items
)
352 // Whether items should be right-aligned.
353 IPC_STRUCT_MEMBER(bool, right_aligned
)
355 // Whether this is a multi-select popup.
356 IPC_STRUCT_MEMBER(bool, allow_multiple_selection
)
360 // -----------------------------------------------------------------------------
361 // Messages sent from the browser to the renderer.
363 // Notifies the embedding frame that a new CompositorFrame is ready to be
364 // presented. When the frame finishes presenting, a matching
365 // FrameHostMsg_CompositorFrameSwappedACK should be sent back to the
366 // RenderViewHost that was produced the CompositorFrame.
368 // This is used in the ubercomp compositing path.
369 IPC_MESSAGE_ROUTED1(FrameMsg_CompositorFrameSwapped
,
370 FrameMsg_CompositorFrameSwapped_Params
/* params */)
372 // Notifies the embedding frame that the process rendering the child frame's
373 // contents has terminated.
374 IPC_MESSAGE_ROUTED0(FrameMsg_ChildFrameProcessGone
)
376 // Sent in response to a FrameHostMsg_ContextMenu to let the renderer know that
377 // the menu has been closed.
378 IPC_MESSAGE_ROUTED1(FrameMsg_ContextMenuClosed
,
379 content::CustomContextMenuContext
/* custom_context */)
381 // Executes custom context menu action that was provided from Blink.
382 IPC_MESSAGE_ROUTED2(FrameMsg_CustomContextMenuAction
,
383 content::CustomContextMenuContext
/* custom_context */,
384 unsigned /* action */)
386 // Requests that the RenderFrame or RenderFrameProxy sets its opener to null.
387 IPC_MESSAGE_ROUTED0(FrameMsg_DisownOpener
)
389 // Requests that the RenderFrame send back a response after waiting for the
390 // commit, activation and frame swap of the current DOM tree in blink.
391 IPC_MESSAGE_ROUTED1(FrameMsg_VisualStateRequest
, uint64
/* id */)
393 // Instructs the renderer to create a new RenderFrame object with |routing_id|.
394 // The new frame should be created as a child of the object identified by
395 // |parent_routing_id| or as top level if that is MSG_ROUTING_NONE.
396 // If a valid |proxy_routing_id| is provided, the new frame will be configured
397 // to replace the proxy on commit. When the new frame has a parent,
398 // |replication_state| holds properties replicated from the process rendering
399 // the parent frame, such as the new frame's sandbox flags.
400 IPC_MESSAGE_CONTROL5(FrameMsg_NewFrame
,
401 int /* routing_id */,
402 int /* parent_routing_id */,
403 int /* proxy_routing_id */,
404 content::FrameReplicationState
/* replication_state */,
405 FrameMsg_NewFrame_WidgetParams
/* widget_params */)
407 // Instructs the renderer to create a new RenderFrameProxy object with
408 // |routing_id|. The new proxy should be created as a child of the object
409 // identified by |parent_routing_id| or as top level if that is
411 IPC_MESSAGE_CONTROL4(FrameMsg_NewFrameProxy
,
412 int /* routing_id */,
413 int /* parent_routing_id */,
414 int /* render_view_routing_id */,
415 content::FrameReplicationState
/* replication_state */)
417 // Tells the renderer to perform the specified navigation, interrupting any
418 // existing navigation.
419 IPC_MESSAGE_ROUTED3(FrameMsg_Navigate
,
420 content::CommonNavigationParams
, /* common_params */
421 content::StartNavigationParams
, /* start_params */
422 content::RequestNavigationParams
/* request_params */)
424 // Instructs the renderer to invoke the frame's beforeunload event handler.
425 // Expects the result to be returned via FrameHostMsg_BeforeUnload_ACK.
426 IPC_MESSAGE_ROUTED0(FrameMsg_BeforeUnload
)
428 // Instructs the frame to swap out for a cross-site transition, including
429 // running the unload event handler and creating a RenderFrameProxy with the
430 // given |proxy_routing_id|. Expects a SwapOut_ACK message when finished.
431 IPC_MESSAGE_ROUTED3(FrameMsg_SwapOut
,
432 int /* proxy_routing_id */,
433 bool /* is_loading */,
434 content::FrameReplicationState
/* replication_state */)
436 // Instructs the frame to stop the load in progress, if any.
437 IPC_MESSAGE_ROUTED0(FrameMsg_Stop
)
439 // A message sent to RenderFrameProxy to indicate that its corresponding
440 // RenderFrame has started loading a document.
441 IPC_MESSAGE_ROUTED0(FrameMsg_DidStartLoading
)
443 // A message sent to RenderFrameProxy to indicate that its corresponding
444 // RenderFrame has completed loading.
445 IPC_MESSAGE_ROUTED0(FrameMsg_DidStopLoading
)
447 // Request for the renderer to insert CSS into the frame.
448 IPC_MESSAGE_ROUTED1(FrameMsg_CSSInsertRequest
,
449 std::string
/* css */)
451 // Request for the renderer to execute JavaScript in the frame's context.
453 // javascript is the string containing the JavaScript to be executed in the
454 // target frame's context.
456 // If the third parameter is true the result is sent back to the browser using
457 // the message FrameHostMsg_JavaScriptExecuteResponse.
458 // FrameHostMsg_JavaScriptExecuteResponse is passed the ID parameter so that the
459 // host can uniquely identify the request.
460 IPC_MESSAGE_ROUTED3(FrameMsg_JavaScriptExecuteRequest
,
461 base::string16
, /* javascript */
463 bool /* if true, a reply is requested */)
465 // ONLY FOR TESTS: Same as above but adds a fake UserGestureindicator around
466 // execution. (crbug.com/408426)
467 IPC_MESSAGE_ROUTED3(FrameMsg_JavaScriptExecuteRequestForTests
,
468 base::string16
, /* javascript */
470 bool /* if true, a reply is requested */)
472 // Selects between the given start and end offsets in the currently focused
474 IPC_MESSAGE_ROUTED2(FrameMsg_SetEditableSelectionOffsets
,
478 // Requests a navigation to the supplied markup, in an iframe with sandbox
480 IPC_MESSAGE_ROUTED1(FrameMsg_SetupTransitionView
,
481 std::string
/* markup */)
483 // Tells the renderer to hide the elements specified by the supplied CSS
484 // selector, and activates any exiting-transition stylesheets.
485 IPC_MESSAGE_ROUTED2(FrameMsg_BeginExitTransition
,
486 std::string
/* css_selector */,
487 bool /* exit_to_native_app */)
489 // Tell the renderer to revert the exit transition done before
490 IPC_MESSAGE_ROUTED0(FrameMsg_RevertExitTransition
)
492 // Tell the renderer to hide transition elements.
493 IPC_MESSAGE_ROUTED1(FrameMsg_HideTransitionElements
,
494 std::string
/* css_selector */)
496 // Tell the renderer to hide transition elements.
497 IPC_MESSAGE_ROUTED1(FrameMsg_ShowTransitionElements
,
498 std::string
/* css_selector */)
500 // Tells the renderer to reload the frame, optionally ignoring the cache while
502 IPC_MESSAGE_ROUTED1(FrameMsg_Reload
,
503 bool /* ignore_cache */)
505 // Notifies the color chooser client that the user selected a color.
506 IPC_MESSAGE_ROUTED2(FrameMsg_DidChooseColorResponse
, unsigned, SkColor
)
508 // Notifies the color chooser client that the color chooser has ended.
509 IPC_MESSAGE_ROUTED1(FrameMsg_DidEndColorChooser
, unsigned)
511 // Notifies the corresponding RenderFrameProxy object to replace itself with the
512 // RenderFrame object it is associated with.
513 IPC_MESSAGE_ROUTED0(FrameMsg_DeleteProxy
)
515 // Request the text surrounding the selection with a |max_length|. The response
516 // will be sent via FrameHostMsg_TextSurroundingSelectionResponse.
517 IPC_MESSAGE_ROUTED1(FrameMsg_TextSurroundingSelectionRequest
,
518 size_t /* max_length */)
520 // Tells the renderer to insert a link to the specified stylesheet. This is
521 // needed to support navigation transitions.
522 IPC_MESSAGE_ROUTED1(FrameMsg_AddStyleSheetByURL
, std::string
)
524 // Change the accessibility mode in the renderer process.
525 IPC_MESSAGE_ROUTED1(FrameMsg_SetAccessibilityMode
,
528 // Dispatch a load event in the iframe element containing this frame.
529 IPC_MESSAGE_ROUTED0(FrameMsg_DispatchLoad
)
531 // Notifies the frame that its parent has changed the frame's sandbox flags.
532 IPC_MESSAGE_ROUTED1(FrameMsg_DidUpdateSandboxFlags
, content::SandboxFlags
)
534 // Update a proxy's window.name property. Used when the frame's name is
535 // changed in another process.
536 IPC_MESSAGE_ROUTED1(FrameMsg_DidUpdateName
, std::string
/* name */)
538 // Send to the RenderFrame to set text track style settings.
539 // Sent for top-level frames.
540 IPC_MESSAGE_ROUTED1(FrameMsg_SetTextTrackSettings
,
541 FrameMsg_TextTrackSettings_Params
/* params */)
543 // Posts a message from a frame in another process to the current renderer.
544 IPC_MESSAGE_ROUTED1(FrameMsg_PostMessageEvent
, FrameMsg_PostMessage_Params
)
546 #if defined(OS_ANDROID)
548 // External popup menus.
549 IPC_MESSAGE_ROUTED2(FrameMsg_SelectPopupMenuItems
,
550 bool /* user canceled the popup */,
551 std::vector
<int> /* selected indices */)
553 #elif defined(OS_MACOSX)
555 // External popup menus.
556 IPC_MESSAGE_ROUTED1(FrameMsg_SelectPopupMenuItem
,
557 int /* selected index, -1 means no selection */)
562 // Tells the renderer that a navigation is ready to commit. The renderer should
563 // request |stream_url| to get access to the stream containing the body of the
565 IPC_MESSAGE_ROUTED4(FrameMsg_CommitNavigation
,
566 content::ResourceResponseHead
, /* response */
567 GURL
, /* stream_url */
568 content::CommonNavigationParams
, /* common_params */
569 content::RequestNavigationParams
/* request_params */)
572 // Tells the renderer that a navigation failed with the error code |error_code|
573 // and that the renderer should display an appropriate error page.
574 IPC_MESSAGE_ROUTED4(FrameMsg_FailedNavigation
,
575 content::CommonNavigationParams
, /* common_params */
576 content::RequestNavigationParams
, /* request_params */
577 bool, /* stale_copy_in_cache */
578 int /* error_code */)
580 #if defined(ENABLE_PLUGINS)
581 // Notifies the renderer of updates to the Plugin Power Saver origin whitelist.
582 IPC_MESSAGE_ROUTED1(FrameMsg_UpdatePluginContentOriginWhitelist
,
583 std::set
<GURL
> /* origin_whitelist */)
584 #endif // defined(ENABLE_PLUGINS)
586 // -----------------------------------------------------------------------------
587 // Messages sent from the renderer to the browser.
589 // Blink and JavaScript error messages to log to the console
591 IPC_MESSAGE_ROUTED4(FrameHostMsg_AddMessageToConsole
,
592 int32
, /* log level */
593 base::string16
, /* msg */
594 int32
, /* line number */
595 base::string16
/* source id */ )
597 // Sent by the renderer when a child frame is created in the renderer.
599 // Each of these messages will have a corresponding FrameHostMsg_Detach message
600 // sent when the frame is detached from the DOM.
601 IPC_SYNC_MESSAGE_CONTROL3_1(FrameHostMsg_CreateChildFrame
,
602 int32
/* parent_routing_id */,
603 std::string
/* frame_name */,
604 content::SandboxFlags
/* sandbox flags */,
605 int32
/* new_routing_id */)
607 // Sent by the renderer to the parent RenderFrameHost when a child frame is
608 // detached from the DOM.
609 IPC_MESSAGE_ROUTED0(FrameHostMsg_Detach
)
611 // Indicates the renderer process is gone. This actually is sent by the
612 // browser process to itself, but keeps the interface cleaner.
613 IPC_MESSAGE_ROUTED2(FrameHostMsg_RenderProcessGone
,
614 int, /* this really is base::TerminationStatus */
617 // Sent by the renderer when the frame becomes focused.
618 IPC_MESSAGE_ROUTED0(FrameHostMsg_FrameFocused
)
620 // Sent when the renderer starts a provisional load for a frame.
621 // |is_transition_navigation| signals that the frame has defined transition
622 // elements which can be animated by the navigation destination to provide
623 // a transition effect during load.
624 IPC_MESSAGE_ROUTED2(FrameHostMsg_DidStartProvisionalLoadForFrame
,
626 bool /* is_transition_navigation */)
628 // Sent when the renderer fails a provisional load with an error.
629 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidFailProvisionalLoadWithError
,
630 FrameHostMsg_DidFailProvisionalLoadWithError_Params
)
632 // Notifies the browser that a frame in the view has changed. This message
633 // has a lot of parameters and is packed/unpacked by functions defined in
634 // render_messages.h.
635 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidCommitProvisionalLoad
,
636 FrameHostMsg_DidCommitProvisionalLoad_Params
)
638 // Notifies the browser that a document has been loaded.
639 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidFinishDocumentLoad
)
641 IPC_MESSAGE_ROUTED3(FrameHostMsg_DidFailLoadWithError
,
642 GURL
/* validated_url */,
643 int /* error_code */,
644 base::string16
/* error_description */)
646 // Sent when the renderer decides to ignore a navigation.
647 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidDropNavigation
)
649 // Sent when the renderer starts loading the page. |to_different_document| will
650 // be true unless the load is a fragment navigation, or triggered by
651 // history.pushState/replaceState.
652 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidStartLoading
,
653 bool /* to_different_document */)
655 // Sent when the renderer is done loading a page.
656 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidStopLoading
)
658 // Sent when the frame changes its window.name.
659 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidChangeName
, std::string
/* name */)
661 // Sent when the renderer changed the progress of a load.
662 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidChangeLoadProgress
,
663 double /* load_progress */)
665 // Requests that the given URL be opened in the specified manner.
666 IPC_MESSAGE_ROUTED1(FrameHostMsg_OpenURL
, FrameHostMsg_OpenURL_Params
)
668 // Notifies the browser that a frame finished loading.
669 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidFinishLoad
,
670 GURL
/* validated_url */)
672 // Sent when after the onload handler has been invoked for the document
673 // in this frame. Sent for top-level frames. |report_type| and |ui_timestamp|
674 // are used to report navigation metrics starting on the ui input event that
675 // triggered the navigation timestamp.
676 IPC_MESSAGE_ROUTED2(FrameHostMsg_DocumentOnLoadCompleted
,
677 FrameMsg_UILoadMetricsReportType::Value
/* report_type */,
678 base::TimeTicks
/* ui_timestamp */)
680 // Notifies that the initial empty document of a view has been accessed.
681 // After this, it is no longer safe to show a pending navigation's URL without
682 // making a URL spoof possible.
683 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidAccessInitialDocument
)
685 // Sent when the frame sets its opener to null, disowning it for the lifetime of
686 // the window. Sent for top-level frames.
687 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidDisownOpener
)
689 // Notifies the browser that a page id was assigned.
690 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidAssignPageId
,
693 // Notifies the browser that sandbox flags have changed for a subframe of this
695 IPC_MESSAGE_ROUTED2(FrameHostMsg_DidChangeSandboxFlags
,
696 int32
/* subframe_routing_id */,
697 content::SandboxFlags
/* updated_flags */)
699 // Changes the title for the page in the UI when the page is navigated or the
700 // title changes. Sent for top-level frames.
701 IPC_MESSAGE_ROUTED2(FrameHostMsg_UpdateTitle
,
702 base::string16
/* title */,
703 blink::WebTextDirection
/* title direction */)
705 // Change the encoding name of the page in UI when the page has detected
706 // proper encoding name. Sent for top-level frames.
707 IPC_MESSAGE_ROUTED1(FrameHostMsg_UpdateEncoding
,
708 std::string
/* new encoding name */)
710 // Following message is used to communicate the values received by the
711 // callback binding the JS to Cpp.
712 // An instance of browser that has an automation host listening to it can
713 // have a javascript send a native value (string, number, boolean) to the
714 // listener in Cpp. (DomAutomationController)
715 IPC_MESSAGE_ROUTED2(FrameHostMsg_DomOperationResponse
,
716 std::string
/* json_string */,
717 int /* automation_id */)
719 #if defined(ENABLE_PLUGINS)
720 // Sent to the browser when the renderer detects it is blocked on a pepper
721 // plugin message for too long. This is also sent when it becomes unhung
722 // (according to the value of is_hung). The browser can give the user the
723 // option of killing the plugin.
724 IPC_MESSAGE_ROUTED3(FrameHostMsg_PepperPluginHung
,
725 int /* plugin_child_id */,
726 base::FilePath
/* path */,
729 // Sent by the renderer process to indicate that a plugin instance has crashed.
730 // Note: |plugin_pid| should not be trusted. The corresponding process has
731 // probably died. Moreover, the ID may have been reused by a new process. Any
732 // usage other than displaying it in a prompt to the user is very likely to be
734 IPC_MESSAGE_ROUTED2(FrameHostMsg_PluginCrashed
,
735 base::FilePath
/* plugin_path */,
736 base::ProcessId
/* plugin_pid */)
738 // Return information about a plugin for the given URL and MIME
739 // type. If there is no matching plugin, |found| is false.
740 // |actual_mime_type| is the actual mime type supported by the
742 IPC_SYNC_MESSAGE_CONTROL4_3(FrameHostMsg_GetPluginInfo
,
743 int /* render_frame_id */,
746 std::string
/* mime_type */,
748 content::WebPluginInfo
/* plugin info */,
749 std::string
/* actual_mime_type */)
751 // A renderer sends this to the browser process when it wants to temporarily
752 // whitelist an origin's plugin content as essential. This temporary whitelist
753 // is specific to a top level frame, and is cleared when the whitelisting
754 // RenderFrame is destroyed.
755 IPC_MESSAGE_ROUTED1(FrameHostMsg_PluginContentOriginAllowed
,
756 GURL
/* content_origin */)
757 #endif // defined(ENABLE_PLUGINS)
759 // A renderer sends this to the browser process when it wants to
760 // create a plugin. The browser will create the plugin process if
761 // necessary, and will return a handle to the channel on success.
762 // On error an empty string is returned.
763 IPC_SYNC_MESSAGE_CONTROL4_2(FrameHostMsg_OpenChannelToPlugin
,
764 int /* render_frame_id */,
767 std::string
/* mime_type */,
768 IPC::ChannelHandle
/* channel_handle */,
769 content::WebPluginInfo
/* info */)
771 // Acknowledge that we presented an ubercomp frame.
773 // See FrameMsg_CompositorFrameSwapped
774 IPC_MESSAGE_ROUTED1(FrameHostMsg_CompositorFrameSwappedACK
,
775 FrameHostMsg_CompositorFrameSwappedACK_Params
/* params */)
777 // Provides the result from handling BeforeUnload. |proceed| matches the return
778 // value of the frame's beforeunload handler: true if the user decided to
779 // proceed with leaving the page.
780 IPC_MESSAGE_ROUTED3(FrameHostMsg_BeforeUnload_ACK
,
782 base::TimeTicks
/* before_unload_start_time */,
783 base::TimeTicks
/* before_unload_end_time */)
785 // Indicates that the current frame has swapped out, after a SwapOut message.
786 IPC_MESSAGE_ROUTED0(FrameHostMsg_SwapOut_ACK
)
788 IPC_MESSAGE_ROUTED1(FrameHostMsg_ReclaimCompositorResources
,
789 FrameHostMsg_ReclaimCompositorResources_Params
/* params */)
791 // Forwards an input event to a child.
792 // TODO(nick): Temporary bridge, revisit once the browser process can route
793 // input directly to subframes. http://crbug.com/339659
794 IPC_MESSAGE_ROUTED1(FrameHostMsg_ForwardInputEvent
,
795 IPC::WebInputEventPointer
/* event */)
797 // Used to tell the parent that the user right clicked on an area of the
798 // content area, and a context menu should be shown for it. The params
799 // object contains information about the node(s) that were selected when the
800 // user right clicked.
801 IPC_MESSAGE_ROUTED1(FrameHostMsg_ContextMenu
, content::ContextMenuParams
)
803 // Initial drawing parameters for a child frame that has been swapped out to
805 IPC_MESSAGE_ROUTED2(FrameHostMsg_InitializeChildFrame
,
806 gfx::Rect
/* frame_rect */,
807 float /* scale_factor */)
809 // Response for FrameMsg_JavaScriptExecuteRequest, sent when a reply was
810 // requested. The ID is the parameter supplied to
811 // FrameMsg_JavaScriptExecuteRequest. The result has the value returned by the
812 // script as its only element, one of Null, Boolean, Integer, Real, Date, or
814 IPC_MESSAGE_ROUTED2(FrameHostMsg_JavaScriptExecuteResponse
,
816 base::ListValue
/* result */)
818 // A request to run a JavaScript dialog.
819 IPC_SYNC_MESSAGE_ROUTED4_2(FrameHostMsg_RunJavaScriptMessage
,
820 base::string16
/* in - alert message */,
821 base::string16
/* in - default prompt */,
822 GURL
/* in - originating page URL */,
823 content::JavaScriptMessageType
/* in - type */,
824 bool /* out - success */,
825 base::string16
/* out - user_input field */)
827 // Displays a dialog to confirm that the user wants to navigate away from the
828 // page. Replies true if yes, and false otherwise. The reply string is ignored,
829 // but is included so that we can use OnJavaScriptMessageBoxClosed.
830 IPC_SYNC_MESSAGE_ROUTED3_2(FrameHostMsg_RunBeforeUnloadConfirm
,
831 GURL
, /* in - originating frame URL */
832 base::string16
/* in - alert message */,
833 bool /* in - is a reload */,
834 bool /* out - success */,
835 base::string16
/* out - This is ignored.*/)
837 // Asks the browser to open the color chooser.
838 IPC_MESSAGE_ROUTED3(FrameHostMsg_OpenColorChooser
,
841 std::vector
<content::ColorSuggestion
> /* suggestions */)
843 // Asks the browser to end the color chooser.
844 IPC_MESSAGE_ROUTED1(FrameHostMsg_EndColorChooser
, int /* id */)
846 // Change the selected color in the color chooser.
847 IPC_MESSAGE_ROUTED2(FrameHostMsg_SetSelectedColorInColorChooser
,
851 // Notifies the browser that media has started/stopped playing.
852 IPC_MESSAGE_ROUTED4(FrameHostMsg_MediaPlayingNotification
,
853 int64
/* player_cookie, distinguishes instances */,
854 bool /* has_video */,
855 bool /* has_audio */,
856 bool /* is_remote */)
858 IPC_MESSAGE_ROUTED1(FrameHostMsg_MediaPausedNotification
,
859 int64
/* player_cookie, distinguishes instances */)
861 // Notify browser the theme color has been changed.
862 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidChangeThemeColor
,
863 SkColor
/* theme_color */)
865 // Response for FrameMsg_TextSurroundingSelectionRequest, |startOffset| and
866 // |endOffset| are the offsets of the selection in the returned |content|.
867 IPC_MESSAGE_ROUTED3(FrameHostMsg_TextSurroundingSelectionResponse
,
868 base::string16
, /* content */
869 size_t, /* startOffset */
870 size_t /* endOffset */)
872 // Notifies the browser that the renderer has a pending navigation transition.
873 // The string parameters are all UTF8.
874 IPC_MESSAGE_CONTROL1(FrameHostMsg_AddNavigationTransitionData
,
875 FrameHostMsg_AddNavigationTransitionData_Params
)
878 // Tells the browser to perform a navigation.
879 IPC_MESSAGE_ROUTED3(FrameHostMsg_BeginNavigation
,
880 content::CommonNavigationParams
,
881 content::BeginNavigationParams
,
882 scoped_refptr
<content::ResourceRequestBody
>)
884 // Sent once a paint happens after the first non empty layout. In other words
885 // after the frame has painted something.
886 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidFirstVisuallyNonEmptyPaint
)
888 // Sent as a response to FrameMsg_VisualStateRequest.
889 // The message is delivered using RenderWidget::QueueMessage.
890 IPC_MESSAGE_ROUTED1(FrameHostMsg_VisualStateResponse
, uint64
/* id */)
892 // Puts the browser into "tab fullscreen" mode for the sending renderer.
893 // See the comment in chrome/browser/ui/browser.h for more details.
894 IPC_MESSAGE_ROUTED1(FrameHostMsg_ToggleFullscreen
, bool /* enter_fullscreen */)
896 // Dispatch a load event for this frame in the iframe element of an
897 // out-of-process parent frame.
898 IPC_MESSAGE_ROUTED0(FrameHostMsg_DispatchLoad
)
900 // Sent to the browser from a frame proxy to post a message to the frame's
902 IPC_MESSAGE_ROUTED1(FrameHostMsg_RouteMessageEvent
,
903 FrameMsg_PostMessage_Params
)
905 #if defined(OS_MACOSX) || defined(OS_ANDROID)
907 // Message to show/hide a popup menu using native controls.
908 IPC_MESSAGE_ROUTED1(FrameHostMsg_ShowPopup
,
909 FrameHostMsg_ShowPopup_Params
)
910 IPC_MESSAGE_ROUTED0(FrameHostMsg_HidePopup
)