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"
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
,
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
)
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
)
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
)
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://
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
)
265 IPC_STRUCT_BEGIN(FrameHostMsg_AddNavigationTransitionData_Params
)
266 IPC_STRUCT_MEMBER(int, render_frame_id
)
267 IPC_STRUCT_MEMBER(std::string
, allowed_destination_host_pattern
)
268 IPC_STRUCT_MEMBER(std::string
, selector
)
269 IPC_STRUCT_MEMBER(std::string
, markup
)
270 IPC_STRUCT_MEMBER(std::vector
<std::string
>, names
)
271 IPC_STRUCT_MEMBER(std::vector
<gfx::Rect
>, rects
)
274 IPC_STRUCT_BEGIN(FrameHostMsg_OpenURL_Params
)
275 IPC_STRUCT_MEMBER(GURL
, url
)
276 IPC_STRUCT_MEMBER(content::Referrer
, referrer
)
277 IPC_STRUCT_MEMBER(WindowOpenDisposition
, disposition
)
278 IPC_STRUCT_MEMBER(bool, should_replace_current_entry
)
279 IPC_STRUCT_MEMBER(bool, user_gesture
)
283 IPC_STRUCT_BEGIN(FrameHostMsg_BeginNavigation_Params
)
284 // TODO(clamy): See if it is possible to define a common struct between this
285 // IPC and ResourceMsg_Request_Params.
287 // The request method: GET, POST, etc.
288 IPC_STRUCT_MEMBER(std::string
, method
)
290 // Additional HTTP request headers.
291 IPC_STRUCT_MEMBER(std::string
, headers
)
293 // net::URLRequest load flags (net::LOAD_NORMAL) by default).
294 IPC_STRUCT_MEMBER(int, load_flags
)
296 // Optional resource request body (may be null).
297 IPC_STRUCT_MEMBER(scoped_refptr
<content::ResourceRequestBody
>,
300 // True if the request was user initiated.
301 IPC_STRUCT_MEMBER(bool, has_user_gesture
)
304 #if defined(OS_MACOSX) || defined(OS_ANDROID)
305 // This message is used for supporting popup menus on Mac OS X and Android using
306 // native controls. See the FrameHostMsg_ShowPopup message.
307 IPC_STRUCT_BEGIN(FrameHostMsg_ShowPopup_Params
)
308 // Position on the screen.
309 IPC_STRUCT_MEMBER(gfx::Rect
, bounds
)
311 // The height of each item in the menu.
312 IPC_STRUCT_MEMBER(int, item_height
)
314 // The size of the font to use for those items.
315 IPC_STRUCT_MEMBER(double, item_font_size
)
317 // The currently selected (displayed) item in the menu.
318 IPC_STRUCT_MEMBER(int, selected_item
)
320 // The entire list of items in the popup menu.
321 IPC_STRUCT_MEMBER(std::vector
<content::MenuItem
>, popup_items
)
323 // Whether items should be right-aligned.
324 IPC_STRUCT_MEMBER(bool, right_aligned
)
326 // Whether this is a multi-select popup.
327 IPC_STRUCT_MEMBER(bool, allow_multiple_selection
)
331 // -----------------------------------------------------------------------------
332 // Messages sent from the browser to the renderer.
334 // Notifies the embedding frame that a new CompositorFrame is ready to be
335 // presented. When the frame finishes presenting, a matching
336 // FrameHostMsg_CompositorFrameSwappedACK should be sent back to the
337 // RenderViewHost that was produced the CompositorFrame.
339 // This is used in the ubercomp compositing path.
340 IPC_MESSAGE_ROUTED1(FrameMsg_CompositorFrameSwapped
,
341 FrameMsg_CompositorFrameSwapped_Params
/* params */)
343 // Notifies the embedding frame that the process rendering the child frame's
344 // contents has terminated.
345 IPC_MESSAGE_ROUTED0(FrameMsg_ChildFrameProcessGone
)
347 // Sent in response to a FrameHostMsg_ContextMenu to let the renderer know that
348 // the menu has been closed.
349 IPC_MESSAGE_ROUTED1(FrameMsg_ContextMenuClosed
,
350 content::CustomContextMenuContext
/* custom_context */)
352 // Executes custom context menu action that was provided from Blink.
353 IPC_MESSAGE_ROUTED2(FrameMsg_CustomContextMenuAction
,
354 content::CustomContextMenuContext
/* custom_context */,
355 unsigned /* action */)
357 // Requests that the RenderFrame or RenderFrameProxy sets its opener to null.
358 IPC_MESSAGE_ROUTED0(FrameMsg_DisownOpener
)
360 // Instructs the renderer to create a new RenderFrame object with |routing_id|.
361 // The new frame should be created as a child of the object identified by
362 // |parent_routing_id| or as top level if that is MSG_ROUTING_NONE.
363 // If a valid |proxy_routing_id| is provided, the new frame will be configured
364 // to replace the proxy on commit.
365 IPC_MESSAGE_CONTROL3(FrameMsg_NewFrame
,
366 int /* routing_id */,
367 int /* parent_routing_id */,
368 int /* proxy_routing_id */)
370 // Instructs the renderer to create a new RenderFrameProxy object with
371 // |routing_id|. The new proxy should be created as a child of the object
372 // identified by |parent_routing_id| or as top level if that is
374 IPC_MESSAGE_CONTROL3(FrameMsg_NewFrameProxy
,
375 int /* routing_id */,
376 int /* parent_routing_id */,
377 int /* render_view_routing_id */)
379 // Tells the renderer to perform the specified navigation, interrupting any
380 // existing navigation.
381 IPC_MESSAGE_ROUTED1(FrameMsg_Navigate
, FrameMsg_Navigate_Params
)
383 // Instructs the renderer to invoke the frame's beforeunload event handler.
384 // Expects the result to be returned via FrameHostMsg_BeforeUnload_ACK.
385 IPC_MESSAGE_ROUTED0(FrameMsg_BeforeUnload
)
387 // Instructs the frame to swap out for a cross-site transition, including
388 // running the unload event handler and creating a RenderFrameProxy with the
389 // given |proxy_routing_id|. Expects a SwapOut_ACK message when finished.
390 IPC_MESSAGE_ROUTED1(FrameMsg_SwapOut
,
391 int /* proxy_routing_id */)
393 // Instructs the frame to stop the load in progress, if any.
394 IPC_MESSAGE_ROUTED0(FrameMsg_Stop
)
396 // Request for the renderer to insert CSS into the frame.
397 IPC_MESSAGE_ROUTED1(FrameMsg_CSSInsertRequest
,
398 std::string
/* css */)
400 // Request for the renderer to execute JavaScript in the frame's context.
402 // javascript is the string containing the JavaScript to be executed in the
403 // target frame's context.
405 // If the third parameter is true the result is sent back to the browser using
406 // the message FrameHostMsg_JavaScriptExecuteResponse.
407 // FrameHostMsg_JavaScriptExecuteResponse is passed the ID parameter so that the
408 // host can uniquely identify the request.
409 IPC_MESSAGE_ROUTED3(FrameMsg_JavaScriptExecuteRequest
,
410 base::string16
, /* javascript */
412 bool /* if true, a reply is requested */)
414 // ONLY FOR TESTS: Same as above but adds a fake UserGestureindicator around
415 // execution. (crbug.com/408426)
416 IPC_MESSAGE_ROUTED3(FrameMsg_JavaScriptExecuteRequestForTests
,
417 base::string16
, /* javascript */
419 bool /* if true, a reply is requested */)
421 // Selects between the given start and end offsets in the currently focused
423 IPC_MESSAGE_ROUTED2(FrameMsg_SetEditableSelectionOffsets
,
427 // Requests a navigation to the supplied markup, in an iframe with sandbox
429 IPC_MESSAGE_ROUTED1(FrameMsg_SetupTransitionView
,
430 std::string
/* markup */)
432 // Tells the renderer to hide the elements specified by the supplied CSS
433 // selector, and activates any exiting-transition stylesheets.
434 IPC_MESSAGE_ROUTED1(FrameMsg_BeginExitTransition
,
435 std::string
/* css_selector */)
437 // Tells the renderer to reload the frame, optionally ignoring the cache while
439 IPC_MESSAGE_ROUTED1(FrameMsg_Reload
,
440 bool /* ignore_cache */)
442 // Notifies the color chooser client that the user selected a color.
443 IPC_MESSAGE_ROUTED2(FrameMsg_DidChooseColorResponse
, unsigned, SkColor
)
445 // Notifies the color chooser client that the color chooser has ended.
446 IPC_MESSAGE_ROUTED1(FrameMsg_DidEndColorChooser
, unsigned)
448 // Notifies the corresponding RenderFrameProxy object to replace itself with the
449 // RenderFrame object it is associated with.
450 IPC_MESSAGE_ROUTED0(FrameMsg_DeleteProxy
)
452 // Request the text surrounding the selection with a |max_length|. The response
453 // will be sent via FrameHostMsg_TextSurroundingSelectionResponse.
454 IPC_MESSAGE_ROUTED1(FrameMsg_TextSurroundingSelectionRequest
,
455 size_t /* max_length */)
457 // Tells the renderer to insert a link to the specified stylesheet. This is
458 // needed to support navigation transitions.
459 IPC_MESSAGE_ROUTED1(FrameMsg_AddStyleSheetByURL
, std::string
)
461 // Change the accessibility mode in the renderer process.
462 IPC_MESSAGE_ROUTED1(FrameMsg_SetAccessibilityMode
,
465 #if defined(OS_ANDROID)
467 // External popup menus.
468 IPC_MESSAGE_ROUTED2(FrameMsg_SelectPopupMenuItems
,
469 bool /* user canceled the popup */,
470 std::vector
<int> /* selected indices */)
472 #elif defined(OS_MACOSX)
474 // External popup menus.
475 IPC_MESSAGE_ROUTED1(FrameMsg_SelectPopupMenuItem
,
476 int /* selected index, -1 means no selection */)
481 // Tells the renderer that a navigation has been requested.
482 IPC_MESSAGE_ROUTED2(FrameMsg_RequestNavigation
,
483 content::CommonNavigationParams
, /* common_params */
484 content::RequestNavigationParams
/* request_params */)
487 // Tells the renderer that a navigation is ready to commit. The renderer should
488 // request |stream_url| to get access to the stream containing the body of the
490 IPC_MESSAGE_ROUTED4(FrameMsg_CommitNavigation
,
491 content::ResourceResponseHead
, /* response */
492 GURL
, /* stream_url */
493 content::CommonNavigationParams
, /* common_params */
494 content::CommitNavigationParams
/* commit_params */)
496 #if defined(ENABLE_PLUGINS)
497 // Notifies the renderer of updates to the Plugin Power Saver origin whitelist.
498 IPC_MESSAGE_ROUTED1(FrameMsg_UpdatePluginContentOriginWhitelist
,
499 std::set
<GURL
> /* origin_whitelist */)
500 #endif // defined(ENABLE_PLUGINS)
502 // -----------------------------------------------------------------------------
503 // Messages sent from the renderer to the browser.
505 // Blink and JavaScript error messages to log to the console
507 IPC_MESSAGE_ROUTED4(FrameHostMsg_AddMessageToConsole
,
508 int32
, /* log level */
509 base::string16
, /* msg */
510 int32
, /* line number */
511 base::string16
/* source id */ )
513 // Sent by the renderer when a child frame is created in the renderer.
515 // Each of these messages will have a corresponding FrameHostMsg_Detach message
516 // sent when the frame is detached from the DOM.
517 IPC_SYNC_MESSAGE_CONTROL2_1(FrameHostMsg_CreateChildFrame
,
518 int32
/* parent_routing_id */,
519 std::string
/* frame_name */,
520 int32
/* new_routing_id */)
522 // Sent by the renderer to the parent RenderFrameHost when a child frame is
523 // detached from the DOM.
524 IPC_MESSAGE_ROUTED0(FrameHostMsg_Detach
)
526 // Sent by the renderer when the frame becomes focused.
527 IPC_MESSAGE_ROUTED0(FrameHostMsg_FrameFocused
)
529 // Sent when the renderer starts a provisional load for a frame.
530 // |is_transition_navigation| signals that the frame has defined transition
531 // elements which can be animated by the navigation destination to provide
532 // a transition effect during load.
533 IPC_MESSAGE_ROUTED2(FrameHostMsg_DidStartProvisionalLoadForFrame
,
535 bool /* is_transition_navigation */)
537 // Sent when the renderer fails a provisional load with an error.
538 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidFailProvisionalLoadWithError
,
539 FrameHostMsg_DidFailProvisionalLoadWithError_Params
)
541 // Notifies the browser that a frame in the view has changed. This message
542 // has a lot of parameters and is packed/unpacked by functions defined in
543 // render_messages.h.
544 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidCommitProvisionalLoad
,
545 FrameHostMsg_DidCommitProvisionalLoad_Params
)
547 // Notifies the browser that a document has been loaded.
548 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidFinishDocumentLoad
)
550 IPC_MESSAGE_ROUTED3(FrameHostMsg_DidFailLoadWithError
,
551 GURL
/* validated_url */,
552 int /* error_code */,
553 base::string16
/* error_description */)
555 // Sent when the renderer starts loading the page. |to_different_document| will
556 // be true unless the load is a fragment navigation, or triggered by
557 // history.pushState/replaceState.
558 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidStartLoading
,
559 bool /* to_different_document */)
561 // Sent when the renderer is done loading a page.
562 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidStopLoading
)
564 // Sent when the renderer changed the progress of a load.
565 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidChangeLoadProgress
,
566 double /* load_progress */)
568 // Requests that the given URL be opened in the specified manner.
569 IPC_MESSAGE_ROUTED1(FrameHostMsg_OpenURL
, FrameHostMsg_OpenURL_Params
)
571 // Notifies the browser that a frame finished loading.
572 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidFinishLoad
,
573 GURL
/* validated_url */)
575 // Sent when after the onload handler has been invoked for the document
576 // in this frame. Sent for top-level frames.
577 IPC_MESSAGE_ROUTED0(FrameHostMsg_DocumentOnLoadCompleted
)
579 // Notifies that the initial empty document of a view has been accessed.
580 // After this, it is no longer safe to show a pending navigation's URL without
581 // making a URL spoof possible.
582 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidAccessInitialDocument
)
584 // Sent when the frame sets its opener to null, disowning it for the lifetime of
585 // the window. Sent for top-level frames.
586 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidDisownOpener
)
588 // Notifies the browser that a page id was assigned.
589 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidAssignPageId
,
592 // Changes the title for the page in the UI when the page is navigated or the
593 // title changes. Sent for top-level frames.
594 IPC_MESSAGE_ROUTED2(FrameHostMsg_UpdateTitle
,
595 base::string16
/* title */,
596 blink::WebTextDirection
/* title direction */)
598 // Change the encoding name of the page in UI when the page has detected
599 // proper encoding name. Sent for top-level frames.
600 IPC_MESSAGE_ROUTED1(FrameHostMsg_UpdateEncoding
,
601 std::string
/* new encoding name */)
603 // Following message is used to communicate the values received by the
604 // callback binding the JS to Cpp.
605 // An instance of browser that has an automation host listening to it can
606 // have a javascript send a native value (string, number, boolean) to the
607 // listener in Cpp. (DomAutomationController)
608 IPC_MESSAGE_ROUTED2(FrameHostMsg_DomOperationResponse
,
609 std::string
/* json_string */,
610 int /* automation_id */)
612 #if defined(ENABLE_PLUGINS)
613 // Sent to the browser when the renderer detects it is blocked on a pepper
614 // plugin message for too long. This is also sent when it becomes unhung
615 // (according to the value of is_hung). The browser can give the user the
616 // option of killing the plugin.
617 IPC_MESSAGE_ROUTED3(FrameHostMsg_PepperPluginHung
,
618 int /* plugin_child_id */,
619 base::FilePath
/* path */,
622 // Sent by the renderer process to indicate that a plugin instance has crashed.
623 // Note: |plugin_pid| should not be trusted. The corresponding process has
624 // probably died. Moreover, the ID may have been reused by a new process. Any
625 // usage other than displaying it in a prompt to the user is very likely to be
627 IPC_MESSAGE_ROUTED2(FrameHostMsg_PluginCrashed
,
628 base::FilePath
/* plugin_path */,
629 base::ProcessId
/* plugin_pid */)
631 // Return information about a plugin for the given URL and MIME
632 // type. If there is no matching plugin, |found| is false.
633 // |actual_mime_type| is the actual mime type supported by the
635 IPC_SYNC_MESSAGE_CONTROL4_3(FrameHostMsg_GetPluginInfo
,
636 int /* render_frame_id */,
639 std::string
/* mime_type */,
641 content::WebPluginInfo
/* plugin info */,
642 std::string
/* actual_mime_type */)
644 // A renderer sends this to the browser process when it wants to temporarily
645 // whitelist an origin's plugin content as essential. This temporary whitelist
646 // is specific to a top level frame, and is cleared when the whitelisting
647 // RenderFrame is destroyed.
648 IPC_MESSAGE_ROUTED1(FrameHostMsg_PluginContentOriginAllowed
,
649 GURL
/* content_origin */)
650 #endif // defined(ENABLE_PLUGINS)
652 // A renderer sends this to the browser process when it wants to
653 // create a plugin. The browser will create the plugin process if
654 // necessary, and will return a handle to the channel on success.
655 // On error an empty string is returned.
656 IPC_SYNC_MESSAGE_CONTROL4_2(FrameHostMsg_OpenChannelToPlugin
,
657 int /* render_frame_id */,
660 std::string
/* mime_type */,
661 IPC::ChannelHandle
/* channel_handle */,
662 content::WebPluginInfo
/* info */)
664 // Acknowledge that we presented an ubercomp frame.
666 // See FrameMsg_CompositorFrameSwapped
667 IPC_MESSAGE_ROUTED1(FrameHostMsg_CompositorFrameSwappedACK
,
668 FrameHostMsg_CompositorFrameSwappedACK_Params
/* params */)
670 // Provides the result from handling BeforeUnload. |proceed| matches the return
671 // value of the frame's beforeunload handler: true if the user decided to
672 // proceed with leaving the page.
673 IPC_MESSAGE_ROUTED3(FrameHostMsg_BeforeUnload_ACK
,
675 base::TimeTicks
/* before_unload_start_time */,
676 base::TimeTicks
/* before_unload_end_time */)
678 // Indicates that the current frame has swapped out, after a SwapOut message.
679 IPC_MESSAGE_ROUTED0(FrameHostMsg_SwapOut_ACK
)
681 IPC_MESSAGE_ROUTED1(FrameHostMsg_ReclaimCompositorResources
,
682 FrameHostMsg_ReclaimCompositorResources_Params
/* params */)
684 // Forwards an input event to a child.
685 // TODO(nick): Temporary bridge, revisit once the browser process can route
686 // input directly to subframes. http://crbug.com/339659
687 IPC_MESSAGE_ROUTED1(FrameHostMsg_ForwardInputEvent
,
688 IPC::WebInputEventPointer
/* event */)
690 // Used to tell the parent that the user right clicked on an area of the
691 // content area, and a context menu should be shown for it. The params
692 // object contains information about the node(s) that were selected when the
693 // user right clicked.
694 IPC_MESSAGE_ROUTED1(FrameHostMsg_ContextMenu
, content::ContextMenuParams
)
696 // Initial drawing parameters for a child frame that has been swapped out to
698 IPC_MESSAGE_ROUTED2(FrameHostMsg_InitializeChildFrame
,
699 gfx::Rect
/* frame_rect */,
700 float /* scale_factor */)
702 // Response for FrameMsg_JavaScriptExecuteRequest, sent when a reply was
703 // requested. The ID is the parameter supplied to
704 // FrameMsg_JavaScriptExecuteRequest. The result has the value returned by the
705 // script as its only element, one of Null, Boolean, Integer, Real, Date, or
707 IPC_MESSAGE_ROUTED2(FrameHostMsg_JavaScriptExecuteResponse
,
709 base::ListValue
/* result */)
711 // A request to run a JavaScript dialog.
712 IPC_SYNC_MESSAGE_ROUTED4_2(FrameHostMsg_RunJavaScriptMessage
,
713 base::string16
/* in - alert message */,
714 base::string16
/* in - default prompt */,
715 GURL
/* in - originating page URL */,
716 content::JavaScriptMessageType
/* in - type */,
717 bool /* out - success */,
718 base::string16
/* out - user_input field */)
720 // Displays a dialog to confirm that the user wants to navigate away from the
721 // page. Replies true if yes, and false otherwise. The reply string is ignored,
722 // but is included so that we can use OnJavaScriptMessageBoxClosed.
723 IPC_SYNC_MESSAGE_ROUTED3_2(FrameHostMsg_RunBeforeUnloadConfirm
,
724 GURL
, /* in - originating frame URL */
725 base::string16
/* in - alert message */,
726 bool /* in - is a reload */,
727 bool /* out - success */,
728 base::string16
/* out - This is ignored.*/)
730 // Asks the browser to open the color chooser.
731 IPC_MESSAGE_ROUTED3(FrameHostMsg_OpenColorChooser
,
734 std::vector
<content::ColorSuggestion
> /* suggestions */)
736 // Asks the browser to end the color chooser.
737 IPC_MESSAGE_ROUTED1(FrameHostMsg_EndColorChooser
, int /* id */)
739 // Change the selected color in the color chooser.
740 IPC_MESSAGE_ROUTED2(FrameHostMsg_SetSelectedColorInColorChooser
,
744 // Notifies the browser that media has started/stopped playing.
745 IPC_MESSAGE_ROUTED4(FrameHostMsg_MediaPlayingNotification
,
746 int64
/* player_cookie, distinguishes instances */,
747 bool /* has_video */,
748 bool /* has_audio */,
749 bool /* is_remote */)
751 IPC_MESSAGE_ROUTED1(FrameHostMsg_MediaPausedNotification
,
752 int64
/* player_cookie, distinguishes instances */)
754 // Notify browser the theme color has been changed.
755 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidChangeThemeColor
,
756 SkColor
/* theme_color */)
758 // Response for FrameMsg_TextSurroundingSelectionRequest, |startOffset| and
759 // |endOffset| are the offsets of the selection in the returned |content|.
760 IPC_MESSAGE_ROUTED3(FrameHostMsg_TextSurroundingSelectionResponse
,
761 base::string16
, /* content */
762 size_t, /* startOffset */
763 size_t /* endOffset */)
765 // Notifies the browser that the renderer has a pending navigation transition.
766 // The string parameters are all UTF8.
767 IPC_MESSAGE_CONTROL1(FrameHostMsg_AddNavigationTransitionData
,
768 FrameHostMsg_AddNavigationTransitionData_Params
)
771 // Tells the browser to perform a navigation.
772 IPC_MESSAGE_ROUTED2(FrameHostMsg_BeginNavigation
,
773 FrameHostMsg_BeginNavigation_Params
,
774 content::CommonNavigationParams
)
776 // Sent once a paint happens after the first non empty layout. In other words
777 // after the frame has painted something.
778 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidFirstVisuallyNonEmptyPaint
)
780 #if defined(OS_MACOSX) || defined(OS_ANDROID)
782 // Message to show/hide a popup menu using native controls.
783 IPC_MESSAGE_ROUTED1(FrameHostMsg_ShowPopup
,
784 FrameHostMsg_ShowPopup_Params
)
785 IPC_MESSAGE_ROUTED0(FrameHostMsg_HidePopup
)