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(misspelling_hash
)
72 IPC_STRUCT_TRAITS_MEMBER(dictionary_suggestions
)
73 IPC_STRUCT_TRAITS_MEMBER(spellcheck_enabled
)
74 IPC_STRUCT_TRAITS_MEMBER(is_editable
)
75 IPC_STRUCT_TRAITS_MEMBER(writing_direction_default
)
76 IPC_STRUCT_TRAITS_MEMBER(writing_direction_left_to_right
)
77 IPC_STRUCT_TRAITS_MEMBER(writing_direction_right_to_left
)
78 IPC_STRUCT_TRAITS_MEMBER(edit_flags
)
79 IPC_STRUCT_TRAITS_MEMBER(security_info
)
80 IPC_STRUCT_TRAITS_MEMBER(frame_charset
)
81 IPC_STRUCT_TRAITS_MEMBER(referrer_policy
)
82 IPC_STRUCT_TRAITS_MEMBER(custom_context
)
83 IPC_STRUCT_TRAITS_MEMBER(custom_items
)
84 IPC_STRUCT_TRAITS_MEMBER(source_type
)
85 #if defined(OS_ANDROID)
86 IPC_STRUCT_TRAITS_MEMBER(selection_start
)
87 IPC_STRUCT_TRAITS_MEMBER(selection_end
)
89 IPC_STRUCT_TRAITS_END()
91 IPC_STRUCT_TRAITS_BEGIN(content::CustomContextMenuContext
)
92 IPC_STRUCT_TRAITS_MEMBER(is_pepper_menu
)
93 IPC_STRUCT_TRAITS_MEMBER(request_id
)
94 IPC_STRUCT_TRAITS_MEMBER(render_widget_id
)
95 IPC_STRUCT_TRAITS_MEMBER(link_followed
)
96 IPC_STRUCT_TRAITS_END()
98 IPC_STRUCT_TRAITS_BEGIN(content::TransitionElement
)
99 IPC_STRUCT_TRAITS_MEMBER(id
)
100 IPC_STRUCT_TRAITS_MEMBER(rect
)
101 IPC_STRUCT_TRAITS_END()
103 IPC_STRUCT_BEGIN(FrameHostMsg_AddNavigationTransitionData_Params
)
104 IPC_STRUCT_MEMBER(int, render_frame_id
)
105 IPC_STRUCT_MEMBER(std::string
, allowed_destination_host_pattern
)
106 IPC_STRUCT_MEMBER(std::string
, selector
)
107 IPC_STRUCT_MEMBER(std::string
, markup
)
108 IPC_STRUCT_MEMBER(std::vector
<content::TransitionElement
>, elements
)
111 IPC_STRUCT_BEGIN(FrameHostMsg_DidFailProvisionalLoadWithError_Params
)
112 // Error code as reported in the DidFailProvisionalLoad callback.
113 IPC_STRUCT_MEMBER(int, error_code
)
114 // An error message generated from the error_code. This can be an empty
115 // string if we were unable to find a meaningful description.
116 IPC_STRUCT_MEMBER(base::string16
, error_description
)
117 // The URL that the error is reported for.
118 IPC_STRUCT_MEMBER(GURL
, url
)
119 // True if the failure is the result of navigating to a POST again
120 // and we're going to show the POST interstitial.
121 IPC_STRUCT_MEMBER(bool, showing_repost_interstitial
)
124 IPC_STRUCT_TRAITS_BEGIN(content::FrameNavigateParams
)
125 IPC_STRUCT_TRAITS_MEMBER(page_id
)
126 IPC_STRUCT_TRAITS_MEMBER(url
)
127 IPC_STRUCT_TRAITS_MEMBER(base_url
)
128 IPC_STRUCT_TRAITS_MEMBER(referrer
)
129 IPC_STRUCT_TRAITS_MEMBER(transition
)
130 IPC_STRUCT_TRAITS_MEMBER(redirects
)
131 IPC_STRUCT_TRAITS_MEMBER(should_update_history
)
132 IPC_STRUCT_TRAITS_MEMBER(searchable_form_url
)
133 IPC_STRUCT_TRAITS_MEMBER(searchable_form_encoding
)
134 IPC_STRUCT_TRAITS_MEMBER(contents_mime_type
)
135 IPC_STRUCT_TRAITS_MEMBER(socket_address
)
136 IPC_STRUCT_TRAITS_END()
138 // Parameters structure for FrameHostMsg_DidCommitProvisionalLoad, which has
139 // too many data parameters to be reasonably put in a predefined IPC message.
140 IPC_STRUCT_BEGIN_WITH_PARENT(FrameHostMsg_DidCommitProvisionalLoad_Params
,
141 content::FrameNavigateParams
)
142 IPC_STRUCT_TRAITS_PARENT(content::FrameNavigateParams
)
144 // Information regarding the security of the connection (empty if the
145 // connection was not secure).
146 IPC_STRUCT_MEMBER(std::string
, security_info
)
148 // The gesture that initiated this navigation.
149 IPC_STRUCT_MEMBER(content::NavigationGesture
, gesture
)
151 // True if this was a post request.
152 IPC_STRUCT_MEMBER(bool, is_post
)
154 // The POST body identifier. -1 if it doesn't exist.
155 IPC_STRUCT_MEMBER(int64
, post_id
)
157 // Whether the frame navigation resulted in no change to the documents within
158 // the page. For example, the navigation may have just resulted in scrolling
159 // to a named anchor.
160 IPC_STRUCT_MEMBER(bool, was_within_same_page
)
162 // The status code of the HTTP request.
163 IPC_STRUCT_MEMBER(int, http_status_code
)
165 // This flag is used to warn if the renderer is displaying an error page,
166 // so that we can set the appropriate page type.
167 IPC_STRUCT_MEMBER(bool, url_is_unreachable
)
169 // True if the connection was proxied. In this case, socket_address
170 // will represent the address of the proxy, rather than the remote host.
171 IPC_STRUCT_MEMBER(bool, was_fetched_via_proxy
)
173 // Serialized history item state to store in the navigation entry.
174 IPC_STRUCT_MEMBER(content::PageState
, page_state
)
176 // Original request's URL.
177 IPC_STRUCT_MEMBER(GURL
, original_request_url
)
179 // User agent override used to navigate.
180 IPC_STRUCT_MEMBER(bool, is_overriding_user_agent
)
182 // Notifies the browser that for this navigation, the session history was
183 // successfully cleared.
184 IPC_STRUCT_MEMBER(bool, history_list_was_cleared
)
186 // The routing_id of the render view associated with the navigation.
187 // We need to track the RenderViewHost routing_id because of downstream
188 // dependencies (crbug.com/392171 DownloadRequestHandle, SaveFileManager,
189 // ResourceDispatcherHostImpl, MediaStreamUIProxy,
190 // SpeechRecognitionDispatcherHost and possibly others). They look up the view
191 // based on the ID stored in the resource requests. Once those dependencies
192 // are unwound or moved to RenderFrameHost (crbug.com/304341) we can move the
193 // client to be based on the routing_id of the RenderFrameHost.
194 IPC_STRUCT_MEMBER(int, render_view_routing_id
)
196 // Origin of the frame. This will be replicated to any associated
197 // RenderFrameProxies.
198 IPC_STRUCT_MEMBER(url::Origin
, origin
)
200 // How navigation metrics starting on UI action for this load should be
202 IPC_STRUCT_MEMBER(FrameMsg_UILoadMetricsReportType::Value
, report_type
)
204 // Timestamp at which the UI action that triggered the navigation originated.
205 IPC_STRUCT_MEMBER(base::TimeTicks
, ui_timestamp
)
208 IPC_STRUCT_TRAITS_BEGIN(content::CommonNavigationParams
)
209 IPC_STRUCT_TRAITS_MEMBER(url
)
210 IPC_STRUCT_TRAITS_MEMBER(referrer
)
211 IPC_STRUCT_TRAITS_MEMBER(transition
)
212 IPC_STRUCT_TRAITS_MEMBER(navigation_type
)
213 IPC_STRUCT_TRAITS_MEMBER(allow_download
)
214 IPC_STRUCT_TRAITS_MEMBER(ui_timestamp
)
215 IPC_STRUCT_TRAITS_MEMBER(report_type
)
216 IPC_STRUCT_TRAITS_MEMBER(base_url_for_data_url
)
217 IPC_STRUCT_TRAITS_MEMBER(history_url_for_data_url
)
218 IPC_STRUCT_TRAITS_END()
220 IPC_STRUCT_TRAITS_BEGIN(content::BeginNavigationParams
)
221 IPC_STRUCT_TRAITS_MEMBER(method
)
222 IPC_STRUCT_TRAITS_MEMBER(headers
)
223 IPC_STRUCT_TRAITS_MEMBER(load_flags
)
224 IPC_STRUCT_TRAITS_MEMBER(has_user_gesture
)
225 IPC_STRUCT_TRAITS_END()
227 IPC_STRUCT_TRAITS_BEGIN(content::StartNavigationParams
)
228 IPC_STRUCT_TRAITS_MEMBER(is_post
)
229 IPC_STRUCT_TRAITS_MEMBER(extra_headers
)
230 IPC_STRUCT_TRAITS_MEMBER(browser_initiated_post_data
)
231 IPC_STRUCT_TRAITS_MEMBER(should_replace_current_entry
)
232 IPC_STRUCT_TRAITS_MEMBER(transferred_request_child_id
)
233 IPC_STRUCT_TRAITS_MEMBER(transferred_request_request_id
)
234 IPC_STRUCT_TRAITS_END()
236 IPC_STRUCT_TRAITS_BEGIN(content::RequestNavigationParams
)
237 IPC_STRUCT_TRAITS_MEMBER(is_overriding_user_agent
)
238 IPC_STRUCT_TRAITS_MEMBER(browser_navigation_start
)
239 IPC_STRUCT_TRAITS_MEMBER(redirects
)
240 IPC_STRUCT_TRAITS_MEMBER(can_load_local_resources
)
241 IPC_STRUCT_TRAITS_MEMBER(frame_to_navigate
)
242 IPC_STRUCT_TRAITS_MEMBER(request_time
)
243 IPC_STRUCT_TRAITS_MEMBER(page_state
)
244 IPC_STRUCT_TRAITS_MEMBER(page_id
)
245 IPC_STRUCT_TRAITS_MEMBER(pending_history_list_offset
)
246 IPC_STRUCT_TRAITS_MEMBER(current_history_list_offset
)
247 IPC_STRUCT_TRAITS_MEMBER(current_history_list_length
)
248 IPC_STRUCT_TRAITS_MEMBER(should_clear_history_list
)
249 IPC_STRUCT_TRAITS_END()
251 IPC_STRUCT_TRAITS_BEGIN(content::FrameReplicationState
)
252 IPC_STRUCT_TRAITS_MEMBER(origin
)
253 IPC_STRUCT_TRAITS_MEMBER(sandbox_flags
)
254 IPC_STRUCT_TRAITS_MEMBER(name
)
255 IPC_STRUCT_TRAITS_END()
257 IPC_STRUCT_BEGIN(FrameMsg_NewFrame_WidgetParams
)
258 // Gives the routing ID for the RenderWidget that will be attached to the
259 // new RenderFrame. If the RenderFrame does not need a RenderWidget, this
260 // is MSG_ROUTING_NONE and the other parameters are not read.
261 IPC_STRUCT_MEMBER(int, routing_id
)
263 // Identifier for the output surface for the new RenderWidget.
264 IPC_STRUCT_MEMBER(int, surface_id
)
266 // Tells the new RenderWidget whether it is initially hidden.
267 IPC_STRUCT_MEMBER(bool, hidden
)
270 IPC_STRUCT_BEGIN(FrameHostMsg_OpenURL_Params
)
271 IPC_STRUCT_MEMBER(GURL
, url
)
272 IPC_STRUCT_MEMBER(content::Referrer
, referrer
)
273 IPC_STRUCT_MEMBER(WindowOpenDisposition
, disposition
)
274 IPC_STRUCT_MEMBER(bool, should_replace_current_entry
)
275 IPC_STRUCT_MEMBER(bool, user_gesture
)
278 #if defined(OS_MACOSX) || defined(OS_ANDROID)
279 // This message is used for supporting popup menus on Mac OS X and Android using
280 // native controls. See the FrameHostMsg_ShowPopup message.
281 IPC_STRUCT_BEGIN(FrameHostMsg_ShowPopup_Params
)
282 // Position on the screen.
283 IPC_STRUCT_MEMBER(gfx::Rect
, bounds
)
285 // The height of each item in the menu.
286 IPC_STRUCT_MEMBER(int, item_height
)
288 // The size of the font to use for those items.
289 IPC_STRUCT_MEMBER(double, item_font_size
)
291 // The currently selected (displayed) item in the menu.
292 IPC_STRUCT_MEMBER(int, selected_item
)
294 // The entire list of items in the popup menu.
295 IPC_STRUCT_MEMBER(std::vector
<content::MenuItem
>, popup_items
)
297 // Whether items should be right-aligned.
298 IPC_STRUCT_MEMBER(bool, right_aligned
)
300 // Whether this is a multi-select popup.
301 IPC_STRUCT_MEMBER(bool, allow_multiple_selection
)
305 // -----------------------------------------------------------------------------
306 // Messages sent from the browser to the renderer.
308 // Notifies the embedding frame that a new CompositorFrame is ready to be
309 // presented. When the frame finishes presenting, a matching
310 // FrameHostMsg_CompositorFrameSwappedACK should be sent back to the
311 // RenderViewHost that was produced the CompositorFrame.
313 // This is used in the ubercomp compositing path.
314 IPC_MESSAGE_ROUTED1(FrameMsg_CompositorFrameSwapped
,
315 FrameMsg_CompositorFrameSwapped_Params
/* params */)
317 // Notifies the embedding frame that the process rendering the child frame's
318 // contents has terminated.
319 IPC_MESSAGE_ROUTED0(FrameMsg_ChildFrameProcessGone
)
321 // Sent in response to a FrameHostMsg_ContextMenu to let the renderer know that
322 // the menu has been closed.
323 IPC_MESSAGE_ROUTED1(FrameMsg_ContextMenuClosed
,
324 content::CustomContextMenuContext
/* custom_context */)
326 // Executes custom context menu action that was provided from Blink.
327 IPC_MESSAGE_ROUTED2(FrameMsg_CustomContextMenuAction
,
328 content::CustomContextMenuContext
/* custom_context */,
329 unsigned /* action */)
331 // Requests that the RenderFrame or RenderFrameProxy sets its opener to null.
332 IPC_MESSAGE_ROUTED0(FrameMsg_DisownOpener
)
334 // Requests that the RenderFrame send back a response after waiting for the
335 // commit, activation and frame swap of the current DOM tree in blink.
336 IPC_MESSAGE_ROUTED1(FrameMsg_VisualStateRequest
, uint64
/* id */)
338 // Instructs the renderer to create a new RenderFrame object with |routing_id|.
339 // The new frame should be created as a child of the object identified by
340 // |parent_routing_id| or as top level if that is MSG_ROUTING_NONE.
341 // If a valid |proxy_routing_id| is provided, the new frame will be configured
342 // to replace the proxy on commit. When the new frame has a parent,
343 // |replication_state| holds properties replicated from the process rendering
344 // the parent frame, such as the new frame's sandbox flags.
345 IPC_MESSAGE_CONTROL5(FrameMsg_NewFrame
,
346 int /* routing_id */,
347 int /* parent_routing_id */,
348 int /* proxy_routing_id */,
349 content::FrameReplicationState
/* replication_state */,
350 FrameMsg_NewFrame_WidgetParams
/* widget_params */)
352 // Instructs the renderer to create a new RenderFrameProxy object with
353 // |routing_id|. The new proxy should be created as a child of the object
354 // identified by |parent_routing_id| or as top level if that is
356 IPC_MESSAGE_CONTROL4(FrameMsg_NewFrameProxy
,
357 int /* routing_id */,
358 int /* parent_routing_id */,
359 int /* render_view_routing_id */,
360 content::FrameReplicationState
/* replication_state */)
362 // Tells the renderer to perform the specified navigation, interrupting any
363 // existing navigation.
364 IPC_MESSAGE_ROUTED3(FrameMsg_Navigate
,
365 content::CommonNavigationParams
, /* common_params */
366 content::StartNavigationParams
, /* start_params */
367 content::RequestNavigationParams
/* request_params */)
369 // Instructs the renderer to invoke the frame's beforeunload event handler.
370 // Expects the result to be returned via FrameHostMsg_BeforeUnload_ACK.
371 IPC_MESSAGE_ROUTED0(FrameMsg_BeforeUnload
)
373 // Instructs the frame to swap out for a cross-site transition, including
374 // running the unload event handler and creating a RenderFrameProxy with the
375 // given |proxy_routing_id|. Expects a SwapOut_ACK message when finished.
376 IPC_MESSAGE_ROUTED3(FrameMsg_SwapOut
,
377 int /* proxy_routing_id */,
378 bool /* is_loading */,
379 content::FrameReplicationState
/* replication_state */)
381 // Instructs the frame to stop the load in progress, if any.
382 IPC_MESSAGE_ROUTED0(FrameMsg_Stop
)
384 // A message sent to RenderFrameProxy to indicate that its corresponding
385 // RenderFrame has started loading a document.
386 IPC_MESSAGE_ROUTED0(FrameMsg_DidStartLoading
)
388 // A message sent to RenderFrameProxy to indicate that its corresponding
389 // RenderFrame has completed loading.
390 IPC_MESSAGE_ROUTED0(FrameMsg_DidStopLoading
)
392 // Request for the renderer to insert CSS into the frame.
393 IPC_MESSAGE_ROUTED1(FrameMsg_CSSInsertRequest
,
394 std::string
/* css */)
396 // Request for the renderer to execute JavaScript in the frame's context.
398 // javascript is the string containing the JavaScript to be executed in the
399 // target frame's context.
401 // If the third parameter is true the result is sent back to the browser using
402 // the message FrameHostMsg_JavaScriptExecuteResponse.
403 // FrameHostMsg_JavaScriptExecuteResponse is passed the ID parameter so that the
404 // host can uniquely identify the request.
405 IPC_MESSAGE_ROUTED3(FrameMsg_JavaScriptExecuteRequest
,
406 base::string16
, /* javascript */
408 bool /* if true, a reply is requested */)
410 // ONLY FOR TESTS: Same as above but adds a fake UserGestureindicator around
411 // execution. (crbug.com/408426)
412 IPC_MESSAGE_ROUTED3(FrameMsg_JavaScriptExecuteRequestForTests
,
413 base::string16
, /* javascript */
415 bool /* if true, a reply is requested */)
417 // Selects between the given start and end offsets in the currently focused
419 IPC_MESSAGE_ROUTED2(FrameMsg_SetEditableSelectionOffsets
,
423 // Requests a navigation to the supplied markup, in an iframe with sandbox
425 IPC_MESSAGE_ROUTED1(FrameMsg_SetupTransitionView
,
426 std::string
/* markup */)
428 // Tells the renderer to hide the elements specified by the supplied CSS
429 // selector, and activates any exiting-transition stylesheets.
430 IPC_MESSAGE_ROUTED2(FrameMsg_BeginExitTransition
,
431 std::string
/* css_selector */,
432 bool /* exit_to_native_app */)
434 // Tell the renderer to revert the exit transition done before
435 IPC_MESSAGE_ROUTED0(FrameMsg_RevertExitTransition
)
437 // Tell the renderer to hide transition elements.
438 IPC_MESSAGE_ROUTED1(FrameMsg_HideTransitionElements
,
439 std::string
/* css_selector */)
441 // Tell the renderer to hide transition elements.
442 IPC_MESSAGE_ROUTED1(FrameMsg_ShowTransitionElements
,
443 std::string
/* css_selector */)
445 // Tells the renderer to reload the frame, optionally ignoring the cache while
447 IPC_MESSAGE_ROUTED1(FrameMsg_Reload
,
448 bool /* ignore_cache */)
450 // Notifies the color chooser client that the user selected a color.
451 IPC_MESSAGE_ROUTED2(FrameMsg_DidChooseColorResponse
, unsigned, SkColor
)
453 // Notifies the color chooser client that the color chooser has ended.
454 IPC_MESSAGE_ROUTED1(FrameMsg_DidEndColorChooser
, unsigned)
456 // Notifies the corresponding RenderFrameProxy object to replace itself with the
457 // RenderFrame object it is associated with.
458 IPC_MESSAGE_ROUTED0(FrameMsg_DeleteProxy
)
460 // Request the text surrounding the selection with a |max_length|. The response
461 // will be sent via FrameHostMsg_TextSurroundingSelectionResponse.
462 IPC_MESSAGE_ROUTED1(FrameMsg_TextSurroundingSelectionRequest
,
463 size_t /* max_length */)
465 // Tells the renderer to insert a link to the specified stylesheet. This is
466 // needed to support navigation transitions.
467 IPC_MESSAGE_ROUTED1(FrameMsg_AddStyleSheetByURL
, std::string
)
469 // Change the accessibility mode in the renderer process.
470 IPC_MESSAGE_ROUTED1(FrameMsg_SetAccessibilityMode
,
473 // Dispatch a load event in the iframe element containing this frame.
474 IPC_MESSAGE_ROUTED0(FrameMsg_DispatchLoad
)
476 // Notifies the frame that its parent has changed the frame's sandbox flags.
477 IPC_MESSAGE_ROUTED1(FrameMsg_DidUpdateSandboxFlags
, content::SandboxFlags
)
479 // Update a proxy's window.name property. Used when the frame's name is
480 // changed in another process.
481 IPC_MESSAGE_ROUTED1(FrameMsg_DidUpdateName
, std::string
/* name */)
483 #if defined(OS_ANDROID)
485 // External popup menus.
486 IPC_MESSAGE_ROUTED2(FrameMsg_SelectPopupMenuItems
,
487 bool /* user canceled the popup */,
488 std::vector
<int> /* selected indices */)
490 #elif defined(OS_MACOSX)
492 // External popup menus.
493 IPC_MESSAGE_ROUTED1(FrameMsg_SelectPopupMenuItem
,
494 int /* selected index, -1 means no selection */)
499 // Tells the renderer that a navigation is ready to commit. The renderer should
500 // request |stream_url| to get access to the stream containing the body of the
502 IPC_MESSAGE_ROUTED4(FrameMsg_CommitNavigation
,
503 content::ResourceResponseHead
, /* response */
504 GURL
, /* stream_url */
505 content::CommonNavigationParams
, /* common_params */
506 content::RequestNavigationParams
/* request_params */)
508 #if defined(ENABLE_PLUGINS)
509 // Notifies the renderer of updates to the Plugin Power Saver origin whitelist.
510 IPC_MESSAGE_ROUTED1(FrameMsg_UpdatePluginContentOriginWhitelist
,
511 std::set
<GURL
> /* origin_whitelist */)
512 #endif // defined(ENABLE_PLUGINS)
514 // -----------------------------------------------------------------------------
515 // Messages sent from the renderer to the browser.
517 // Blink and JavaScript error messages to log to the console
519 IPC_MESSAGE_ROUTED4(FrameHostMsg_AddMessageToConsole
,
520 int32
, /* log level */
521 base::string16
, /* msg */
522 int32
, /* line number */
523 base::string16
/* source id */ )
525 // Sent by the renderer when a child frame is created in the renderer.
527 // Each of these messages will have a corresponding FrameHostMsg_Detach message
528 // sent when the frame is detached from the DOM.
529 IPC_SYNC_MESSAGE_CONTROL3_1(FrameHostMsg_CreateChildFrame
,
530 int32
/* parent_routing_id */,
531 std::string
/* frame_name */,
532 content::SandboxFlags
/* sandbox flags */,
533 int32
/* new_routing_id */)
535 // Sent by the renderer to the parent RenderFrameHost when a child frame is
536 // detached from the DOM.
537 IPC_MESSAGE_ROUTED0(FrameHostMsg_Detach
)
539 // Indicates the renderer process is gone. This actually is sent by the
540 // browser process to itself, but keeps the interface cleaner.
541 IPC_MESSAGE_ROUTED2(FrameHostMsg_RenderProcessGone
,
542 int, /* this really is base::TerminationStatus */
545 // Sent by the renderer when the frame becomes focused.
546 IPC_MESSAGE_ROUTED0(FrameHostMsg_FrameFocused
)
548 // Sent when the renderer starts a provisional load for a frame.
549 // |is_transition_navigation| signals that the frame has defined transition
550 // elements which can be animated by the navigation destination to provide
551 // a transition effect during load.
552 IPC_MESSAGE_ROUTED2(FrameHostMsg_DidStartProvisionalLoadForFrame
,
554 bool /* is_transition_navigation */)
556 // Sent when the renderer fails a provisional load with an error.
557 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidFailProvisionalLoadWithError
,
558 FrameHostMsg_DidFailProvisionalLoadWithError_Params
)
560 // Notifies the browser that a frame in the view has changed. This message
561 // has a lot of parameters and is packed/unpacked by functions defined in
562 // render_messages.h.
563 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidCommitProvisionalLoad
,
564 FrameHostMsg_DidCommitProvisionalLoad_Params
)
566 // Notifies the browser that a document has been loaded.
567 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidFinishDocumentLoad
)
569 IPC_MESSAGE_ROUTED3(FrameHostMsg_DidFailLoadWithError
,
570 GURL
/* validated_url */,
571 int /* error_code */,
572 base::string16
/* error_description */)
574 // Sent when the renderer decides to ignore a navigation.
575 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidDropNavigation
)
577 // Sent when the renderer starts loading the page. |to_different_document| will
578 // be true unless the load is a fragment navigation, or triggered by
579 // history.pushState/replaceState.
580 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidStartLoading
,
581 bool /* to_different_document */)
583 // Sent when the renderer is done loading a page.
584 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidStopLoading
)
586 // Sent when the frame changes its window.name.
587 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidChangeName
, std::string
/* name */)
589 // Sent when the renderer changed the progress of a load.
590 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidChangeLoadProgress
,
591 double /* load_progress */)
593 // Requests that the given URL be opened in the specified manner.
594 IPC_MESSAGE_ROUTED1(FrameHostMsg_OpenURL
, FrameHostMsg_OpenURL_Params
)
596 // Notifies the browser that a frame finished loading.
597 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidFinishLoad
,
598 GURL
/* validated_url */)
600 // Sent when after the onload handler has been invoked for the document
601 // in this frame. Sent for top-level frames. |report_type| and |ui_timestamp|
602 // are used to report navigation metrics starting on the ui input event that
603 // triggered the navigation timestamp.
604 IPC_MESSAGE_ROUTED2(FrameHostMsg_DocumentOnLoadCompleted
,
605 FrameMsg_UILoadMetricsReportType::Value
/* report_type */,
606 base::TimeTicks
/* ui_timestamp */)
608 // Notifies that the initial empty document of a view has been accessed.
609 // After this, it is no longer safe to show a pending navigation's URL without
610 // making a URL spoof possible.
611 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidAccessInitialDocument
)
613 // Sent when the frame sets its opener to null, disowning it for the lifetime of
614 // the window. Sent for top-level frames.
615 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidDisownOpener
)
617 // Notifies the browser that a page id was assigned.
618 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidAssignPageId
,
621 // Notifies the browser that sandbox flags have changed for a subframe of this
623 IPC_MESSAGE_ROUTED2(FrameHostMsg_DidChangeSandboxFlags
,
624 int32
/* subframe_routing_id */,
625 content::SandboxFlags
/* updated_flags */)
627 // Changes the title for the page in the UI when the page is navigated or the
628 // title changes. Sent for top-level frames.
629 IPC_MESSAGE_ROUTED2(FrameHostMsg_UpdateTitle
,
630 base::string16
/* title */,
631 blink::WebTextDirection
/* title direction */)
633 // Change the encoding name of the page in UI when the page has detected
634 // proper encoding name. Sent for top-level frames.
635 IPC_MESSAGE_ROUTED1(FrameHostMsg_UpdateEncoding
,
636 std::string
/* new encoding name */)
638 // Following message is used to communicate the values received by the
639 // callback binding the JS to Cpp.
640 // An instance of browser that has an automation host listening to it can
641 // have a javascript send a native value (string, number, boolean) to the
642 // listener in Cpp. (DomAutomationController)
643 IPC_MESSAGE_ROUTED2(FrameHostMsg_DomOperationResponse
,
644 std::string
/* json_string */,
645 int /* automation_id */)
647 #if defined(ENABLE_PLUGINS)
648 // Sent to the browser when the renderer detects it is blocked on a pepper
649 // plugin message for too long. This is also sent when it becomes unhung
650 // (according to the value of is_hung). The browser can give the user the
651 // option of killing the plugin.
652 IPC_MESSAGE_ROUTED3(FrameHostMsg_PepperPluginHung
,
653 int /* plugin_child_id */,
654 base::FilePath
/* path */,
657 // Sent by the renderer process to indicate that a plugin instance has crashed.
658 // Note: |plugin_pid| should not be trusted. The corresponding process has
659 // probably died. Moreover, the ID may have been reused by a new process. Any
660 // usage other than displaying it in a prompt to the user is very likely to be
662 IPC_MESSAGE_ROUTED2(FrameHostMsg_PluginCrashed
,
663 base::FilePath
/* plugin_path */,
664 base::ProcessId
/* plugin_pid */)
666 // Return information about a plugin for the given URL and MIME
667 // type. If there is no matching plugin, |found| is false.
668 // |actual_mime_type| is the actual mime type supported by the
670 IPC_SYNC_MESSAGE_CONTROL4_3(FrameHostMsg_GetPluginInfo
,
671 int /* render_frame_id */,
674 std::string
/* mime_type */,
676 content::WebPluginInfo
/* plugin info */,
677 std::string
/* actual_mime_type */)
679 // A renderer sends this to the browser process when it wants to temporarily
680 // whitelist an origin's plugin content as essential. This temporary whitelist
681 // is specific to a top level frame, and is cleared when the whitelisting
682 // RenderFrame is destroyed.
683 IPC_MESSAGE_ROUTED1(FrameHostMsg_PluginContentOriginAllowed
,
684 GURL
/* content_origin */)
685 #endif // defined(ENABLE_PLUGINS)
687 // A renderer sends this to the browser process when it wants to
688 // create a plugin. The browser will create the plugin process if
689 // necessary, and will return a handle to the channel on success.
690 // On error an empty string is returned.
691 IPC_SYNC_MESSAGE_CONTROL4_2(FrameHostMsg_OpenChannelToPlugin
,
692 int /* render_frame_id */,
695 std::string
/* mime_type */,
696 IPC::ChannelHandle
/* channel_handle */,
697 content::WebPluginInfo
/* info */)
699 // Acknowledge that we presented an ubercomp frame.
701 // See FrameMsg_CompositorFrameSwapped
702 IPC_MESSAGE_ROUTED1(FrameHostMsg_CompositorFrameSwappedACK
,
703 FrameHostMsg_CompositorFrameSwappedACK_Params
/* params */)
705 // Provides the result from handling BeforeUnload. |proceed| matches the return
706 // value of the frame's beforeunload handler: true if the user decided to
707 // proceed with leaving the page.
708 IPC_MESSAGE_ROUTED3(FrameHostMsg_BeforeUnload_ACK
,
710 base::TimeTicks
/* before_unload_start_time */,
711 base::TimeTicks
/* before_unload_end_time */)
713 // Indicates that the current frame has swapped out, after a SwapOut message.
714 IPC_MESSAGE_ROUTED0(FrameHostMsg_SwapOut_ACK
)
716 IPC_MESSAGE_ROUTED1(FrameHostMsg_ReclaimCompositorResources
,
717 FrameHostMsg_ReclaimCompositorResources_Params
/* params */)
719 // Forwards an input event to a child.
720 // TODO(nick): Temporary bridge, revisit once the browser process can route
721 // input directly to subframes. http://crbug.com/339659
722 IPC_MESSAGE_ROUTED1(FrameHostMsg_ForwardInputEvent
,
723 IPC::WebInputEventPointer
/* event */)
725 // Used to tell the parent that the user right clicked on an area of the
726 // content area, and a context menu should be shown for it. The params
727 // object contains information about the node(s) that were selected when the
728 // user right clicked.
729 IPC_MESSAGE_ROUTED1(FrameHostMsg_ContextMenu
, content::ContextMenuParams
)
731 // Initial drawing parameters for a child frame that has been swapped out to
733 IPC_MESSAGE_ROUTED2(FrameHostMsg_InitializeChildFrame
,
734 gfx::Rect
/* frame_rect */,
735 float /* scale_factor */)
737 // Response for FrameMsg_JavaScriptExecuteRequest, sent when a reply was
738 // requested. The ID is the parameter supplied to
739 // FrameMsg_JavaScriptExecuteRequest. The result has the value returned by the
740 // script as its only element, one of Null, Boolean, Integer, Real, Date, or
742 IPC_MESSAGE_ROUTED2(FrameHostMsg_JavaScriptExecuteResponse
,
744 base::ListValue
/* result */)
746 // A request to run a JavaScript dialog.
747 IPC_SYNC_MESSAGE_ROUTED4_2(FrameHostMsg_RunJavaScriptMessage
,
748 base::string16
/* in - alert message */,
749 base::string16
/* in - default prompt */,
750 GURL
/* in - originating page URL */,
751 content::JavaScriptMessageType
/* in - type */,
752 bool /* out - success */,
753 base::string16
/* out - user_input field */)
755 // Displays a dialog to confirm that the user wants to navigate away from the
756 // page. Replies true if yes, and false otherwise. The reply string is ignored,
757 // but is included so that we can use OnJavaScriptMessageBoxClosed.
758 IPC_SYNC_MESSAGE_ROUTED3_2(FrameHostMsg_RunBeforeUnloadConfirm
,
759 GURL
, /* in - originating frame URL */
760 base::string16
/* in - alert message */,
761 bool /* in - is a reload */,
762 bool /* out - success */,
763 base::string16
/* out - This is ignored.*/)
765 // Asks the browser to open the color chooser.
766 IPC_MESSAGE_ROUTED3(FrameHostMsg_OpenColorChooser
,
769 std::vector
<content::ColorSuggestion
> /* suggestions */)
771 // Asks the browser to end the color chooser.
772 IPC_MESSAGE_ROUTED1(FrameHostMsg_EndColorChooser
, int /* id */)
774 // Change the selected color in the color chooser.
775 IPC_MESSAGE_ROUTED2(FrameHostMsg_SetSelectedColorInColorChooser
,
779 // Notifies the browser that media has started/stopped playing.
780 IPC_MESSAGE_ROUTED4(FrameHostMsg_MediaPlayingNotification
,
781 int64
/* player_cookie, distinguishes instances */,
782 bool /* has_video */,
783 bool /* has_audio */,
784 bool /* is_remote */)
786 IPC_MESSAGE_ROUTED1(FrameHostMsg_MediaPausedNotification
,
787 int64
/* player_cookie, distinguishes instances */)
789 // Notify browser the theme color has been changed.
790 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidChangeThemeColor
,
791 SkColor
/* theme_color */)
793 // Response for FrameMsg_TextSurroundingSelectionRequest, |startOffset| and
794 // |endOffset| are the offsets of the selection in the returned |content|.
795 IPC_MESSAGE_ROUTED3(FrameHostMsg_TextSurroundingSelectionResponse
,
796 base::string16
, /* content */
797 size_t, /* startOffset */
798 size_t /* endOffset */)
800 // Notifies the browser that the renderer has a pending navigation transition.
801 // The string parameters are all UTF8.
802 IPC_MESSAGE_CONTROL1(FrameHostMsg_AddNavigationTransitionData
,
803 FrameHostMsg_AddNavigationTransitionData_Params
)
806 // Tells the browser to perform a navigation.
807 IPC_MESSAGE_ROUTED3(FrameHostMsg_BeginNavigation
,
808 content::CommonNavigationParams
,
809 content::BeginNavigationParams
,
810 scoped_refptr
<content::ResourceRequestBody
>)
812 // Sent once a paint happens after the first non empty layout. In other words
813 // after the frame has painted something.
814 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidFirstVisuallyNonEmptyPaint
)
816 // Sent as a response to FrameMsg_VisualStateRequest.
817 // The message is delivered using RenderWidget::QueueMessage.
818 IPC_MESSAGE_ROUTED1(FrameHostMsg_VisualStateResponse
, uint64
/* id */)
820 // Puts the browser into "tab fullscreen" mode for the sending renderer.
821 // See the comment in chrome/browser/ui/browser.h for more details.
822 IPC_MESSAGE_ROUTED1(FrameHostMsg_ToggleFullscreen
, bool /* enter_fullscreen */)
824 // Dispatch a load event for this frame in the iframe element of an
825 // out-of-process parent frame.
826 IPC_MESSAGE_ROUTED0(FrameHostMsg_DispatchLoad
)
828 #if defined(OS_MACOSX) || defined(OS_ANDROID)
830 // Message to show/hide a popup menu using native controls.
831 IPC_MESSAGE_ROUTED1(FrameHostMsg_ShowPopup
,
832 FrameHostMsg_ShowPopup_Params
)
833 IPC_MESSAGE_ROUTED0(FrameHostMsg_HidePopup
)