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