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_MEMBER(base_url_for_data_url
)
216 IPC_STRUCT_TRAITS_MEMBER(history_url_for_data_url
)
217 IPC_STRUCT_TRAITS_END()
219 IPC_STRUCT_TRAITS_BEGIN(content::BeginNavigationParams
)
220 IPC_STRUCT_TRAITS_MEMBER(method
)
221 IPC_STRUCT_TRAITS_MEMBER(headers
)
222 IPC_STRUCT_TRAITS_MEMBER(load_flags
)
223 IPC_STRUCT_TRAITS_MEMBER(has_user_gesture
)
224 IPC_STRUCT_TRAITS_END()
226 IPC_STRUCT_TRAITS_BEGIN(content::StartNavigationParams
)
227 IPC_STRUCT_TRAITS_MEMBER(is_post
)
228 IPC_STRUCT_TRAITS_MEMBER(extra_headers
)
229 IPC_STRUCT_TRAITS_MEMBER(browser_initiated_post_data
)
230 IPC_STRUCT_TRAITS_MEMBER(should_replace_current_entry
)
231 IPC_STRUCT_TRAITS_MEMBER(transferred_request_child_id
)
232 IPC_STRUCT_TRAITS_MEMBER(transferred_request_request_id
)
233 IPC_STRUCT_TRAITS_END()
235 IPC_STRUCT_TRAITS_BEGIN(content::RequestNavigationParams
)
236 IPC_STRUCT_TRAITS_MEMBER(is_overriding_user_agent
)
237 IPC_STRUCT_TRAITS_MEMBER(browser_navigation_start
)
238 IPC_STRUCT_TRAITS_MEMBER(redirects
)
239 IPC_STRUCT_TRAITS_MEMBER(can_load_local_resources
)
240 IPC_STRUCT_TRAITS_MEMBER(frame_to_navigate
)
241 IPC_STRUCT_TRAITS_MEMBER(request_time
)
242 IPC_STRUCT_TRAITS_MEMBER(page_state
)
243 IPC_STRUCT_TRAITS_MEMBER(page_id
)
244 IPC_STRUCT_TRAITS_MEMBER(pending_history_list_offset
)
245 IPC_STRUCT_TRAITS_MEMBER(current_history_list_offset
)
246 IPC_STRUCT_TRAITS_MEMBER(current_history_list_length
)
247 IPC_STRUCT_TRAITS_MEMBER(should_clear_history_list
)
248 IPC_STRUCT_TRAITS_END()
250 IPC_STRUCT_TRAITS_BEGIN(content::FrameReplicationState
)
251 IPC_STRUCT_TRAITS_MEMBER(origin
)
252 IPC_STRUCT_TRAITS_MEMBER(sandbox_flags
)
253 IPC_STRUCT_TRAITS_MEMBER(name
)
254 IPC_STRUCT_TRAITS_END()
256 IPC_STRUCT_BEGIN(FrameMsg_NewFrame_WidgetParams
)
257 // Gives the routing ID for the RenderWidget that will be attached to the
258 // new RenderFrame. If the RenderFrame does not need a RenderWidget, this
259 // is MSG_ROUTING_NONE and the other parameters are not read.
260 IPC_STRUCT_MEMBER(int, routing_id
)
262 // Identifier for the output surface for the new RenderWidget.
263 IPC_STRUCT_MEMBER(int, surface_id
)
265 // Tells the new RenderWidget whether it is initially hidden.
266 IPC_STRUCT_MEMBER(bool, hidden
)
269 IPC_STRUCT_BEGIN(FrameHostMsg_OpenURL_Params
)
270 IPC_STRUCT_MEMBER(GURL
, url
)
271 IPC_STRUCT_MEMBER(content::Referrer
, referrer
)
272 IPC_STRUCT_MEMBER(WindowOpenDisposition
, disposition
)
273 IPC_STRUCT_MEMBER(bool, should_replace_current_entry
)
274 IPC_STRUCT_MEMBER(bool, user_gesture
)
277 #if defined(OS_MACOSX) || defined(OS_ANDROID)
278 // This message is used for supporting popup menus on Mac OS X and Android using
279 // native controls. See the FrameHostMsg_ShowPopup message.
280 IPC_STRUCT_BEGIN(FrameHostMsg_ShowPopup_Params
)
281 // Position on the screen.
282 IPC_STRUCT_MEMBER(gfx::Rect
, bounds
)
284 // The height of each item in the menu.
285 IPC_STRUCT_MEMBER(int, item_height
)
287 // The size of the font to use for those items.
288 IPC_STRUCT_MEMBER(double, item_font_size
)
290 // The currently selected (displayed) item in the menu.
291 IPC_STRUCT_MEMBER(int, selected_item
)
293 // The entire list of items in the popup menu.
294 IPC_STRUCT_MEMBER(std::vector
<content::MenuItem
>, popup_items
)
296 // Whether items should be right-aligned.
297 IPC_STRUCT_MEMBER(bool, right_aligned
)
299 // Whether this is a multi-select popup.
300 IPC_STRUCT_MEMBER(bool, allow_multiple_selection
)
304 // -----------------------------------------------------------------------------
305 // Messages sent from the browser to the renderer.
307 // Notifies the embedding frame that a new CompositorFrame is ready to be
308 // presented. When the frame finishes presenting, a matching
309 // FrameHostMsg_CompositorFrameSwappedACK should be sent back to the
310 // RenderViewHost that was produced the CompositorFrame.
312 // This is used in the ubercomp compositing path.
313 IPC_MESSAGE_ROUTED1(FrameMsg_CompositorFrameSwapped
,
314 FrameMsg_CompositorFrameSwapped_Params
/* params */)
316 // Notifies the embedding frame that the process rendering the child frame's
317 // contents has terminated.
318 IPC_MESSAGE_ROUTED0(FrameMsg_ChildFrameProcessGone
)
320 // Sent in response to a FrameHostMsg_ContextMenu to let the renderer know that
321 // the menu has been closed.
322 IPC_MESSAGE_ROUTED1(FrameMsg_ContextMenuClosed
,
323 content::CustomContextMenuContext
/* custom_context */)
325 // Executes custom context menu action that was provided from Blink.
326 IPC_MESSAGE_ROUTED2(FrameMsg_CustomContextMenuAction
,
327 content::CustomContextMenuContext
/* custom_context */,
328 unsigned /* action */)
330 // Requests that the RenderFrame or RenderFrameProxy sets its opener to null.
331 IPC_MESSAGE_ROUTED0(FrameMsg_DisownOpener
)
333 // Requests that the RenderFrame send back a response after waiting for the
334 // commit, activation and frame swap of the current DOM tree in blink.
335 IPC_MESSAGE_ROUTED1(FrameMsg_VisualStateRequest
, uint64
/* id */)
337 // Instructs the renderer to create a new RenderFrame object with |routing_id|.
338 // The new frame should be created as a child of the object identified by
339 // |parent_routing_id| or as top level if that is MSG_ROUTING_NONE.
340 // If a valid |proxy_routing_id| is provided, the new frame will be configured
341 // to replace the proxy on commit. When the new frame has a parent,
342 // |replication_state| holds properties replicated from the process rendering
343 // the parent frame, such as the new frame's sandbox flags.
344 IPC_MESSAGE_CONTROL5(FrameMsg_NewFrame
,
345 int /* routing_id */,
346 int /* parent_routing_id */,
347 int /* proxy_routing_id */,
348 content::FrameReplicationState
/* replication_state */,
349 FrameMsg_NewFrame_WidgetParams
/* widget_params */)
351 // Instructs the renderer to create a new RenderFrameProxy object with
352 // |routing_id|. The new proxy should be created as a child of the object
353 // identified by |parent_routing_id| or as top level if that is
355 IPC_MESSAGE_CONTROL4(FrameMsg_NewFrameProxy
,
356 int /* routing_id */,
357 int /* parent_routing_id */,
358 int /* render_view_routing_id */,
359 content::FrameReplicationState
/* replication_state */)
361 // Tells the renderer to perform the specified navigation, interrupting any
362 // existing navigation.
363 IPC_MESSAGE_ROUTED3(FrameMsg_Navigate
,
364 content::CommonNavigationParams
, /* common_params */
365 content::StartNavigationParams
, /* start_params */
366 content::RequestNavigationParams
/* request_params */)
368 // Instructs the renderer to invoke the frame's beforeunload event handler.
369 // Expects the result to be returned via FrameHostMsg_BeforeUnload_ACK.
370 IPC_MESSAGE_ROUTED0(FrameMsg_BeforeUnload
)
372 // Instructs the frame to swap out for a cross-site transition, including
373 // running the unload event handler and creating a RenderFrameProxy with the
374 // given |proxy_routing_id|. Expects a SwapOut_ACK message when finished.
375 IPC_MESSAGE_ROUTED3(FrameMsg_SwapOut
,
376 int /* proxy_routing_id */,
377 bool /* is_loading */,
378 content::FrameReplicationState
/* replication_state */)
380 // Instructs the frame to stop the load in progress, if any.
381 IPC_MESSAGE_ROUTED0(FrameMsg_Stop
)
383 // A message sent to RenderFrameProxy to indicate that its corresponding
384 // RenderFrame has started loading a document.
385 IPC_MESSAGE_ROUTED0(FrameMsg_DidStartLoading
)
387 // A message sent to RenderFrameProxy to indicate that its corresponding
388 // RenderFrame has completed loading.
389 IPC_MESSAGE_ROUTED0(FrameMsg_DidStopLoading
)
391 // Request for the renderer to insert CSS into the frame.
392 IPC_MESSAGE_ROUTED1(FrameMsg_CSSInsertRequest
,
393 std::string
/* css */)
395 // Request for the renderer to execute JavaScript in the frame's context.
397 // javascript is the string containing the JavaScript to be executed in the
398 // target frame's context.
400 // If the third parameter is true the result is sent back to the browser using
401 // the message FrameHostMsg_JavaScriptExecuteResponse.
402 // FrameHostMsg_JavaScriptExecuteResponse is passed the ID parameter so that the
403 // host can uniquely identify the request.
404 IPC_MESSAGE_ROUTED3(FrameMsg_JavaScriptExecuteRequest
,
405 base::string16
, /* javascript */
407 bool /* if true, a reply is requested */)
409 // ONLY FOR TESTS: Same as above but adds a fake UserGestureindicator around
410 // execution. (crbug.com/408426)
411 IPC_MESSAGE_ROUTED3(FrameMsg_JavaScriptExecuteRequestForTests
,
412 base::string16
, /* javascript */
414 bool /* if true, a reply is requested */)
416 // Selects between the given start and end offsets in the currently focused
418 IPC_MESSAGE_ROUTED2(FrameMsg_SetEditableSelectionOffsets
,
422 // Requests a navigation to the supplied markup, in an iframe with sandbox
424 IPC_MESSAGE_ROUTED1(FrameMsg_SetupTransitionView
,
425 std::string
/* markup */)
427 // Tells the renderer to hide the elements specified by the supplied CSS
428 // selector, and activates any exiting-transition stylesheets.
429 IPC_MESSAGE_ROUTED2(FrameMsg_BeginExitTransition
,
430 std::string
/* css_selector */,
431 bool /* exit_to_native_app */)
433 // Tell the renderer to revert the exit transition done before
434 IPC_MESSAGE_ROUTED0(FrameMsg_RevertExitTransition
)
436 // Tell the renderer to hide transition elements.
437 IPC_MESSAGE_ROUTED1(FrameMsg_HideTransitionElements
,
438 std::string
/* css_selector */)
440 // Tell the renderer to hide transition elements.
441 IPC_MESSAGE_ROUTED1(FrameMsg_ShowTransitionElements
,
442 std::string
/* css_selector */)
444 // Tells the renderer to reload the frame, optionally ignoring the cache while
446 IPC_MESSAGE_ROUTED1(FrameMsg_Reload
,
447 bool /* ignore_cache */)
449 // Notifies the color chooser client that the user selected a color.
450 IPC_MESSAGE_ROUTED2(FrameMsg_DidChooseColorResponse
, unsigned, SkColor
)
452 // Notifies the color chooser client that the color chooser has ended.
453 IPC_MESSAGE_ROUTED1(FrameMsg_DidEndColorChooser
, unsigned)
455 // Notifies the corresponding RenderFrameProxy object to replace itself with the
456 // RenderFrame object it is associated with.
457 IPC_MESSAGE_ROUTED0(FrameMsg_DeleteProxy
)
459 // Request the text surrounding the selection with a |max_length|. The response
460 // will be sent via FrameHostMsg_TextSurroundingSelectionResponse.
461 IPC_MESSAGE_ROUTED1(FrameMsg_TextSurroundingSelectionRequest
,
462 size_t /* max_length */)
464 // Tells the renderer to insert a link to the specified stylesheet. This is
465 // needed to support navigation transitions.
466 IPC_MESSAGE_ROUTED1(FrameMsg_AddStyleSheetByURL
, std::string
)
468 // Change the accessibility mode in the renderer process.
469 IPC_MESSAGE_ROUTED1(FrameMsg_SetAccessibilityMode
,
472 // Dispatch a load event in the iframe element containing this frame.
473 IPC_MESSAGE_ROUTED0(FrameMsg_DispatchLoad
)
475 // Notifies the frame that its parent has changed the frame's sandbox flags.
476 IPC_MESSAGE_ROUTED1(FrameMsg_DidUpdateSandboxFlags
, content::SandboxFlags
)
478 // Update a proxy's window.name property. Used when the frame's name is
479 // changed in another process.
480 IPC_MESSAGE_ROUTED1(FrameMsg_DidUpdateName
, std::string
/* name */)
482 #if defined(OS_ANDROID)
484 // External popup menus.
485 IPC_MESSAGE_ROUTED2(FrameMsg_SelectPopupMenuItems
,
486 bool /* user canceled the popup */,
487 std::vector
<int> /* selected indices */)
489 #elif defined(OS_MACOSX)
491 // External popup menus.
492 IPC_MESSAGE_ROUTED1(FrameMsg_SelectPopupMenuItem
,
493 int /* selected index, -1 means no selection */)
498 // Tells the renderer that a navigation is ready to commit. The renderer should
499 // request |stream_url| to get access to the stream containing the body of the
501 IPC_MESSAGE_ROUTED4(FrameMsg_CommitNavigation
,
502 content::ResourceResponseHead
, /* response */
503 GURL
, /* stream_url */
504 content::CommonNavigationParams
, /* common_params */
505 content::RequestNavigationParams
/* request_params */)
507 #if defined(ENABLE_PLUGINS)
508 // Notifies the renderer of updates to the Plugin Power Saver origin whitelist.
509 IPC_MESSAGE_ROUTED1(FrameMsg_UpdatePluginContentOriginWhitelist
,
510 std::set
<GURL
> /* origin_whitelist */)
511 #endif // defined(ENABLE_PLUGINS)
513 // -----------------------------------------------------------------------------
514 // Messages sent from the renderer to the browser.
516 // Blink and JavaScript error messages to log to the console
518 IPC_MESSAGE_ROUTED4(FrameHostMsg_AddMessageToConsole
,
519 int32
, /* log level */
520 base::string16
, /* msg */
521 int32
, /* line number */
522 base::string16
/* source id */ )
524 // Sent by the renderer when a child frame is created in the renderer.
526 // Each of these messages will have a corresponding FrameHostMsg_Detach message
527 // sent when the frame is detached from the DOM.
528 IPC_SYNC_MESSAGE_CONTROL3_1(FrameHostMsg_CreateChildFrame
,
529 int32
/* parent_routing_id */,
530 std::string
/* frame_name */,
531 content::SandboxFlags
/* sandbox flags */,
532 int32
/* new_routing_id */)
534 // Sent by the renderer to the parent RenderFrameHost when a child frame is
535 // detached from the DOM.
536 IPC_MESSAGE_ROUTED0(FrameHostMsg_Detach
)
538 // Indicates the renderer process is gone. This actually is sent by the
539 // browser process to itself, but keeps the interface cleaner.
540 IPC_MESSAGE_ROUTED2(FrameHostMsg_RenderProcessGone
,
541 int, /* this really is base::TerminationStatus */
544 // Sent by the renderer when the frame becomes focused.
545 IPC_MESSAGE_ROUTED0(FrameHostMsg_FrameFocused
)
547 // Sent when the renderer starts a provisional load for a frame.
548 // |is_transition_navigation| signals that the frame has defined transition
549 // elements which can be animated by the navigation destination to provide
550 // a transition effect during load.
551 IPC_MESSAGE_ROUTED2(FrameHostMsg_DidStartProvisionalLoadForFrame
,
553 bool /* is_transition_navigation */)
555 // Sent when the renderer fails a provisional load with an error.
556 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidFailProvisionalLoadWithError
,
557 FrameHostMsg_DidFailProvisionalLoadWithError_Params
)
559 // Notifies the browser that a frame in the view has changed. This message
560 // has a lot of parameters and is packed/unpacked by functions defined in
561 // render_messages.h.
562 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidCommitProvisionalLoad
,
563 FrameHostMsg_DidCommitProvisionalLoad_Params
)
565 // Notifies the browser that a document has been loaded.
566 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidFinishDocumentLoad
)
568 IPC_MESSAGE_ROUTED3(FrameHostMsg_DidFailLoadWithError
,
569 GURL
/* validated_url */,
570 int /* error_code */,
571 base::string16
/* error_description */)
573 // Sent when the renderer decides to ignore a navigation.
574 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidDropNavigation
)
576 // Sent when the renderer starts loading the page. |to_different_document| will
577 // be true unless the load is a fragment navigation, or triggered by
578 // history.pushState/replaceState.
579 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidStartLoading
,
580 bool /* to_different_document */)
582 // Sent when the renderer is done loading a page.
583 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidStopLoading
)
585 // Sent when the frame changes its window.name.
586 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidChangeName
, std::string
/* name */)
588 // Sent when the renderer changed the progress of a load.
589 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidChangeLoadProgress
,
590 double /* load_progress */)
592 // Requests that the given URL be opened in the specified manner.
593 IPC_MESSAGE_ROUTED1(FrameHostMsg_OpenURL
, FrameHostMsg_OpenURL_Params
)
595 // Notifies the browser that a frame finished loading.
596 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidFinishLoad
,
597 GURL
/* validated_url */)
599 // Sent when after the onload handler has been invoked for the document
600 // in this frame. Sent for top-level frames. |report_type| and |ui_timestamp|
601 // are used to report navigation metrics starting on the ui input event that
602 // triggered the navigation timestamp.
603 IPC_MESSAGE_ROUTED2(FrameHostMsg_DocumentOnLoadCompleted
,
604 FrameMsg_UILoadMetricsReportType::Value
/* report_type */,
605 base::TimeTicks
/* ui_timestamp */)
607 // Notifies that the initial empty document of a view has been accessed.
608 // After this, it is no longer safe to show a pending navigation's URL without
609 // making a URL spoof possible.
610 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidAccessInitialDocument
)
612 // Sent when the frame sets its opener to null, disowning it for the lifetime of
613 // the window. Sent for top-level frames.
614 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidDisownOpener
)
616 // Notifies the browser that a page id was assigned.
617 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidAssignPageId
,
620 // Notifies the browser that sandbox flags have changed for a subframe of this
622 IPC_MESSAGE_ROUTED2(FrameHostMsg_DidChangeSandboxFlags
,
623 int32
/* subframe_routing_id */,
624 content::SandboxFlags
/* updated_flags */)
626 // Changes the title for the page in the UI when the page is navigated or the
627 // title changes. Sent for top-level frames.
628 IPC_MESSAGE_ROUTED2(FrameHostMsg_UpdateTitle
,
629 base::string16
/* title */,
630 blink::WebTextDirection
/* title direction */)
632 // Change the encoding name of the page in UI when the page has detected
633 // proper encoding name. Sent for top-level frames.
634 IPC_MESSAGE_ROUTED1(FrameHostMsg_UpdateEncoding
,
635 std::string
/* new encoding name */)
637 // Following message is used to communicate the values received by the
638 // callback binding the JS to Cpp.
639 // An instance of browser that has an automation host listening to it can
640 // have a javascript send a native value (string, number, boolean) to the
641 // listener in Cpp. (DomAutomationController)
642 IPC_MESSAGE_ROUTED2(FrameHostMsg_DomOperationResponse
,
643 std::string
/* json_string */,
644 int /* automation_id */)
646 #if defined(ENABLE_PLUGINS)
647 // Sent to the browser when the renderer detects it is blocked on a pepper
648 // plugin message for too long. This is also sent when it becomes unhung
649 // (according to the value of is_hung). The browser can give the user the
650 // option of killing the plugin.
651 IPC_MESSAGE_ROUTED3(FrameHostMsg_PepperPluginHung
,
652 int /* plugin_child_id */,
653 base::FilePath
/* path */,
656 // Sent by the renderer process to indicate that a plugin instance has crashed.
657 // Note: |plugin_pid| should not be trusted. The corresponding process has
658 // probably died. Moreover, the ID may have been reused by a new process. Any
659 // usage other than displaying it in a prompt to the user is very likely to be
661 IPC_MESSAGE_ROUTED2(FrameHostMsg_PluginCrashed
,
662 base::FilePath
/* plugin_path */,
663 base::ProcessId
/* plugin_pid */)
665 // Return information about a plugin for the given URL and MIME
666 // type. If there is no matching plugin, |found| is false.
667 // |actual_mime_type| is the actual mime type supported by the
669 IPC_SYNC_MESSAGE_CONTROL4_3(FrameHostMsg_GetPluginInfo
,
670 int /* render_frame_id */,
673 std::string
/* mime_type */,
675 content::WebPluginInfo
/* plugin info */,
676 std::string
/* actual_mime_type */)
678 // A renderer sends this to the browser process when it wants to temporarily
679 // whitelist an origin's plugin content as essential. This temporary whitelist
680 // is specific to a top level frame, and is cleared when the whitelisting
681 // RenderFrame is destroyed.
682 IPC_MESSAGE_ROUTED1(FrameHostMsg_PluginContentOriginAllowed
,
683 GURL
/* content_origin */)
684 #endif // defined(ENABLE_PLUGINS)
686 // A renderer sends this to the browser process when it wants to
687 // create a plugin. The browser will create the plugin process if
688 // necessary, and will return a handle to the channel on success.
689 // On error an empty string is returned.
690 IPC_SYNC_MESSAGE_CONTROL4_2(FrameHostMsg_OpenChannelToPlugin
,
691 int /* render_frame_id */,
694 std::string
/* mime_type */,
695 IPC::ChannelHandle
/* channel_handle */,
696 content::WebPluginInfo
/* info */)
698 // Acknowledge that we presented an ubercomp frame.
700 // See FrameMsg_CompositorFrameSwapped
701 IPC_MESSAGE_ROUTED1(FrameHostMsg_CompositorFrameSwappedACK
,
702 FrameHostMsg_CompositorFrameSwappedACK_Params
/* params */)
704 // Provides the result from handling BeforeUnload. |proceed| matches the return
705 // value of the frame's beforeunload handler: true if the user decided to
706 // proceed with leaving the page.
707 IPC_MESSAGE_ROUTED3(FrameHostMsg_BeforeUnload_ACK
,
709 base::TimeTicks
/* before_unload_start_time */,
710 base::TimeTicks
/* before_unload_end_time */)
712 // Indicates that the current frame has swapped out, after a SwapOut message.
713 IPC_MESSAGE_ROUTED0(FrameHostMsg_SwapOut_ACK
)
715 IPC_MESSAGE_ROUTED1(FrameHostMsg_ReclaimCompositorResources
,
716 FrameHostMsg_ReclaimCompositorResources_Params
/* params */)
718 // Forwards an input event to a child.
719 // TODO(nick): Temporary bridge, revisit once the browser process can route
720 // input directly to subframes. http://crbug.com/339659
721 IPC_MESSAGE_ROUTED1(FrameHostMsg_ForwardInputEvent
,
722 IPC::WebInputEventPointer
/* event */)
724 // Used to tell the parent that the user right clicked on an area of the
725 // content area, and a context menu should be shown for it. The params
726 // object contains information about the node(s) that were selected when the
727 // user right clicked.
728 IPC_MESSAGE_ROUTED1(FrameHostMsg_ContextMenu
, content::ContextMenuParams
)
730 // Initial drawing parameters for a child frame that has been swapped out to
732 IPC_MESSAGE_ROUTED2(FrameHostMsg_InitializeChildFrame
,
733 gfx::Rect
/* frame_rect */,
734 float /* scale_factor */)
736 // Response for FrameMsg_JavaScriptExecuteRequest, sent when a reply was
737 // requested. The ID is the parameter supplied to
738 // FrameMsg_JavaScriptExecuteRequest. The result has the value returned by the
739 // script as its only element, one of Null, Boolean, Integer, Real, Date, or
741 IPC_MESSAGE_ROUTED2(FrameHostMsg_JavaScriptExecuteResponse
,
743 base::ListValue
/* result */)
745 // A request to run a JavaScript dialog.
746 IPC_SYNC_MESSAGE_ROUTED4_2(FrameHostMsg_RunJavaScriptMessage
,
747 base::string16
/* in - alert message */,
748 base::string16
/* in - default prompt */,
749 GURL
/* in - originating page URL */,
750 content::JavaScriptMessageType
/* in - type */,
751 bool /* out - success */,
752 base::string16
/* out - user_input field */)
754 // Displays a dialog to confirm that the user wants to navigate away from the
755 // page. Replies true if yes, and false otherwise. The reply string is ignored,
756 // but is included so that we can use OnJavaScriptMessageBoxClosed.
757 IPC_SYNC_MESSAGE_ROUTED3_2(FrameHostMsg_RunBeforeUnloadConfirm
,
758 GURL
, /* in - originating frame URL */
759 base::string16
/* in - alert message */,
760 bool /* in - is a reload */,
761 bool /* out - success */,
762 base::string16
/* out - This is ignored.*/)
764 // Asks the browser to open the color chooser.
765 IPC_MESSAGE_ROUTED3(FrameHostMsg_OpenColorChooser
,
768 std::vector
<content::ColorSuggestion
> /* suggestions */)
770 // Asks the browser to end the color chooser.
771 IPC_MESSAGE_ROUTED1(FrameHostMsg_EndColorChooser
, int /* id */)
773 // Change the selected color in the color chooser.
774 IPC_MESSAGE_ROUTED2(FrameHostMsg_SetSelectedColorInColorChooser
,
778 // Notifies the browser that media has started/stopped playing.
779 IPC_MESSAGE_ROUTED4(FrameHostMsg_MediaPlayingNotification
,
780 int64
/* player_cookie, distinguishes instances */,
781 bool /* has_video */,
782 bool /* has_audio */,
783 bool /* is_remote */)
785 IPC_MESSAGE_ROUTED1(FrameHostMsg_MediaPausedNotification
,
786 int64
/* player_cookie, distinguishes instances */)
788 // Notify browser the theme color has been changed.
789 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidChangeThemeColor
,
790 SkColor
/* theme_color */)
792 // Response for FrameMsg_TextSurroundingSelectionRequest, |startOffset| and
793 // |endOffset| are the offsets of the selection in the returned |content|.
794 IPC_MESSAGE_ROUTED3(FrameHostMsg_TextSurroundingSelectionResponse
,
795 base::string16
, /* content */
796 size_t, /* startOffset */
797 size_t /* endOffset */)
799 // Notifies the browser that the renderer has a pending navigation transition.
800 // The string parameters are all UTF8.
801 IPC_MESSAGE_CONTROL1(FrameHostMsg_AddNavigationTransitionData
,
802 FrameHostMsg_AddNavigationTransitionData_Params
)
805 // Tells the browser to perform a navigation.
806 IPC_MESSAGE_ROUTED3(FrameHostMsg_BeginNavigation
,
807 content::CommonNavigationParams
,
808 content::BeginNavigationParams
,
809 scoped_refptr
<content::ResourceRequestBody
>)
811 // Sent once a paint happens after the first non empty layout. In other words
812 // after the frame has painted something.
813 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidFirstVisuallyNonEmptyPaint
)
815 // Sent as a response to FrameMsg_VisualStateRequest.
816 // The message is delivered using RenderWidget::QueueMessage.
817 IPC_MESSAGE_ROUTED1(FrameHostMsg_VisualStateResponse
, uint64
/* id */)
819 // Puts the browser into "tab fullscreen" mode for the sending renderer.
820 // See the comment in chrome/browser/ui/browser.h for more details.
821 IPC_MESSAGE_ROUTED1(FrameHostMsg_ToggleFullscreen
, bool /* enter_fullscreen */)
823 // Dispatch a load event for this frame in the iframe element of an
824 // out-of-process parent frame.
825 IPC_MESSAGE_ROUTED0(FrameHostMsg_DispatchLoad
)
827 #if defined(OS_MACOSX) || defined(OS_ANDROID)
829 // Message to show/hide a popup menu using native controls.
830 IPC_MESSAGE_ROUTED1(FrameHostMsg_ShowPopup
,
831 FrameHostMsg_ShowPopup_Params
)
832 IPC_MESSAGE_ROUTED0(FrameHostMsg_HidePopup
)