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/page_state.h"
22 #include "content/public/common/resource_response.h"
23 #include "content/public/common/transition_element.h"
24 #include "ipc/ipc_message_macros.h"
25 #include "ui/gfx/ipc/gfx_param_traits.h"
27 #include "url/origin.h"
29 #undef IPC_MESSAGE_EXPORT
30 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT
32 #define IPC_MESSAGE_START FrameMsgStart
34 IPC_ENUM_TRAITS_MIN_MAX_VALUE(AccessibilityMode
,
36 AccessibilityModeComplete
)
37 IPC_ENUM_TRAITS_MIN_MAX_VALUE(content::JavaScriptMessageType
,
38 content::JAVASCRIPT_MESSAGE_TYPE_ALERT
,
39 content::JAVASCRIPT_MESSAGE_TYPE_PROMPT
)
40 IPC_ENUM_TRAITS_MAX_VALUE(FrameMsg_Navigate_Type::Value
,
41 FrameMsg_Navigate_Type::NAVIGATE_TYPE_LAST
)
42 IPC_ENUM_TRAITS_MAX_VALUE(FrameMsg_UILoadMetricsReportType::Value
,
43 FrameMsg_UILoadMetricsReportType::REPORT_TYPE_LAST
)
44 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebContextMenuData::MediaType
,
45 blink::WebContextMenuData::MediaTypeLast
)
46 IPC_ENUM_TRAITS_MAX_VALUE(ui::MenuSourceType
, ui::MENU_SOURCE_TYPE_LAST
)
47 IPC_ENUM_TRAITS(content::SandboxFlags
) // Bitmask.
49 IPC_STRUCT_TRAITS_BEGIN(content::ColorSuggestion
)
50 IPC_STRUCT_TRAITS_MEMBER(color
)
51 IPC_STRUCT_TRAITS_MEMBER(label
)
52 IPC_STRUCT_TRAITS_END()
54 IPC_STRUCT_TRAITS_BEGIN(content::ContextMenuParams
)
55 IPC_STRUCT_TRAITS_MEMBER(media_type
)
56 IPC_STRUCT_TRAITS_MEMBER(x
)
57 IPC_STRUCT_TRAITS_MEMBER(y
)
58 IPC_STRUCT_TRAITS_MEMBER(link_url
)
59 IPC_STRUCT_TRAITS_MEMBER(link_text
)
60 IPC_STRUCT_TRAITS_MEMBER(unfiltered_link_url
)
61 IPC_STRUCT_TRAITS_MEMBER(src_url
)
62 IPC_STRUCT_TRAITS_MEMBER(has_image_contents
)
63 IPC_STRUCT_TRAITS_MEMBER(page_url
)
64 IPC_STRUCT_TRAITS_MEMBER(keyword_url
)
65 IPC_STRUCT_TRAITS_MEMBER(frame_url
)
66 IPC_STRUCT_TRAITS_MEMBER(frame_page_state
)
67 IPC_STRUCT_TRAITS_MEMBER(media_flags
)
68 IPC_STRUCT_TRAITS_MEMBER(selection_text
)
69 IPC_STRUCT_TRAITS_MEMBER(suggested_filename
)
70 IPC_STRUCT_TRAITS_MEMBER(misspelled_word
)
71 IPC_STRUCT_TRAITS_MEMBER(dictionary_suggestions
)
72 IPC_STRUCT_TRAITS_MEMBER(spellcheck_enabled
)
73 IPC_STRUCT_TRAITS_MEMBER(is_editable
)
74 IPC_STRUCT_TRAITS_MEMBER(writing_direction_default
)
75 IPC_STRUCT_TRAITS_MEMBER(writing_direction_left_to_right
)
76 IPC_STRUCT_TRAITS_MEMBER(writing_direction_right_to_left
)
77 IPC_STRUCT_TRAITS_MEMBER(edit_flags
)
78 IPC_STRUCT_TRAITS_MEMBER(security_info
)
79 IPC_STRUCT_TRAITS_MEMBER(frame_charset
)
80 IPC_STRUCT_TRAITS_MEMBER(referrer_policy
)
81 IPC_STRUCT_TRAITS_MEMBER(custom_context
)
82 IPC_STRUCT_TRAITS_MEMBER(custom_items
)
83 IPC_STRUCT_TRAITS_MEMBER(source_type
)
84 #if defined(OS_ANDROID)
85 IPC_STRUCT_TRAITS_MEMBER(selection_start
)
86 IPC_STRUCT_TRAITS_MEMBER(selection_end
)
88 IPC_STRUCT_TRAITS_END()
90 IPC_STRUCT_TRAITS_BEGIN(content::CustomContextMenuContext
)
91 IPC_STRUCT_TRAITS_MEMBER(is_pepper_menu
)
92 IPC_STRUCT_TRAITS_MEMBER(request_id
)
93 IPC_STRUCT_TRAITS_MEMBER(render_widget_id
)
94 IPC_STRUCT_TRAITS_MEMBER(link_followed
)
95 IPC_STRUCT_TRAITS_END()
97 IPC_STRUCT_TRAITS_BEGIN(content::TransitionElement
)
98 IPC_STRUCT_TRAITS_MEMBER(id
)
99 IPC_STRUCT_TRAITS_MEMBER(rect
)
100 IPC_STRUCT_TRAITS_END()
102 IPC_STRUCT_BEGIN(FrameHostMsg_AddNavigationTransitionData_Params
)
103 IPC_STRUCT_MEMBER(int, render_frame_id
)
104 IPC_STRUCT_MEMBER(std::string
, allowed_destination_host_pattern
)
105 IPC_STRUCT_MEMBER(std::string
, selector
)
106 IPC_STRUCT_MEMBER(std::string
, markup
)
107 IPC_STRUCT_MEMBER(std::vector
<content::TransitionElement
>, elements
)
110 IPC_STRUCT_BEGIN(FrameHostMsg_DidFailProvisionalLoadWithError_Params
)
111 // Error code as reported in the DidFailProvisionalLoad callback.
112 IPC_STRUCT_MEMBER(int, error_code
)
113 // An error message generated from the error_code. This can be an empty
114 // string if we were unable to find a meaningful description.
115 IPC_STRUCT_MEMBER(base::string16
, error_description
)
116 // The URL that the error is reported for.
117 IPC_STRUCT_MEMBER(GURL
, url
)
118 // True if the failure is the result of navigating to a POST again
119 // and we're going to show the POST interstitial.
120 IPC_STRUCT_MEMBER(bool, showing_repost_interstitial
)
123 IPC_STRUCT_TRAITS_BEGIN(content::FrameNavigateParams
)
124 IPC_STRUCT_TRAITS_MEMBER(page_id
)
125 IPC_STRUCT_TRAITS_MEMBER(url
)
126 IPC_STRUCT_TRAITS_MEMBER(base_url
)
127 IPC_STRUCT_TRAITS_MEMBER(referrer
)
128 IPC_STRUCT_TRAITS_MEMBER(transition
)
129 IPC_STRUCT_TRAITS_MEMBER(redirects
)
130 IPC_STRUCT_TRAITS_MEMBER(should_update_history
)
131 IPC_STRUCT_TRAITS_MEMBER(searchable_form_url
)
132 IPC_STRUCT_TRAITS_MEMBER(searchable_form_encoding
)
133 IPC_STRUCT_TRAITS_MEMBER(contents_mime_type
)
134 IPC_STRUCT_TRAITS_MEMBER(socket_address
)
135 IPC_STRUCT_TRAITS_END()
137 // Parameters structure for FrameHostMsg_DidCommitProvisionalLoad, which has
138 // too many data parameters to be reasonably put in a predefined IPC message.
139 IPC_STRUCT_BEGIN_WITH_PARENT(FrameHostMsg_DidCommitProvisionalLoad_Params
,
140 content::FrameNavigateParams
)
141 IPC_STRUCT_TRAITS_PARENT(content::FrameNavigateParams
)
143 // Information regarding the security of the connection (empty if the
144 // connection was not secure).
145 IPC_STRUCT_MEMBER(std::string
, security_info
)
147 // The gesture that initiated this navigation.
148 IPC_STRUCT_MEMBER(content::NavigationGesture
, gesture
)
150 // True if this was a post request.
151 IPC_STRUCT_MEMBER(bool, is_post
)
153 // The POST body identifier. -1 if it doesn't exist.
154 IPC_STRUCT_MEMBER(int64
, post_id
)
156 // Whether the frame navigation resulted in no change to the documents within
157 // the page. For example, the navigation may have just resulted in scrolling
158 // to a named anchor.
159 IPC_STRUCT_MEMBER(bool, was_within_same_page
)
161 // The status code of the HTTP request.
162 IPC_STRUCT_MEMBER(int, http_status_code
)
164 // This flag is used to warn if the renderer is displaying an error page,
165 // so that we can set the appropriate page type.
166 IPC_STRUCT_MEMBER(bool, url_is_unreachable
)
168 // True if the connection was proxied. In this case, socket_address
169 // will represent the address of the proxy, rather than the remote host.
170 IPC_STRUCT_MEMBER(bool, was_fetched_via_proxy
)
172 // Serialized history item state to store in the navigation entry.
173 IPC_STRUCT_MEMBER(content::PageState
, page_state
)
175 // Original request's URL.
176 IPC_STRUCT_MEMBER(GURL
, original_request_url
)
178 // User agent override used to navigate.
179 IPC_STRUCT_MEMBER(bool, is_overriding_user_agent
)
181 // Notifies the browser that for this navigation, the session history was
182 // successfully cleared.
183 IPC_STRUCT_MEMBER(bool, history_list_was_cleared
)
185 // The routing_id of the render view associated with the navigation.
186 // We need to track the RenderViewHost routing_id because of downstream
187 // dependencies (crbug.com/392171 DownloadRequestHandle, SaveFileManager,
188 // ResourceDispatcherHostImpl, MediaStreamUIProxy,
189 // SpeechRecognitionDispatcherHost and possibly others). They look up the view
190 // based on the ID stored in the resource requests. Once those dependencies
191 // are unwound or moved to RenderFrameHost (crbug.com/304341) we can move the
192 // client to be based on the routing_id of the RenderFrameHost.
193 IPC_STRUCT_MEMBER(int, render_view_routing_id
)
195 // Origin of the frame. This will be replicated to any associated
196 // RenderFrameProxies.
197 IPC_STRUCT_MEMBER(url::Origin
, origin
)
199 // How navigation metrics starting on UI action for this load should be
201 IPC_STRUCT_MEMBER(FrameMsg_UILoadMetricsReportType::Value
, report_type
)
203 // Timestamp at which the UI action that triggered the navigation originated.
204 IPC_STRUCT_MEMBER(base::TimeTicks
, ui_timestamp
)
207 IPC_STRUCT_TRAITS_BEGIN(content::CommonNavigationParams
)
208 IPC_STRUCT_TRAITS_MEMBER(url
)
209 IPC_STRUCT_TRAITS_MEMBER(referrer
)
210 IPC_STRUCT_TRAITS_MEMBER(transition
)
211 IPC_STRUCT_TRAITS_MEMBER(navigation_type
)
212 IPC_STRUCT_TRAITS_MEMBER(allow_download
)
213 IPC_STRUCT_TRAITS_MEMBER(ui_timestamp
)
214 IPC_STRUCT_TRAITS_MEMBER(report_type
)
215 IPC_STRUCT_TRAITS_END()
217 IPC_STRUCT_TRAITS_BEGIN(content::BeginNavigationParams
)
218 IPC_STRUCT_TRAITS_MEMBER(method
)
219 IPC_STRUCT_TRAITS_MEMBER(headers
)
220 IPC_STRUCT_TRAITS_MEMBER(load_flags
)
221 IPC_STRUCT_TRAITS_MEMBER(has_user_gesture
)
222 IPC_STRUCT_TRAITS_END()
224 IPC_STRUCT_TRAITS_BEGIN(content::CommitNavigationParams
)
225 IPC_STRUCT_TRAITS_MEMBER(page_state
)
226 IPC_STRUCT_TRAITS_MEMBER(is_overriding_user_agent
)
227 IPC_STRUCT_TRAITS_MEMBER(browser_navigation_start
)
228 IPC_STRUCT_TRAITS_END()
230 IPC_STRUCT_TRAITS_BEGIN(content::FrameReplicationState
)
231 IPC_STRUCT_TRAITS_MEMBER(origin
)
232 IPC_STRUCT_TRAITS_MEMBER(sandbox_flags
)
233 IPC_STRUCT_TRAITS_MEMBER(name
)
234 IPC_STRUCT_TRAITS_END()
236 IPC_STRUCT_BEGIN(FrameMsg_NewFrame_WidgetParams
)
237 // Gives the routing ID for the RenderWidget that will be attached to the
238 // new RenderFrame. If the RenderFrame does not need a RenderWidget, this
239 // is MSG_ROUTING_NONE and the other parameters are not read.
240 IPC_STRUCT_MEMBER(int, routing_id
)
242 // Identifier for the output surface for the new RenderWidget.
243 IPC_STRUCT_MEMBER(int, surface_id
)
245 // Tells the new RenderWidget whether it is initially hidden.
246 IPC_STRUCT_MEMBER(bool, hidden
)
249 IPC_STRUCT_BEGIN(FrameMsg_Navigate_Params
)
250 // TODO(clamy): investigate which parameters are also needed in PlzNavigate
251 // and move them to the appropriate NavigationParams struct.
253 // These structs contain parameters shared by other navigation IPCs.
254 IPC_STRUCT_MEMBER(content::CommonNavigationParams
, common_params
)
255 IPC_STRUCT_MEMBER(content::CommitNavigationParams
, commit_params
)
257 // Whether the navigation is a POST request (as opposed to a GET).
258 IPC_STRUCT_MEMBER(bool, is_post
)
260 // Extra headers (separated by \n) to send during the request.
261 IPC_STRUCT_MEMBER(std::string
, extra_headers
)
263 // If is_post is true, holds the post_data information from browser. Empty
265 IPC_STRUCT_MEMBER(std::vector
<unsigned char>, browser_initiated_post_data
)
267 // The page_id for this navigation, or -1 if it is a new navigation. Back,
268 // Forward, and Reload navigations should have a valid page_id. If the load
269 // succeeds, then this page_id will be reflected in the resultant
270 // FrameHostMsg_DidCommitProvisionalLoad message.
271 IPC_STRUCT_MEMBER(int32
, page_id
)
273 // For history navigations, this is the offset in the history list of the
274 // pending load. For non-history navigations, this will be ignored.
275 IPC_STRUCT_MEMBER(int, pending_history_list_offset
)
277 // Informs the RenderView of where its current page contents reside in
278 // session history and the total size of the session history list.
279 IPC_STRUCT_MEMBER(int, current_history_list_offset
)
280 IPC_STRUCT_MEMBER(int, current_history_list_length
)
282 // Informs the RenderView the session history should be cleared. In that
283 // case, the RenderView needs to notify the browser that the clearing was
284 // succesful when the navigation commits.
285 IPC_STRUCT_MEMBER(bool, should_clear_history_list
)
287 // Base URL for use in WebKit's SubstituteData.
288 // Is only used with data: URLs.
289 IPC_STRUCT_MEMBER(GURL
, base_url_for_data_url
)
291 // History URL for use in WebKit's SubstituteData.
292 // Is only used with data: URLs.
293 IPC_STRUCT_MEMBER(GURL
, history_url_for_data_url
)
295 // Any redirect URLs that occurred before |url|. Useful for cross-process
296 // navigations; defaults to empty.
297 IPC_STRUCT_MEMBER(std::vector
<GURL
>, redirects
)
299 // Informs the RenderView the pending navigation should replace the current
300 // history entry when it commits. This is used for cross-process redirects so
301 // the transferred navigation can recover the navigation state.
302 IPC_STRUCT_MEMBER(bool, should_replace_current_entry
)
304 // The time the request was created. This is used by the old performance
305 // infrastructure to set up DocumentState associated with the RenderView.
306 // TODO(ppi): make it go away.
307 IPC_STRUCT_MEMBER(base::Time
, request_time
)
309 // The following two members identify a previous request that has been
310 // created before this navigation is being transferred to a new render view.
311 // This serves the purpose of recycling the old request.
312 // Unless this refers to a transferred navigation, these values are -1 and -1.
313 IPC_STRUCT_MEMBER(int, transferred_request_child_id
)
314 IPC_STRUCT_MEMBER(int, transferred_request_request_id
)
316 // Whether or not this url should be allowed to access local file://
318 IPC_STRUCT_MEMBER(bool, can_load_local_resources
)
320 // If not empty, which frame to navigate.
321 IPC_STRUCT_MEMBER(std::string
, frame_to_navigate
)
324 IPC_STRUCT_BEGIN(FrameHostMsg_OpenURL_Params
)
325 IPC_STRUCT_MEMBER(GURL
, url
)
326 IPC_STRUCT_MEMBER(content::Referrer
, referrer
)
327 IPC_STRUCT_MEMBER(WindowOpenDisposition
, disposition
)
328 IPC_STRUCT_MEMBER(bool, should_replace_current_entry
)
329 IPC_STRUCT_MEMBER(bool, user_gesture
)
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_ROUTED1(FrameMsg_Navigate
, FrameMsg_Navigate_Params
)
420 // Instructs the renderer to invoke the frame's beforeunload event handler.
421 // Expects the result to be returned via FrameHostMsg_BeforeUnload_ACK.
422 IPC_MESSAGE_ROUTED0(FrameMsg_BeforeUnload
)
424 // Instructs the frame to swap out for a cross-site transition, including
425 // running the unload event handler and creating a RenderFrameProxy with the
426 // given |proxy_routing_id|. Expects a SwapOut_ACK message when finished.
427 IPC_MESSAGE_ROUTED3(FrameMsg_SwapOut
,
428 int /* proxy_routing_id */,
429 bool /* is_loading */,
430 content::FrameReplicationState
/* replication_state */)
432 // Instructs the frame to stop the load in progress, if any.
433 IPC_MESSAGE_ROUTED0(FrameMsg_Stop
)
435 // A message sent to RenderFrameProxy to indicate that its corresponding
436 // RenderFrame has started loading a document.
437 IPC_MESSAGE_ROUTED0(FrameMsg_DidStartLoading
)
439 // A message sent to RenderFrameProxy to indicate that its corresponding
440 // RenderFrame has completed loading.
441 IPC_MESSAGE_ROUTED0(FrameMsg_DidStopLoading
)
443 // Request for the renderer to insert CSS into the frame.
444 IPC_MESSAGE_ROUTED1(FrameMsg_CSSInsertRequest
,
445 std::string
/* css */)
447 // Request for the renderer to execute JavaScript in the frame's context.
449 // javascript is the string containing the JavaScript to be executed in the
450 // target frame's context.
452 // If the third parameter is true the result is sent back to the browser using
453 // the message FrameHostMsg_JavaScriptExecuteResponse.
454 // FrameHostMsg_JavaScriptExecuteResponse is passed the ID parameter so that the
455 // host can uniquely identify the request.
456 IPC_MESSAGE_ROUTED3(FrameMsg_JavaScriptExecuteRequest
,
457 base::string16
, /* javascript */
459 bool /* if true, a reply is requested */)
461 // ONLY FOR TESTS: Same as above but adds a fake UserGestureindicator around
462 // execution. (crbug.com/408426)
463 IPC_MESSAGE_ROUTED3(FrameMsg_JavaScriptExecuteRequestForTests
,
464 base::string16
, /* javascript */
466 bool /* if true, a reply is requested */)
468 // Selects between the given start and end offsets in the currently focused
470 IPC_MESSAGE_ROUTED2(FrameMsg_SetEditableSelectionOffsets
,
474 // Requests a navigation to the supplied markup, in an iframe with sandbox
476 IPC_MESSAGE_ROUTED1(FrameMsg_SetupTransitionView
,
477 std::string
/* markup */)
479 // Tells the renderer to hide the elements specified by the supplied CSS
480 // selector, and activates any exiting-transition stylesheets.
481 IPC_MESSAGE_ROUTED2(FrameMsg_BeginExitTransition
,
482 std::string
/* css_selector */,
483 bool /* exit_to_native_app */)
485 // Tell the renderer to revert the exit transition done before
486 IPC_MESSAGE_ROUTED0(FrameMsg_RevertExitTransition
)
488 // Tell the renderer to hide transition elements.
489 IPC_MESSAGE_ROUTED1(FrameMsg_HideTransitionElements
,
490 std::string
/* css_selector */)
492 // Tell the renderer to hide transition elements.
493 IPC_MESSAGE_ROUTED1(FrameMsg_ShowTransitionElements
,
494 std::string
/* css_selector */)
496 // Tells the renderer to reload the frame, optionally ignoring the cache while
498 IPC_MESSAGE_ROUTED1(FrameMsg_Reload
,
499 bool /* ignore_cache */)
501 // Notifies the color chooser client that the user selected a color.
502 IPC_MESSAGE_ROUTED2(FrameMsg_DidChooseColorResponse
, unsigned, SkColor
)
504 // Notifies the color chooser client that the color chooser has ended.
505 IPC_MESSAGE_ROUTED1(FrameMsg_DidEndColorChooser
, unsigned)
507 // Notifies the corresponding RenderFrameProxy object to replace itself with the
508 // RenderFrame object it is associated with.
509 IPC_MESSAGE_ROUTED0(FrameMsg_DeleteProxy
)
511 // Request the text surrounding the selection with a |max_length|. The response
512 // will be sent via FrameHostMsg_TextSurroundingSelectionResponse.
513 IPC_MESSAGE_ROUTED1(FrameMsg_TextSurroundingSelectionRequest
,
514 size_t /* max_length */)
516 // Tells the renderer to insert a link to the specified stylesheet. This is
517 // needed to support navigation transitions.
518 IPC_MESSAGE_ROUTED1(FrameMsg_AddStyleSheetByURL
, std::string
)
520 // Change the accessibility mode in the renderer process.
521 IPC_MESSAGE_ROUTED1(FrameMsg_SetAccessibilityMode
,
524 // Dispatch a load event in the iframe element containing this frame.
525 IPC_MESSAGE_ROUTED0(FrameMsg_DispatchLoad
)
527 #if defined(OS_ANDROID)
529 // External popup menus.
530 IPC_MESSAGE_ROUTED2(FrameMsg_SelectPopupMenuItems
,
531 bool /* user canceled the popup */,
532 std::vector
<int> /* selected indices */)
534 #elif defined(OS_MACOSX)
536 // External popup menus.
537 IPC_MESSAGE_ROUTED1(FrameMsg_SelectPopupMenuItem
,
538 int /* selected index, -1 means no selection */)
543 // Tells the renderer that a navigation is ready to commit. The renderer should
544 // request |stream_url| to get access to the stream containing the body of the
546 IPC_MESSAGE_ROUTED4(FrameMsg_CommitNavigation
,
547 content::ResourceResponseHead
, /* response */
548 GURL
, /* stream_url */
549 content::CommonNavigationParams
, /* common_params */
550 content::CommitNavigationParams
/* commit_params */)
552 #if defined(ENABLE_PLUGINS)
553 // Notifies the renderer of updates to the Plugin Power Saver origin whitelist.
554 IPC_MESSAGE_ROUTED1(FrameMsg_UpdatePluginContentOriginWhitelist
,
555 std::set
<GURL
> /* origin_whitelist */)
556 #endif // defined(ENABLE_PLUGINS)
558 // -----------------------------------------------------------------------------
559 // Messages sent from the renderer to the browser.
561 // Blink and JavaScript error messages to log to the console
563 IPC_MESSAGE_ROUTED4(FrameHostMsg_AddMessageToConsole
,
564 int32
, /* log level */
565 base::string16
, /* msg */
566 int32
, /* line number */
567 base::string16
/* source id */ )
569 // Sent by the renderer when a child frame is created in the renderer.
571 // Each of these messages will have a corresponding FrameHostMsg_Detach message
572 // sent when the frame is detached from the DOM.
573 IPC_SYNC_MESSAGE_CONTROL3_1(FrameHostMsg_CreateChildFrame
,
574 int32
/* parent_routing_id */,
575 std::string
/* frame_name */,
576 content::SandboxFlags
/* sandbox flags */,
577 int32
/* new_routing_id */)
579 // Sent by the renderer to the parent RenderFrameHost when a child frame is
580 // detached from the DOM.
581 IPC_MESSAGE_ROUTED0(FrameHostMsg_Detach
)
583 // Indicates the renderer process is gone. This actually is sent by the
584 // browser process to itself, but keeps the interface cleaner.
585 IPC_MESSAGE_ROUTED2(FrameHostMsg_RenderProcessGone
,
586 int, /* this really is base::TerminationStatus */
589 // Sent by the renderer when the frame becomes focused.
590 IPC_MESSAGE_ROUTED0(FrameHostMsg_FrameFocused
)
592 // Sent when the renderer starts a provisional load for a frame.
593 // |is_transition_navigation| signals that the frame has defined transition
594 // elements which can be animated by the navigation destination to provide
595 // a transition effect during load.
596 IPC_MESSAGE_ROUTED2(FrameHostMsg_DidStartProvisionalLoadForFrame
,
598 bool /* is_transition_navigation */)
600 // Sent when the renderer fails a provisional load with an error.
601 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidFailProvisionalLoadWithError
,
602 FrameHostMsg_DidFailProvisionalLoadWithError_Params
)
604 // Notifies the browser that a frame in the view has changed. This message
605 // has a lot of parameters and is packed/unpacked by functions defined in
606 // render_messages.h.
607 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidCommitProvisionalLoad
,
608 FrameHostMsg_DidCommitProvisionalLoad_Params
)
610 // Notifies the browser that a document has been loaded.
611 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidFinishDocumentLoad
)
613 IPC_MESSAGE_ROUTED3(FrameHostMsg_DidFailLoadWithError
,
614 GURL
/* validated_url */,
615 int /* error_code */,
616 base::string16
/* error_description */)
618 // Sent when the renderer decides to ignore a navigation.
619 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidDropNavigation
)
621 // Sent when the renderer starts loading the page. |to_different_document| will
622 // be true unless the load is a fragment navigation, or triggered by
623 // history.pushState/replaceState.
624 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidStartLoading
,
625 bool /* to_different_document */)
627 // Sent when the renderer is done loading a page.
628 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidStopLoading
)
630 // Sent when the renderer changed the progress of a load.
631 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidChangeLoadProgress
,
632 double /* load_progress */)
634 // Requests that the given URL be opened in the specified manner.
635 IPC_MESSAGE_ROUTED1(FrameHostMsg_OpenURL
, FrameHostMsg_OpenURL_Params
)
637 // Notifies the browser that a frame finished loading.
638 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidFinishLoad
,
639 GURL
/* validated_url */)
641 // Sent when after the onload handler has been invoked for the document
642 // in this frame. Sent for top-level frames. |report_type| and |ui_timestamp|
643 // are used to report navigation metrics starting on the ui input event that
644 // triggered the navigation timestamp.
645 IPC_MESSAGE_ROUTED2(FrameHostMsg_DocumentOnLoadCompleted
,
646 FrameMsg_UILoadMetricsReportType::Value
/* report_type */,
647 base::TimeTicks
/* ui_timestamp */)
649 // Notifies that the initial empty document of a view has been accessed.
650 // After this, it is no longer safe to show a pending navigation's URL without
651 // making a URL spoof possible.
652 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidAccessInitialDocument
)
654 // Sent when the frame sets its opener to null, disowning it for the lifetime of
655 // the window. Sent for top-level frames.
656 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidDisownOpener
)
658 // Notifies the browser that a page id was assigned.
659 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidAssignPageId
,
662 // Changes the title for the page in the UI when the page is navigated or the
663 // title changes. Sent for top-level frames.
664 IPC_MESSAGE_ROUTED2(FrameHostMsg_UpdateTitle
,
665 base::string16
/* title */,
666 blink::WebTextDirection
/* title direction */)
668 // Change the encoding name of the page in UI when the page has detected
669 // proper encoding name. Sent for top-level frames.
670 IPC_MESSAGE_ROUTED1(FrameHostMsg_UpdateEncoding
,
671 std::string
/* new encoding name */)
673 // Following message is used to communicate the values received by the
674 // callback binding the JS to Cpp.
675 // An instance of browser that has an automation host listening to it can
676 // have a javascript send a native value (string, number, boolean) to the
677 // listener in Cpp. (DomAutomationController)
678 IPC_MESSAGE_ROUTED2(FrameHostMsg_DomOperationResponse
,
679 std::string
/* json_string */,
680 int /* automation_id */)
682 #if defined(ENABLE_PLUGINS)
683 // Sent to the browser when the renderer detects it is blocked on a pepper
684 // plugin message for too long. This is also sent when it becomes unhung
685 // (according to the value of is_hung). The browser can give the user the
686 // option of killing the plugin.
687 IPC_MESSAGE_ROUTED3(FrameHostMsg_PepperPluginHung
,
688 int /* plugin_child_id */,
689 base::FilePath
/* path */,
692 // Sent by the renderer process to indicate that a plugin instance has crashed.
693 // Note: |plugin_pid| should not be trusted. The corresponding process has
694 // probably died. Moreover, the ID may have been reused by a new process. Any
695 // usage other than displaying it in a prompt to the user is very likely to be
697 IPC_MESSAGE_ROUTED2(FrameHostMsg_PluginCrashed
,
698 base::FilePath
/* plugin_path */,
699 base::ProcessId
/* plugin_pid */)
701 // Return information about a plugin for the given URL and MIME
702 // type. If there is no matching plugin, |found| is false.
703 // |actual_mime_type| is the actual mime type supported by the
705 IPC_SYNC_MESSAGE_CONTROL4_3(FrameHostMsg_GetPluginInfo
,
706 int /* render_frame_id */,
709 std::string
/* mime_type */,
711 content::WebPluginInfo
/* plugin info */,
712 std::string
/* actual_mime_type */)
714 // A renderer sends this to the browser process when it wants to temporarily
715 // whitelist an origin's plugin content as essential. This temporary whitelist
716 // is specific to a top level frame, and is cleared when the whitelisting
717 // RenderFrame is destroyed.
718 IPC_MESSAGE_ROUTED1(FrameHostMsg_PluginContentOriginAllowed
,
719 GURL
/* content_origin */)
720 #endif // defined(ENABLE_PLUGINS)
722 // A renderer sends this to the browser process when it wants to
723 // create a plugin. The browser will create the plugin process if
724 // necessary, and will return a handle to the channel on success.
725 // On error an empty string is returned.
726 IPC_SYNC_MESSAGE_CONTROL4_2(FrameHostMsg_OpenChannelToPlugin
,
727 int /* render_frame_id */,
730 std::string
/* mime_type */,
731 IPC::ChannelHandle
/* channel_handle */,
732 content::WebPluginInfo
/* info */)
734 // Acknowledge that we presented an ubercomp frame.
736 // See FrameMsg_CompositorFrameSwapped
737 IPC_MESSAGE_ROUTED1(FrameHostMsg_CompositorFrameSwappedACK
,
738 FrameHostMsg_CompositorFrameSwappedACK_Params
/* params */)
740 // Provides the result from handling BeforeUnload. |proceed| matches the return
741 // value of the frame's beforeunload handler: true if the user decided to
742 // proceed with leaving the page.
743 IPC_MESSAGE_ROUTED3(FrameHostMsg_BeforeUnload_ACK
,
745 base::TimeTicks
/* before_unload_start_time */,
746 base::TimeTicks
/* before_unload_end_time */)
748 // Indicates that the current frame has swapped out, after a SwapOut message.
749 IPC_MESSAGE_ROUTED0(FrameHostMsg_SwapOut_ACK
)
751 IPC_MESSAGE_ROUTED1(FrameHostMsg_ReclaimCompositorResources
,
752 FrameHostMsg_ReclaimCompositorResources_Params
/* params */)
754 // Forwards an input event to a child.
755 // TODO(nick): Temporary bridge, revisit once the browser process can route
756 // input directly to subframes. http://crbug.com/339659
757 IPC_MESSAGE_ROUTED1(FrameHostMsg_ForwardInputEvent
,
758 IPC::WebInputEventPointer
/* event */)
760 // Used to tell the parent that the user right clicked on an area of the
761 // content area, and a context menu should be shown for it. The params
762 // object contains information about the node(s) that were selected when the
763 // user right clicked.
764 IPC_MESSAGE_ROUTED1(FrameHostMsg_ContextMenu
, content::ContextMenuParams
)
766 // Initial drawing parameters for a child frame that has been swapped out to
768 IPC_MESSAGE_ROUTED2(FrameHostMsg_InitializeChildFrame
,
769 gfx::Rect
/* frame_rect */,
770 float /* scale_factor */)
772 // Response for FrameMsg_JavaScriptExecuteRequest, sent when a reply was
773 // requested. The ID is the parameter supplied to
774 // FrameMsg_JavaScriptExecuteRequest. The result has the value returned by the
775 // script as its only element, one of Null, Boolean, Integer, Real, Date, or
777 IPC_MESSAGE_ROUTED2(FrameHostMsg_JavaScriptExecuteResponse
,
779 base::ListValue
/* result */)
781 // A request to run a JavaScript dialog.
782 IPC_SYNC_MESSAGE_ROUTED4_2(FrameHostMsg_RunJavaScriptMessage
,
783 base::string16
/* in - alert message */,
784 base::string16
/* in - default prompt */,
785 GURL
/* in - originating page URL */,
786 content::JavaScriptMessageType
/* in - type */,
787 bool /* out - success */,
788 base::string16
/* out - user_input field */)
790 // Displays a dialog to confirm that the user wants to navigate away from the
791 // page. Replies true if yes, and false otherwise. The reply string is ignored,
792 // but is included so that we can use OnJavaScriptMessageBoxClosed.
793 IPC_SYNC_MESSAGE_ROUTED3_2(FrameHostMsg_RunBeforeUnloadConfirm
,
794 GURL
, /* in - originating frame URL */
795 base::string16
/* in - alert message */,
796 bool /* in - is a reload */,
797 bool /* out - success */,
798 base::string16
/* out - This is ignored.*/)
800 // Asks the browser to open the color chooser.
801 IPC_MESSAGE_ROUTED3(FrameHostMsg_OpenColorChooser
,
804 std::vector
<content::ColorSuggestion
> /* suggestions */)
806 // Asks the browser to end the color chooser.
807 IPC_MESSAGE_ROUTED1(FrameHostMsg_EndColorChooser
, int /* id */)
809 // Change the selected color in the color chooser.
810 IPC_MESSAGE_ROUTED2(FrameHostMsg_SetSelectedColorInColorChooser
,
814 // Notifies the browser that media has started/stopped playing.
815 IPC_MESSAGE_ROUTED4(FrameHostMsg_MediaPlayingNotification
,
816 int64
/* player_cookie, distinguishes instances */,
817 bool /* has_video */,
818 bool /* has_audio */,
819 bool /* is_remote */)
821 IPC_MESSAGE_ROUTED1(FrameHostMsg_MediaPausedNotification
,
822 int64
/* player_cookie, distinguishes instances */)
824 // Notify browser the theme color has been changed.
825 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidChangeThemeColor
,
826 SkColor
/* theme_color */)
828 // Response for FrameMsg_TextSurroundingSelectionRequest, |startOffset| and
829 // |endOffset| are the offsets of the selection in the returned |content|.
830 IPC_MESSAGE_ROUTED3(FrameHostMsg_TextSurroundingSelectionResponse
,
831 base::string16
, /* content */
832 size_t, /* startOffset */
833 size_t /* endOffset */)
835 // Notifies the browser that the renderer has a pending navigation transition.
836 // The string parameters are all UTF8.
837 IPC_MESSAGE_CONTROL1(FrameHostMsg_AddNavigationTransitionData
,
838 FrameHostMsg_AddNavigationTransitionData_Params
)
841 // Tells the browser to perform a navigation.
842 IPC_MESSAGE_ROUTED3(FrameHostMsg_BeginNavigation
,
843 content::CommonNavigationParams
,
844 content::BeginNavigationParams
,
845 scoped_refptr
<content::ResourceRequestBody
>)
847 // Sent once a paint happens after the first non empty layout. In other words
848 // after the frame has painted something.
849 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidFirstVisuallyNonEmptyPaint
)
851 // Sent as a response to FrameMsg_VisualStateRequest.
852 // The message is delivered using RenderWidget::QueueMessage.
853 IPC_MESSAGE_ROUTED1(FrameHostMsg_VisualStateResponse
, uint64
/* id */)
855 // Puts the browser into "tab fullscreen" mode for the sending renderer.
856 // See the comment in chrome/browser/ui/browser.h for more details.
857 IPC_MESSAGE_ROUTED1(FrameHostMsg_ToggleFullscreen
, bool /* enter_fullscreen */)
859 // Messages to signal the presence or absence of BeforeUnload or Unload handlers
860 // for a frame. |present| is true if there is at least one of the handlers for
862 IPC_MESSAGE_ROUTED1(FrameHostMsg_BeforeUnloadHandlersPresent
,
864 IPC_MESSAGE_ROUTED1(FrameHostMsg_UnloadHandlersPresent
,
867 // Dispatch a load event for this frame in the iframe element of an
868 // out-of-process parent frame.
869 IPC_MESSAGE_ROUTED0(FrameHostMsg_DispatchLoad
)
871 #if defined(OS_MACOSX) || defined(OS_ANDROID)
873 // Message to show/hide a popup menu using native controls.
874 IPC_MESSAGE_ROUTED1(FrameHostMsg_ShowPopup
,
875 FrameHostMsg_ShowPopup_Params
)
876 IPC_MESSAGE_ROUTED0(FrameHostMsg_HidePopup
)