Pass ResourceResponse and StreamHandle in CommitNavigation.
[chromium-blink-merge.git] / content / common / frame_messages.h
blobfa3159ae2606a400f67140a1f8a52f3c9391f335
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/navigation_gesture.h"
13 #include "content/common/navigation_params.h"
14 #include "content/common/resource_request_body.h"
15 #include "content/public/common/color_suggestion.h"
16 #include "content/public/common/common_param_traits.h"
17 #include "content/public/common/context_menu_params.h"
18 #include "content/public/common/frame_navigate_params.h"
19 #include "content/public/common/javascript_message_type.h"
20 #include "content/public/common/page_state.h"
21 #include "content/public/common/resource_response.h"
22 #include "ipc/ipc_message_macros.h"
23 #include "ui/gfx/ipc/gfx_param_traits.h"
24 #include "url/gurl.h"
26 #undef IPC_MESSAGE_EXPORT
27 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT
29 #define IPC_MESSAGE_START FrameMsgStart
31 IPC_ENUM_TRAITS_MIN_MAX_VALUE(AccessibilityMode,
32 AccessibilityModeOff,
33 AccessibilityModeComplete)
34 IPC_ENUM_TRAITS_MIN_MAX_VALUE(content::JavaScriptMessageType,
35 content::JAVASCRIPT_MESSAGE_TYPE_ALERT,
36 content::JAVASCRIPT_MESSAGE_TYPE_PROMPT)
37 IPC_ENUM_TRAITS_MAX_VALUE(FrameMsg_Navigate_Type::Value,
38 FrameMsg_Navigate_Type::NAVIGATE_TYPE_LAST)
39 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebContextMenuData::MediaType,
40 blink::WebContextMenuData::MediaTypeLast)
41 IPC_ENUM_TRAITS_MAX_VALUE(ui::MenuSourceType, ui::MENU_SOURCE_TYPE_LAST)
43 IPC_STRUCT_TRAITS_BEGIN(content::ColorSuggestion)
44 IPC_STRUCT_TRAITS_MEMBER(color)
45 IPC_STRUCT_TRAITS_MEMBER(label)
46 IPC_STRUCT_TRAITS_END()
48 IPC_STRUCT_TRAITS_BEGIN(content::ContextMenuParams)
49 IPC_STRUCT_TRAITS_MEMBER(media_type)
50 IPC_STRUCT_TRAITS_MEMBER(x)
51 IPC_STRUCT_TRAITS_MEMBER(y)
52 IPC_STRUCT_TRAITS_MEMBER(link_url)
53 IPC_STRUCT_TRAITS_MEMBER(link_text)
54 IPC_STRUCT_TRAITS_MEMBER(unfiltered_link_url)
55 IPC_STRUCT_TRAITS_MEMBER(src_url)
56 IPC_STRUCT_TRAITS_MEMBER(has_image_contents)
57 IPC_STRUCT_TRAITS_MEMBER(page_url)
58 IPC_STRUCT_TRAITS_MEMBER(keyword_url)
59 IPC_STRUCT_TRAITS_MEMBER(frame_url)
60 IPC_STRUCT_TRAITS_MEMBER(frame_page_state)
61 IPC_STRUCT_TRAITS_MEMBER(media_flags)
62 IPC_STRUCT_TRAITS_MEMBER(selection_text)
63 IPC_STRUCT_TRAITS_MEMBER(suggested_filename)
64 IPC_STRUCT_TRAITS_MEMBER(misspelled_word)
65 IPC_STRUCT_TRAITS_MEMBER(misspelling_hash)
66 IPC_STRUCT_TRAITS_MEMBER(dictionary_suggestions)
67 IPC_STRUCT_TRAITS_MEMBER(spellcheck_enabled)
68 IPC_STRUCT_TRAITS_MEMBER(is_editable)
69 IPC_STRUCT_TRAITS_MEMBER(writing_direction_default)
70 IPC_STRUCT_TRAITS_MEMBER(writing_direction_left_to_right)
71 IPC_STRUCT_TRAITS_MEMBER(writing_direction_right_to_left)
72 IPC_STRUCT_TRAITS_MEMBER(edit_flags)
73 IPC_STRUCT_TRAITS_MEMBER(security_info)
74 IPC_STRUCT_TRAITS_MEMBER(frame_charset)
75 IPC_STRUCT_TRAITS_MEMBER(referrer_policy)
76 IPC_STRUCT_TRAITS_MEMBER(custom_context)
77 IPC_STRUCT_TRAITS_MEMBER(custom_items)
78 IPC_STRUCT_TRAITS_MEMBER(source_type)
79 #if defined(OS_ANDROID)
80 IPC_STRUCT_TRAITS_MEMBER(selection_start)
81 IPC_STRUCT_TRAITS_MEMBER(selection_end)
82 #endif
83 IPC_STRUCT_TRAITS_END()
85 IPC_STRUCT_TRAITS_BEGIN(content::CustomContextMenuContext)
86 IPC_STRUCT_TRAITS_MEMBER(is_pepper_menu)
87 IPC_STRUCT_TRAITS_MEMBER(request_id)
88 IPC_STRUCT_TRAITS_MEMBER(render_widget_id)
89 IPC_STRUCT_TRAITS_MEMBER(link_followed)
90 IPC_STRUCT_TRAITS_END()
92 IPC_STRUCT_BEGIN(FrameHostMsg_DidFailProvisionalLoadWithError_Params)
93 // Error code as reported in the DidFailProvisionalLoad callback.
94 IPC_STRUCT_MEMBER(int, error_code)
95 // An error message generated from the error_code. This can be an empty
96 // string if we were unable to find a meaningful description.
97 IPC_STRUCT_MEMBER(base::string16, error_description)
98 // The URL that the error is reported for.
99 IPC_STRUCT_MEMBER(GURL, url)
100 // True if the failure is the result of navigating to a POST again
101 // and we're going to show the POST interstitial.
102 IPC_STRUCT_MEMBER(bool, showing_repost_interstitial)
103 IPC_STRUCT_END()
105 IPC_STRUCT_TRAITS_BEGIN(content::FrameNavigateParams)
106 IPC_STRUCT_TRAITS_MEMBER(page_id)
107 IPC_STRUCT_TRAITS_MEMBER(url)
108 IPC_STRUCT_TRAITS_MEMBER(base_url)
109 IPC_STRUCT_TRAITS_MEMBER(referrer)
110 IPC_STRUCT_TRAITS_MEMBER(transition)
111 IPC_STRUCT_TRAITS_MEMBER(redirects)
112 IPC_STRUCT_TRAITS_MEMBER(should_update_history)
113 IPC_STRUCT_TRAITS_MEMBER(searchable_form_url)
114 IPC_STRUCT_TRAITS_MEMBER(searchable_form_encoding)
115 IPC_STRUCT_TRAITS_MEMBER(contents_mime_type)
116 IPC_STRUCT_TRAITS_MEMBER(socket_address)
117 IPC_STRUCT_TRAITS_END()
119 // Parameters structure for FrameHostMsg_DidCommitProvisionalLoad, which has
120 // too many data parameters to be reasonably put in a predefined IPC message.
121 IPC_STRUCT_BEGIN_WITH_PARENT(FrameHostMsg_DidCommitProvisionalLoad_Params,
122 content::FrameNavigateParams)
123 IPC_STRUCT_TRAITS_PARENT(content::FrameNavigateParams)
125 // Information regarding the security of the connection (empty if the
126 // connection was not secure).
127 IPC_STRUCT_MEMBER(std::string, security_info)
129 // The gesture that initiated this navigation.
130 IPC_STRUCT_MEMBER(content::NavigationGesture, gesture)
132 // True if this was a post request.
133 IPC_STRUCT_MEMBER(bool, is_post)
135 // The POST body identifier. -1 if it doesn't exist.
136 IPC_STRUCT_MEMBER(int64, post_id)
138 // Whether the frame navigation resulted in no change to the documents within
139 // the page. For example, the navigation may have just resulted in scrolling
140 // to a named anchor.
141 IPC_STRUCT_MEMBER(bool, was_within_same_page)
143 // The status code of the HTTP request.
144 IPC_STRUCT_MEMBER(int, http_status_code)
146 // This flag is used to warn if the renderer is displaying an error page,
147 // so that we can set the appropriate page type.
148 IPC_STRUCT_MEMBER(bool, url_is_unreachable)
150 // True if the connection was proxied. In this case, socket_address
151 // will represent the address of the proxy, rather than the remote host.
152 IPC_STRUCT_MEMBER(bool, was_fetched_via_proxy)
154 // Serialized history item state to store in the navigation entry.
155 IPC_STRUCT_MEMBER(content::PageState, page_state)
157 // Original request's URL.
158 IPC_STRUCT_MEMBER(GURL, original_request_url)
160 // User agent override used to navigate.
161 IPC_STRUCT_MEMBER(bool, is_overriding_user_agent)
163 // Notifies the browser that for this navigation, the session history was
164 // successfully cleared.
165 IPC_STRUCT_MEMBER(bool, history_list_was_cleared)
167 // The routing_id of the render view associated with the navigation.
168 // We need to track the RenderViewHost routing_id because of downstream
169 // dependencies (crbug.com/392171 DownloadRequestHandle, SaveFileManager,
170 // ResourceDispatcherHostImpl, MediaStreamUIProxy,
171 // SpeechRecognitionDispatcherHost and possibly others). They look up the view
172 // based on the ID stored in the resource requests. Once those dependencies
173 // are unwound or moved to RenderFrameHost (crbug.com/304341) we can move the
174 // client to be based on the routing_id of the RenderFrameHost.
175 IPC_STRUCT_MEMBER(int, render_view_routing_id)
176 IPC_STRUCT_END()
178 IPC_STRUCT_TRAITS_BEGIN(content::CommonNavigationParams)
179 IPC_STRUCT_TRAITS_MEMBER(url)
180 IPC_STRUCT_TRAITS_MEMBER(referrer)
181 IPC_STRUCT_TRAITS_MEMBER(transition)
182 IPC_STRUCT_TRAITS_MEMBER(navigation_type)
183 IPC_STRUCT_TRAITS_MEMBER(allow_download)
184 IPC_STRUCT_TRAITS_END()
186 IPC_STRUCT_TRAITS_BEGIN(content::RequestNavigationParams)
187 IPC_STRUCT_TRAITS_MEMBER(is_post)
188 IPC_STRUCT_TRAITS_MEMBER(extra_headers)
189 IPC_STRUCT_TRAITS_MEMBER(browser_initiated_post_data)
190 IPC_STRUCT_TRAITS_END()
192 IPC_STRUCT_TRAITS_BEGIN(content::CommitNavigationParams)
193 IPC_STRUCT_TRAITS_MEMBER(page_state)
194 IPC_STRUCT_TRAITS_MEMBER(is_overriding_user_agent)
195 IPC_STRUCT_TRAITS_MEMBER(browser_navigation_start)
196 IPC_STRUCT_TRAITS_END()
198 IPC_STRUCT_BEGIN(FrameMsg_Navigate_Params)
199 // TODO(clamy): investigate which parameters are also needed in PlzNavigate
200 // and move them to the appropriate NavigationParams struct.
202 // These structs contain parameters shared by other navigation IPCs.
203 IPC_STRUCT_MEMBER(content::CommonNavigationParams, common_params)
204 IPC_STRUCT_MEMBER(content::RequestNavigationParams, request_params)
205 IPC_STRUCT_MEMBER(content::CommitNavigationParams, commit_params)
207 // The page_id for this navigation, or -1 if it is a new navigation. Back,
208 // Forward, and Reload navigations should have a valid page_id. If the load
209 // succeeds, then this page_id will be reflected in the resultant
210 // FrameHostMsg_DidCommitProvisionalLoad message.
211 IPC_STRUCT_MEMBER(int32, page_id)
213 // If page_id is -1, then pending_history_list_offset will also be -1.
214 // Otherwise, it contains the offset into the history list corresponding to
215 // the current navigation.
216 IPC_STRUCT_MEMBER(int, pending_history_list_offset)
218 // Informs the RenderView of where its current page contents reside in
219 // session history and the total size of the session history list.
220 IPC_STRUCT_MEMBER(int, current_history_list_offset)
221 IPC_STRUCT_MEMBER(int, current_history_list_length)
223 // Informs the RenderView the session history should be cleared. In that
224 // case, the RenderView needs to notify the browser that the clearing was
225 // succesful when the navigation commits.
226 IPC_STRUCT_MEMBER(bool, should_clear_history_list)
228 // Base URL for use in WebKit's SubstituteData.
229 // Is only used with data: URLs.
230 IPC_STRUCT_MEMBER(GURL, base_url_for_data_url)
232 // History URL for use in WebKit's SubstituteData.
233 // Is only used with data: URLs.
234 IPC_STRUCT_MEMBER(GURL, history_url_for_data_url)
236 // Any redirect URLs that occurred before |url|. Useful for cross-process
237 // navigations; defaults to empty.
238 IPC_STRUCT_MEMBER(std::vector<GURL>, redirects)
240 // Informs the RenderView the pending navigation should replace the current
241 // history entry when it commits. This is used for cross-process redirects so
242 // the transferred navigation can recover the navigation state.
243 IPC_STRUCT_MEMBER(bool, should_replace_current_entry)
245 // The time the request was created. This is used by the old performance
246 // infrastructure to set up DocumentState associated with the RenderView.
247 // TODO(ppi): make it go away.
248 IPC_STRUCT_MEMBER(base::Time, request_time)
250 // The following two members identify a previous request that has been
251 // created before this navigation is being transferred to a new render view.
252 // This serves the purpose of recycling the old request.
253 // Unless this refers to a transferred navigation, these values are -1 and -1.
254 IPC_STRUCT_MEMBER(int, transferred_request_child_id)
255 IPC_STRUCT_MEMBER(int, transferred_request_request_id)
257 // Whether or not this url should be allowed to access local file://
258 // resources.
259 IPC_STRUCT_MEMBER(bool, can_load_local_resources)
261 // If not empty, which frame to navigate.
262 IPC_STRUCT_MEMBER(std::string, frame_to_navigate)
263 IPC_STRUCT_END()
265 IPC_STRUCT_BEGIN(FrameHostMsg_OpenURL_Params)
266 IPC_STRUCT_MEMBER(GURL, url)
267 IPC_STRUCT_MEMBER(content::Referrer, referrer)
268 IPC_STRUCT_MEMBER(WindowOpenDisposition, disposition)
269 IPC_STRUCT_MEMBER(bool, should_replace_current_entry)
270 IPC_STRUCT_MEMBER(bool, user_gesture)
271 IPC_STRUCT_END()
273 // PlzNavigate
274 IPC_STRUCT_BEGIN(FrameHostMsg_BeginNavigation_Params)
275 // TODO(clamy): See if it is possible to define a common struct between this
276 // IPC and ResourceMsg_Request_Params.
278 // The request method: GET, POST, etc.
279 IPC_STRUCT_MEMBER(std::string, method)
281 // Additional HTTP request headers.
282 IPC_STRUCT_MEMBER(std::string, headers)
284 // net::URLRequest load flags (net::LOAD_NORMAL) by default).
285 IPC_STRUCT_MEMBER(int, load_flags)
287 // Optional resource request body (may be null).
288 IPC_STRUCT_MEMBER(scoped_refptr<content::ResourceRequestBody>,
289 request_body)
291 // True if the request was user initiated.
292 IPC_STRUCT_MEMBER(bool, has_user_gesture)
293 IPC_STRUCT_END()
295 #if defined(OS_MACOSX) || defined(OS_ANDROID)
296 // This message is used for supporting popup menus on Mac OS X and Android using
297 // native controls. See the FrameHostMsg_ShowPopup message.
298 IPC_STRUCT_BEGIN(FrameHostMsg_ShowPopup_Params)
299 // Position on the screen.
300 IPC_STRUCT_MEMBER(gfx::Rect, bounds)
302 // The height of each item in the menu.
303 IPC_STRUCT_MEMBER(int, item_height)
305 // The size of the font to use for those items.
306 IPC_STRUCT_MEMBER(double, item_font_size)
308 // The currently selected (displayed) item in the menu.
309 IPC_STRUCT_MEMBER(int, selected_item)
311 // The entire list of items in the popup menu.
312 IPC_STRUCT_MEMBER(std::vector<content::MenuItem>, popup_items)
314 // Whether items should be right-aligned.
315 IPC_STRUCT_MEMBER(bool, right_aligned)
317 // Whether this is a multi-select popup.
318 IPC_STRUCT_MEMBER(bool, allow_multiple_selection)
319 IPC_STRUCT_END()
320 #endif
322 // -----------------------------------------------------------------------------
323 // Messages sent from the browser to the renderer.
325 // Notifies the embedding frame that a new CompositorFrame is ready to be
326 // presented. When the frame finishes presenting, a matching
327 // FrameHostMsg_CompositorFrameSwappedACK should be sent back to the
328 // RenderViewHost that was produced the CompositorFrame.
330 // This is used in the ubercomp compositing path.
331 IPC_MESSAGE_ROUTED1(FrameMsg_CompositorFrameSwapped,
332 FrameMsg_CompositorFrameSwapped_Params /* params */)
334 // Notifies the embedding frame that the process rendering the child frame's
335 // contents has terminated.
336 IPC_MESSAGE_ROUTED0(FrameMsg_ChildFrameProcessGone)
338 // Sent in response to a FrameHostMsg_ContextMenu to let the renderer know that
339 // the menu has been closed.
340 IPC_MESSAGE_ROUTED1(FrameMsg_ContextMenuClosed,
341 content::CustomContextMenuContext /* custom_context */)
343 // Executes custom context menu action that was provided from Blink.
344 IPC_MESSAGE_ROUTED2(FrameMsg_CustomContextMenuAction,
345 content::CustomContextMenuContext /* custom_context */,
346 unsigned /* action */)
348 // Requests that the RenderFrame or RenderFrameProxy sets its opener to null.
349 IPC_MESSAGE_ROUTED0(FrameMsg_DisownOpener)
351 // Instructs the renderer to create a new RenderFrame object with |routing_id|.
352 // The new frame should be created as a child of the object identified by
353 // |parent_routing_id| or as top level if that is MSG_ROUTING_NONE.
354 IPC_MESSAGE_CONTROL2(FrameMsg_NewFrame,
355 int /* routing_id */,
356 int /* parent_routing_id */)
358 // Instructs the renderer to create a new RenderFrameProxy object with
359 // |routing_id|. The new proxy should be created as a child of the object
360 // identified by |parent_routing_id| or as top level if that is
361 // MSG_ROUTING_NONE.
362 IPC_MESSAGE_CONTROL3(FrameMsg_NewFrameProxy,
363 int /* routing_id */,
364 int /* parent_routing_id */,
365 int /* render_view_routing_id */)
367 // Tells the renderer to perform the specified navigation, interrupting any
368 // existing navigation.
369 IPC_MESSAGE_ROUTED1(FrameMsg_Navigate, FrameMsg_Navigate_Params)
371 // Instructs the renderer to invoke the frame's beforeunload event handler.
372 // Expects the result to be returned via FrameHostMsg_BeforeUnload_ACK.
373 IPC_MESSAGE_ROUTED0(FrameMsg_BeforeUnload)
375 // Instructs the frame to swap out for a cross-site transition, including
376 // running the unload event handler and creating a RenderFrameProxy with the
377 // given |proxy_routing_id|. Expects a SwapOut_ACK message when finished.
378 IPC_MESSAGE_ROUTED1(FrameMsg_SwapOut,
379 int /* proxy_routing_id */)
381 // Instructs the frame to stop the load in progress, if any.
382 IPC_MESSAGE_ROUTED0(FrameMsg_Stop)
384 // Request for the renderer to insert CSS into the frame.
385 IPC_MESSAGE_ROUTED1(FrameMsg_CSSInsertRequest,
386 std::string /* css */)
388 // Request for the renderer to execute JavaScript in the frame's context.
390 // javascript is the string containing the JavaScript to be executed in the
391 // target frame's context.
393 // If the third parameter is true the result is sent back to the browser using
394 // the message FrameHostMsg_JavaScriptExecuteResponse.
395 // FrameHostMsg_JavaScriptExecuteResponse is passed the ID parameter so that the
396 // host can uniquely identify the request.
397 IPC_MESSAGE_ROUTED3(FrameMsg_JavaScriptExecuteRequest,
398 base::string16, /* javascript */
399 int, /* ID */
400 bool /* if true, a reply is requested */)
402 // ONLY FOR TESTS: Same as above but adds a fake UserGestureindicator around
403 // execution. (crbug.com/408426)
404 IPC_MESSAGE_ROUTED3(FrameMsg_JavaScriptExecuteRequestForTests,
405 base::string16, /* javascript */
406 int, /* ID */
407 bool /* if true, a reply is requested */)
409 // Selects between the given start and end offsets in the currently focused
410 // editable field.
411 IPC_MESSAGE_ROUTED2(FrameMsg_SetEditableSelectionOffsets,
412 int /* start */,
413 int /* end */)
415 // Requests a navigation to the supplied markup, in an iframe with sandbox
416 // attributes.
417 IPC_MESSAGE_ROUTED1(FrameMsg_SetupTransitionView,
418 std::string /* markup */)
420 // Tells the renderer to hide the elements specified by the supplied CSS
421 // selector, and activates any exiting-transition stylesheets.
422 IPC_MESSAGE_ROUTED1(FrameMsg_BeginExitTransition,
423 std::string /* css_selector */)
425 // Tells the renderer to reload the frame, optionally ignoring the cache while
426 // doing so.
427 IPC_MESSAGE_ROUTED1(FrameMsg_Reload,
428 bool /* ignore_cache */)
430 // Notifies the color chooser client that the user selected a color.
431 IPC_MESSAGE_ROUTED2(FrameMsg_DidChooseColorResponse, unsigned, SkColor)
433 // Notifies the color chooser client that the color chooser has ended.
434 IPC_MESSAGE_ROUTED1(FrameMsg_DidEndColorChooser, unsigned)
436 // Notifies the corresponding RenderFrameProxy object to replace itself with the
437 // RenderFrame object it is associated with.
438 IPC_MESSAGE_ROUTED0(FrameMsg_DeleteProxy)
440 // Request the text surrounding the selection with a |max_length|. The response
441 // will be sent via FrameHostMsg_TextSurroundingSelectionResponse.
442 IPC_MESSAGE_ROUTED1(FrameMsg_TextSurroundingSelectionRequest,
443 size_t /* max_length */)
445 // Tells the renderer to insert a link to the specified stylesheet. This is
446 // needed to support navigation transitions.
447 IPC_MESSAGE_ROUTED1(FrameMsg_AddStyleSheetByURL, std::string)
449 // Change the accessibility mode in the renderer process.
450 IPC_MESSAGE_ROUTED1(FrameMsg_SetAccessibilityMode,
451 AccessibilityMode)
453 #if defined(OS_ANDROID)
455 // External popup menus.
456 IPC_MESSAGE_ROUTED2(FrameMsg_SelectPopupMenuItems,
457 bool /* user canceled the popup */,
458 std::vector<int> /* selected indices */)
460 #elif defined(OS_MACOSX)
462 // External popup menus.
463 IPC_MESSAGE_ROUTED1(FrameMsg_SelectPopupMenuItem,
464 int /* selected index, -1 means no selection */)
466 #endif
468 // PlzNavigate
469 // Tells the renderer that a navigation is ready to commit. The renderer should
470 // request |stream_url| to get access to the stream containing the body of the
471 // response.
472 IPC_MESSAGE_ROUTED4(FrameMsg_CommitNavigation,
473 content::ResourceResponseHead, /* response */
474 GURL, /* stream_url */
475 content::CommonNavigationParams, /* common_params */
476 content::CommitNavigationParams /* commit_params */)
478 // -----------------------------------------------------------------------------
479 // Messages sent from the renderer to the browser.
481 // Blink and JavaScript error messages to log to the console
482 // or debugger UI.
483 IPC_MESSAGE_ROUTED4(FrameHostMsg_AddMessageToConsole,
484 int32, /* log level */
485 base::string16, /* msg */
486 int32, /* line number */
487 base::string16 /* source id */ )
489 // Sent by the renderer when a child frame is created in the renderer.
491 // Each of these messages will have a corresponding FrameHostMsg_Detach message
492 // sent when the frame is detached from the DOM.
493 IPC_SYNC_MESSAGE_CONTROL2_1(FrameHostMsg_CreateChildFrame,
494 int32 /* parent_routing_id */,
495 std::string /* frame_name */,
496 int32 /* new_routing_id */)
498 // Sent by the renderer to the parent RenderFrameHost when a child frame is
499 // detached from the DOM.
500 IPC_MESSAGE_ROUTED0(FrameHostMsg_Detach)
502 // Sent by the renderer when the frame becomes focused.
503 IPC_MESSAGE_ROUTED0(FrameHostMsg_FrameFocused)
505 // Sent when the renderer starts a provisional load for a frame.
506 // |is_transition_navigation| signals that the frame has defined transition
507 // elements which can be animated by the navigation destination to provide
508 // a transition effect during load.
509 IPC_MESSAGE_ROUTED2(FrameHostMsg_DidStartProvisionalLoadForFrame,
510 GURL /* url */,
511 bool /* is_transition_navigation */)
513 // Sent when the renderer fails a provisional load with an error.
514 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidFailProvisionalLoadWithError,
515 FrameHostMsg_DidFailProvisionalLoadWithError_Params)
517 // Notifies the browser that a frame in the view has changed. This message
518 // has a lot of parameters and is packed/unpacked by functions defined in
519 // render_messages.h.
520 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidCommitProvisionalLoad,
521 FrameHostMsg_DidCommitProvisionalLoad_Params)
523 // Notifies the browser that a document has been loaded.
524 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidFinishDocumentLoad)
526 IPC_MESSAGE_ROUTED3(FrameHostMsg_DidFailLoadWithError,
527 GURL /* validated_url */,
528 int /* error_code */,
529 base::string16 /* error_description */)
531 // Sent when the renderer starts loading the page. |to_different_document| will
532 // be true unless the load is a fragment navigation, or triggered by
533 // history.pushState/replaceState.
534 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidStartLoading,
535 bool /* to_different_document */)
537 // Sent when the renderer is done loading a page.
538 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidStopLoading)
540 // Sent when the renderer changed the progress of a load.
541 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidChangeLoadProgress,
542 double /* load_progress */)
544 // Requests that the given URL be opened in the specified manner.
545 IPC_MESSAGE_ROUTED1(FrameHostMsg_OpenURL, FrameHostMsg_OpenURL_Params)
547 // Notifies the browser that a frame finished loading.
548 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidFinishLoad,
549 GURL /* validated_url */)
551 // Sent when after the onload handler has been invoked for the document
552 // in this frame. Sent for top-level frames.
553 IPC_MESSAGE_ROUTED0(FrameHostMsg_DocumentOnLoadCompleted)
555 // Notifies that the initial empty document of a view has been accessed.
556 // After this, it is no longer safe to show a pending navigation's URL without
557 // making a URL spoof possible.
558 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidAccessInitialDocument)
560 // Sent when the frame sets its opener to null, disowning it for the lifetime of
561 // the window. Sent for top-level frames.
562 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidDisownOpener)
564 // Notifies the browser that a page id was assigned.
565 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidAssignPageId,
566 int32 /* page_id */)
568 // Changes the title for the page in the UI when the page is navigated or the
569 // title changes. Sent for top-level frames.
570 IPC_MESSAGE_ROUTED3(FrameHostMsg_UpdateTitle,
571 int32 /* page_id */,
572 base::string16 /* title */,
573 blink::WebTextDirection /* title direction */)
575 // Change the encoding name of the page in UI when the page has detected
576 // proper encoding name. Sent for top-level frames.
577 IPC_MESSAGE_ROUTED1(FrameHostMsg_UpdateEncoding,
578 std::string /* new encoding name */)
580 // Following message is used to communicate the values received by the
581 // callback binding the JS to Cpp.
582 // An instance of browser that has an automation host listening to it can
583 // have a javascript send a native value (string, number, boolean) to the
584 // listener in Cpp. (DomAutomationController)
585 IPC_MESSAGE_ROUTED2(FrameHostMsg_DomOperationResponse,
586 std::string /* json_string */,
587 int /* automation_id */)
589 // Sent to the browser when the renderer detects it is blocked on a pepper
590 // plugin message for too long. This is also sent when it becomes unhung
591 // (according to the value of is_hung). The browser can give the user the
592 // option of killing the plugin.
593 IPC_MESSAGE_ROUTED3(FrameHostMsg_PepperPluginHung,
594 int /* plugin_child_id */,
595 base::FilePath /* path */,
596 bool /* is_hung */)
598 // Sent by the renderer process to indicate that a plugin instance has crashed.
599 // Note: |plugin_pid| should not be trusted. The corresponding process has
600 // probably died. Moreover, the ID may have been reused by a new process. Any
601 // usage other than displaying it in a prompt to the user is very likely to be
602 // wrong.
603 IPC_MESSAGE_ROUTED2(FrameHostMsg_PluginCrashed,
604 base::FilePath /* plugin_path */,
605 base::ProcessId /* plugin_pid */)
607 // Return information about a plugin for the given URL and MIME
608 // type. If there is no matching plugin, |found| is false.
609 // |actual_mime_type| is the actual mime type supported by the
610 // found plugin.
611 IPC_SYNC_MESSAGE_CONTROL4_3(FrameHostMsg_GetPluginInfo,
612 int /* render_frame_id */,
613 GURL /* url */,
614 GURL /* page_url */,
615 std::string /* mime_type */,
616 bool /* found */,
617 content::WebPluginInfo /* plugin info */,
618 std::string /* actual_mime_type */)
620 // A renderer sends this to the browser process when it wants to
621 // create a plugin. The browser will create the plugin process if
622 // necessary, and will return a handle to the channel on success.
623 // On error an empty string is returned.
624 IPC_SYNC_MESSAGE_CONTROL4_2(FrameHostMsg_OpenChannelToPlugin,
625 int /* render_frame_id */,
626 GURL /* url */,
627 GURL /* page_url */,
628 std::string /* mime_type */,
629 IPC::ChannelHandle /* channel_handle */,
630 content::WebPluginInfo /* info */)
632 // Acknowledge that we presented an ubercomp frame.
634 // See FrameMsg_CompositorFrameSwapped
635 IPC_MESSAGE_ROUTED1(FrameHostMsg_CompositorFrameSwappedACK,
636 FrameHostMsg_CompositorFrameSwappedACK_Params /* params */)
638 // Provides the result from handling BeforeUnload. |proceed| matches the return
639 // value of the frame's beforeunload handler: true if the user decided to
640 // proceed with leaving the page.
641 IPC_MESSAGE_ROUTED3(FrameHostMsg_BeforeUnload_ACK,
642 bool /* proceed */,
643 base::TimeTicks /* before_unload_start_time */,
644 base::TimeTicks /* before_unload_end_time */)
646 // Indicates that the current frame has swapped out, after a SwapOut message.
647 IPC_MESSAGE_ROUTED0(FrameHostMsg_SwapOut_ACK)
649 IPC_MESSAGE_ROUTED1(FrameHostMsg_ReclaimCompositorResources,
650 FrameHostMsg_ReclaimCompositorResources_Params /* params */)
652 // Forwards an input event to a child.
653 // TODO(nick): Temporary bridge, revisit once the browser process can route
654 // input directly to subframes. http://crbug.com/339659
655 IPC_MESSAGE_ROUTED1(FrameHostMsg_ForwardInputEvent,
656 IPC::WebInputEventPointer /* event */)
658 // Used to tell the parent that the user right clicked on an area of the
659 // content area, and a context menu should be shown for it. The params
660 // object contains information about the node(s) that were selected when the
661 // user right clicked.
662 IPC_MESSAGE_ROUTED1(FrameHostMsg_ContextMenu, content::ContextMenuParams)
664 // Initial drawing parameters for a child frame that has been swapped out to
665 // another process.
666 IPC_MESSAGE_ROUTED2(FrameHostMsg_InitializeChildFrame,
667 gfx::Rect /* frame_rect */,
668 float /* scale_factor */)
670 // Response for FrameMsg_JavaScriptExecuteRequest, sent when a reply was
671 // requested. The ID is the parameter supplied to
672 // FrameMsg_JavaScriptExecuteRequest. The result has the value returned by the
673 // script as its only element, one of Null, Boolean, Integer, Real, Date, or
674 // String.
675 IPC_MESSAGE_ROUTED2(FrameHostMsg_JavaScriptExecuteResponse,
676 int /* id */,
677 base::ListValue /* result */)
679 // A request to run a JavaScript dialog.
680 IPC_SYNC_MESSAGE_ROUTED4_2(FrameHostMsg_RunJavaScriptMessage,
681 base::string16 /* in - alert message */,
682 base::string16 /* in - default prompt */,
683 GURL /* in - originating page URL */,
684 content::JavaScriptMessageType /* in - type */,
685 bool /* out - success */,
686 base::string16 /* out - user_input field */)
688 // Displays a dialog to confirm that the user wants to navigate away from the
689 // page. Replies true if yes, and false otherwise. The reply string is ignored,
690 // but is included so that we can use OnJavaScriptMessageBoxClosed.
691 IPC_SYNC_MESSAGE_ROUTED3_2(FrameHostMsg_RunBeforeUnloadConfirm,
692 GURL, /* in - originating frame URL */
693 base::string16 /* in - alert message */,
694 bool /* in - is a reload */,
695 bool /* out - success */,
696 base::string16 /* out - This is ignored.*/)
698 // Asks the browser to open the color chooser.
699 IPC_MESSAGE_ROUTED3(FrameHostMsg_OpenColorChooser,
700 int /* id */,
701 SkColor /* color */,
702 std::vector<content::ColorSuggestion> /* suggestions */)
704 // Asks the browser to end the color chooser.
705 IPC_MESSAGE_ROUTED1(FrameHostMsg_EndColorChooser, int /* id */)
707 // Change the selected color in the color chooser.
708 IPC_MESSAGE_ROUTED2(FrameHostMsg_SetSelectedColorInColorChooser,
709 int /* id */,
710 SkColor /* color */)
712 // Notifies the browser that media has started/stopped playing.
713 IPC_MESSAGE_ROUTED3(FrameHostMsg_MediaPlayingNotification,
714 int64 /* player_cookie, distinguishes instances */,
715 bool /* has_video */,
716 bool /* has_audio */)
718 IPC_MESSAGE_ROUTED1(FrameHostMsg_MediaPausedNotification,
719 int64 /* player_cookie, distinguishes instances */)
721 // Notify browser the theme color has been changed.
722 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidChangeThemeColor,
723 SkColor /* theme_color */)
725 // Response for FrameMsg_TextSurroundingSelectionRequest, |startOffset| and
726 // |endOffset| are the offsets of the selection in the returned |content|.
727 IPC_MESSAGE_ROUTED3(FrameHostMsg_TextSurroundingSelectionResponse,
728 base::string16, /* content */
729 size_t, /* startOffset */
730 size_t /* endOffset */)
732 // Notifies the browser that the renderer has a pending navigation transition.
733 // The string parameters are all UTF8.
734 IPC_MESSAGE_CONTROL4(FrameHostMsg_AddNavigationTransitionData,
735 int /* render_frame_id */,
736 std::string /* allowed_destination_host_pattern */,
737 std::string /* selector */,
738 std::string /* markup */)
740 // PlzNavigate
741 // Tells the browser to perform a navigation.
742 IPC_MESSAGE_ROUTED2(FrameHostMsg_BeginNavigation,
743 FrameHostMsg_BeginNavigation_Params,
744 content::CommonNavigationParams)
746 // Sent once a paint happens after the first non empty layout. In other words
747 // after the frame has painted something.
748 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidFirstVisuallyNonEmptyPaint)
750 #if defined(OS_MACOSX) || defined(OS_ANDROID)
752 // Message to show/hide a popup menu using native controls.
753 IPC_MESSAGE_ROUTED1(FrameHostMsg_ShowPopup,
754 FrameHostMsg_ShowPopup_Params)
755 IPC_MESSAGE_ROUTED0(FrameHostMsg_HidePopup)
757 #endif