1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // IPC messages for interacting with frames.
6 // Multiply-included message file, hence no include guard.
8 #include "content/common/content_export.h"
9 #include "content/common/content_param_traits.h"
10 #include "content/common/frame_message_enums.h"
11 #include "content/common/frame_param.h"
12 #include "content/common/frame_replication_state.h"
13 #include "content/common/navigation_gesture.h"
14 #include "content/common/navigation_params.h"
15 #include "content/common/resource_request_body.h"
16 #include "content/public/common/color_suggestion.h"
17 #include "content/public/common/common_param_traits.h"
18 #include "content/public/common/context_menu_params.h"
19 #include "content/public/common/frame_navigate_params.h"
20 #include "content/public/common/javascript_message_type.h"
21 #include "content/public/common/page_state.h"
22 #include "content/public/common/resource_response.h"
23 #include "content/public/common/transition_element.h"
24 #include "ipc/ipc_message_macros.h"
25 #include "ui/gfx/ipc/gfx_param_traits.h"
27 #include "url/origin.h"
29 #undef IPC_MESSAGE_EXPORT
30 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT
32 #define IPC_MESSAGE_START FrameMsgStart
34 IPC_ENUM_TRAITS_MIN_MAX_VALUE(AccessibilityMode
,
36 AccessibilityModeComplete
)
37 IPC_ENUM_TRAITS_MIN_MAX_VALUE(content::JavaScriptMessageType
,
38 content::JAVASCRIPT_MESSAGE_TYPE_ALERT
,
39 content::JAVASCRIPT_MESSAGE_TYPE_PROMPT
)
40 IPC_ENUM_TRAITS_MAX_VALUE(FrameMsg_Navigate_Type::Value
,
41 FrameMsg_Navigate_Type::NAVIGATE_TYPE_LAST
)
42 IPC_ENUM_TRAITS_MAX_VALUE(FrameMsg_UILoadMetricsReportType::Value
,
43 FrameMsg_UILoadMetricsReportType::REPORT_TYPE_LAST
)
44 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebContextMenuData::MediaType
,
45 blink::WebContextMenuData::MediaTypeLast
)
46 IPC_ENUM_TRAITS_MAX_VALUE(ui::MenuSourceType
, ui::MENU_SOURCE_TYPE_LAST
)
48 IPC_STRUCT_TRAITS_BEGIN(content::ColorSuggestion
)
49 IPC_STRUCT_TRAITS_MEMBER(color
)
50 IPC_STRUCT_TRAITS_MEMBER(label
)
51 IPC_STRUCT_TRAITS_END()
53 IPC_STRUCT_TRAITS_BEGIN(content::ContextMenuParams
)
54 IPC_STRUCT_TRAITS_MEMBER(media_type
)
55 IPC_STRUCT_TRAITS_MEMBER(x
)
56 IPC_STRUCT_TRAITS_MEMBER(y
)
57 IPC_STRUCT_TRAITS_MEMBER(link_url
)
58 IPC_STRUCT_TRAITS_MEMBER(link_text
)
59 IPC_STRUCT_TRAITS_MEMBER(unfiltered_link_url
)
60 IPC_STRUCT_TRAITS_MEMBER(src_url
)
61 IPC_STRUCT_TRAITS_MEMBER(has_image_contents
)
62 IPC_STRUCT_TRAITS_MEMBER(page_url
)
63 IPC_STRUCT_TRAITS_MEMBER(keyword_url
)
64 IPC_STRUCT_TRAITS_MEMBER(frame_url
)
65 IPC_STRUCT_TRAITS_MEMBER(frame_page_state
)
66 IPC_STRUCT_TRAITS_MEMBER(media_flags
)
67 IPC_STRUCT_TRAITS_MEMBER(selection_text
)
68 IPC_STRUCT_TRAITS_MEMBER(suggested_filename
)
69 IPC_STRUCT_TRAITS_MEMBER(misspelled_word
)
70 IPC_STRUCT_TRAITS_MEMBER(misspelling_hash
)
71 IPC_STRUCT_TRAITS_MEMBER(dictionary_suggestions
)
72 IPC_STRUCT_TRAITS_MEMBER(spellcheck_enabled
)
73 IPC_STRUCT_TRAITS_MEMBER(is_editable
)
74 IPC_STRUCT_TRAITS_MEMBER(writing_direction_default
)
75 IPC_STRUCT_TRAITS_MEMBER(writing_direction_left_to_right
)
76 IPC_STRUCT_TRAITS_MEMBER(writing_direction_right_to_left
)
77 IPC_STRUCT_TRAITS_MEMBER(edit_flags
)
78 IPC_STRUCT_TRAITS_MEMBER(security_info
)
79 IPC_STRUCT_TRAITS_MEMBER(frame_charset
)
80 IPC_STRUCT_TRAITS_MEMBER(referrer_policy
)
81 IPC_STRUCT_TRAITS_MEMBER(custom_context
)
82 IPC_STRUCT_TRAITS_MEMBER(custom_items
)
83 IPC_STRUCT_TRAITS_MEMBER(source_type
)
84 #if defined(OS_ANDROID)
85 IPC_STRUCT_TRAITS_MEMBER(selection_start
)
86 IPC_STRUCT_TRAITS_MEMBER(selection_end
)
88 IPC_STRUCT_TRAITS_END()
90 IPC_STRUCT_TRAITS_BEGIN(content::CustomContextMenuContext
)
91 IPC_STRUCT_TRAITS_MEMBER(is_pepper_menu
)
92 IPC_STRUCT_TRAITS_MEMBER(request_id
)
93 IPC_STRUCT_TRAITS_MEMBER(render_widget_id
)
94 IPC_STRUCT_TRAITS_MEMBER(link_followed
)
95 IPC_STRUCT_TRAITS_END()
97 IPC_STRUCT_TRAITS_BEGIN(content::TransitionElement
)
98 IPC_STRUCT_TRAITS_MEMBER(id
)
99 IPC_STRUCT_TRAITS_MEMBER(rect
)
100 IPC_STRUCT_TRAITS_END()
102 IPC_STRUCT_BEGIN(FrameHostMsg_AddNavigationTransitionData_Params
)
103 IPC_STRUCT_MEMBER(int, render_frame_id
)
104 IPC_STRUCT_MEMBER(std::string
, allowed_destination_host_pattern
)
105 IPC_STRUCT_MEMBER(std::string
, selector
)
106 IPC_STRUCT_MEMBER(std::string
, markup
)
107 IPC_STRUCT_MEMBER(std::vector
<content::TransitionElement
>, elements
)
110 IPC_STRUCT_BEGIN(FrameHostMsg_DidFailProvisionalLoadWithError_Params
)
111 // Error code as reported in the DidFailProvisionalLoad callback.
112 IPC_STRUCT_MEMBER(int, error_code
)
113 // An error message generated from the error_code. This can be an empty
114 // string if we were unable to find a meaningful description.
115 IPC_STRUCT_MEMBER(base::string16
, error_description
)
116 // The URL that the error is reported for.
117 IPC_STRUCT_MEMBER(GURL
, url
)
118 // True if the failure is the result of navigating to a POST again
119 // and we're going to show the POST interstitial.
120 IPC_STRUCT_MEMBER(bool, showing_repost_interstitial
)
123 IPC_STRUCT_TRAITS_BEGIN(content::FrameNavigateParams
)
124 IPC_STRUCT_TRAITS_MEMBER(page_id
)
125 IPC_STRUCT_TRAITS_MEMBER(url
)
126 IPC_STRUCT_TRAITS_MEMBER(base_url
)
127 IPC_STRUCT_TRAITS_MEMBER(referrer
)
128 IPC_STRUCT_TRAITS_MEMBER(transition
)
129 IPC_STRUCT_TRAITS_MEMBER(redirects
)
130 IPC_STRUCT_TRAITS_MEMBER(should_update_history
)
131 IPC_STRUCT_TRAITS_MEMBER(searchable_form_url
)
132 IPC_STRUCT_TRAITS_MEMBER(searchable_form_encoding
)
133 IPC_STRUCT_TRAITS_MEMBER(contents_mime_type
)
134 IPC_STRUCT_TRAITS_MEMBER(socket_address
)
135 IPC_STRUCT_TRAITS_END()
137 // Parameters structure for FrameHostMsg_DidCommitProvisionalLoad, which has
138 // too many data parameters to be reasonably put in a predefined IPC message.
139 IPC_STRUCT_BEGIN_WITH_PARENT(FrameHostMsg_DidCommitProvisionalLoad_Params
,
140 content::FrameNavigateParams
)
141 IPC_STRUCT_TRAITS_PARENT(content::FrameNavigateParams
)
143 // Information regarding the security of the connection (empty if the
144 // connection was not secure).
145 IPC_STRUCT_MEMBER(std::string
, security_info
)
147 // The gesture that initiated this navigation.
148 IPC_STRUCT_MEMBER(content::NavigationGesture
, gesture
)
150 // True if this was a post request.
151 IPC_STRUCT_MEMBER(bool, is_post
)
153 // The POST body identifier. -1 if it doesn't exist.
154 IPC_STRUCT_MEMBER(int64
, post_id
)
156 // Whether the frame navigation resulted in no change to the documents within
157 // the page. For example, the navigation may have just resulted in scrolling
158 // to a named anchor.
159 IPC_STRUCT_MEMBER(bool, was_within_same_page
)
161 // The status code of the HTTP request.
162 IPC_STRUCT_MEMBER(int, http_status_code
)
164 // This flag is used to warn if the renderer is displaying an error page,
165 // so that we can set the appropriate page type.
166 IPC_STRUCT_MEMBER(bool, url_is_unreachable
)
168 // True if the connection was proxied. In this case, socket_address
169 // will represent the address of the proxy, rather than the remote host.
170 IPC_STRUCT_MEMBER(bool, was_fetched_via_proxy
)
172 // Serialized history item state to store in the navigation entry.
173 IPC_STRUCT_MEMBER(content::PageState
, page_state
)
175 // Original request's URL.
176 IPC_STRUCT_MEMBER(GURL
, original_request_url
)
178 // User agent override used to navigate.
179 IPC_STRUCT_MEMBER(bool, is_overriding_user_agent
)
181 // Notifies the browser that for this navigation, the session history was
182 // successfully cleared.
183 IPC_STRUCT_MEMBER(bool, history_list_was_cleared
)
185 // The routing_id of the render view associated with the navigation.
186 // We need to track the RenderViewHost routing_id because of downstream
187 // dependencies (crbug.com/392171 DownloadRequestHandle, SaveFileManager,
188 // ResourceDispatcherHostImpl, MediaStreamUIProxy,
189 // SpeechRecognitionDispatcherHost and possibly others). They look up the view
190 // based on the ID stored in the resource requests. Once those dependencies
191 // are unwound or moved to RenderFrameHost (crbug.com/304341) we can move the
192 // client to be based on the routing_id of the RenderFrameHost.
193 IPC_STRUCT_MEMBER(int, render_view_routing_id
)
195 // Origin of the frame. This will be replicated to any associated
196 // RenderFrameProxies.
197 IPC_STRUCT_MEMBER(url::Origin
, origin
)
199 // How navigation metrics starting on UI action for this load should be
201 IPC_STRUCT_MEMBER(FrameMsg_UILoadMetricsReportType::Value
, report_type
)
203 // Timestamp at which the UI action that triggered the navigation originated.
204 IPC_STRUCT_MEMBER(base::TimeTicks
, ui_timestamp
)
207 IPC_STRUCT_TRAITS_BEGIN(content::CommonNavigationParams
)
208 IPC_STRUCT_TRAITS_MEMBER(url
)
209 IPC_STRUCT_TRAITS_MEMBER(referrer
)
210 IPC_STRUCT_TRAITS_MEMBER(transition
)
211 IPC_STRUCT_TRAITS_MEMBER(navigation_type
)
212 IPC_STRUCT_TRAITS_MEMBER(allow_download
)
213 IPC_STRUCT_TRAITS_END()
215 IPC_STRUCT_TRAITS_BEGIN(content::RequestNavigationParams
)
216 IPC_STRUCT_TRAITS_MEMBER(is_post
)
217 IPC_STRUCT_TRAITS_MEMBER(extra_headers
)
218 IPC_STRUCT_TRAITS_MEMBER(browser_initiated_post_data
)
219 IPC_STRUCT_TRAITS_END()
221 IPC_STRUCT_TRAITS_BEGIN(content::CommitNavigationParams
)
222 IPC_STRUCT_TRAITS_MEMBER(page_state
)
223 IPC_STRUCT_TRAITS_MEMBER(is_overriding_user_agent
)
224 IPC_STRUCT_TRAITS_MEMBER(browser_navigation_start
)
225 IPC_STRUCT_TRAITS_END()
227 IPC_STRUCT_TRAITS_BEGIN(content::FrameReplicationState
)
228 IPC_STRUCT_TRAITS_MEMBER(origin
)
229 IPC_STRUCT_TRAITS_END()
231 IPC_STRUCT_BEGIN(FrameMsg_Navigate_Params
)
232 // TODO(clamy): investigate which parameters are also needed in PlzNavigate
233 // and move them to the appropriate NavigationParams struct.
235 // These structs contain parameters shared by other navigation IPCs.
236 IPC_STRUCT_MEMBER(content::CommonNavigationParams
, common_params
)
237 IPC_STRUCT_MEMBER(content::RequestNavigationParams
, request_params
)
238 IPC_STRUCT_MEMBER(content::CommitNavigationParams
, commit_params
)
240 // The page_id for this navigation, or -1 if it is a new navigation. Back,
241 // Forward, and Reload navigations should have a valid page_id. If the load
242 // succeeds, then this page_id will be reflected in the resultant
243 // FrameHostMsg_DidCommitProvisionalLoad message.
244 IPC_STRUCT_MEMBER(int32
, page_id
)
246 // For history navigations, this is the offset in the history list of the
247 // pending load. For non-history navigations, this will be ignored.
248 IPC_STRUCT_MEMBER(int, pending_history_list_offset
)
250 // Informs the RenderView of where its current page contents reside in
251 // session history and the total size of the session history list.
252 IPC_STRUCT_MEMBER(int, current_history_list_offset
)
253 IPC_STRUCT_MEMBER(int, current_history_list_length
)
255 // Informs the RenderView the session history should be cleared. In that
256 // case, the RenderView needs to notify the browser that the clearing was
257 // succesful when the navigation commits.
258 IPC_STRUCT_MEMBER(bool, should_clear_history_list
)
260 // Base URL for use in WebKit's SubstituteData.
261 // Is only used with data: URLs.
262 IPC_STRUCT_MEMBER(GURL
, base_url_for_data_url
)
264 // History URL for use in WebKit's SubstituteData.
265 // Is only used with data: URLs.
266 IPC_STRUCT_MEMBER(GURL
, history_url_for_data_url
)
268 // Any redirect URLs that occurred before |url|. Useful for cross-process
269 // navigations; defaults to empty.
270 IPC_STRUCT_MEMBER(std::vector
<GURL
>, redirects
)
272 // Informs the RenderView the pending navigation should replace the current
273 // history entry when it commits. This is used for cross-process redirects so
274 // the transferred navigation can recover the navigation state.
275 IPC_STRUCT_MEMBER(bool, should_replace_current_entry
)
277 // The time the request was created. This is used by the old performance
278 // infrastructure to set up DocumentState associated with the RenderView.
279 // TODO(ppi): make it go away.
280 IPC_STRUCT_MEMBER(base::Time
, request_time
)
282 // The following two members identify a previous request that has been
283 // created before this navigation is being transferred to a new render view.
284 // This serves the purpose of recycling the old request.
285 // Unless this refers to a transferred navigation, these values are -1 and -1.
286 IPC_STRUCT_MEMBER(int, transferred_request_child_id
)
287 IPC_STRUCT_MEMBER(int, transferred_request_request_id
)
289 // Whether or not this url should be allowed to access local file://
291 IPC_STRUCT_MEMBER(bool, can_load_local_resources
)
293 // If not empty, which frame to navigate.
294 IPC_STRUCT_MEMBER(std::string
, frame_to_navigate
)
297 IPC_STRUCT_BEGIN(FrameHostMsg_OpenURL_Params
)
298 IPC_STRUCT_MEMBER(GURL
, url
)
299 IPC_STRUCT_MEMBER(content::Referrer
, referrer
)
300 IPC_STRUCT_MEMBER(WindowOpenDisposition
, disposition
)
301 IPC_STRUCT_MEMBER(bool, should_replace_current_entry
)
302 IPC_STRUCT_MEMBER(bool, user_gesture
)
306 IPC_STRUCT_BEGIN(FrameHostMsg_BeginNavigation_Params
)
307 // TODO(clamy): See if it is possible to define a common struct between this
308 // IPC and ResourceMsg_Request_Params.
310 // The request method: GET, POST, etc.
311 IPC_STRUCT_MEMBER(std::string
, method
)
313 // Additional HTTP request headers.
314 IPC_STRUCT_MEMBER(std::string
, headers
)
316 // net::URLRequest load flags (net::LOAD_NORMAL) by default).
317 IPC_STRUCT_MEMBER(int, load_flags
)
319 // Optional resource request body (may be null).
320 IPC_STRUCT_MEMBER(scoped_refptr
<content::ResourceRequestBody
>,
323 // True if the request was user initiated.
324 IPC_STRUCT_MEMBER(bool, has_user_gesture
)
327 #if defined(OS_MACOSX) || defined(OS_ANDROID)
328 // This message is used for supporting popup menus on Mac OS X and Android using
329 // native controls. See the FrameHostMsg_ShowPopup message.
330 IPC_STRUCT_BEGIN(FrameHostMsg_ShowPopup_Params
)
331 // Position on the screen.
332 IPC_STRUCT_MEMBER(gfx::Rect
, bounds
)
334 // The height of each item in the menu.
335 IPC_STRUCT_MEMBER(int, item_height
)
337 // The size of the font to use for those items.
338 IPC_STRUCT_MEMBER(double, item_font_size
)
340 // The currently selected (displayed) item in the menu.
341 IPC_STRUCT_MEMBER(int, selected_item
)
343 // The entire list of items in the popup menu.
344 IPC_STRUCT_MEMBER(std::vector
<content::MenuItem
>, popup_items
)
346 // Whether items should be right-aligned.
347 IPC_STRUCT_MEMBER(bool, right_aligned
)
349 // Whether this is a multi-select popup.
350 IPC_STRUCT_MEMBER(bool, allow_multiple_selection
)
354 // -----------------------------------------------------------------------------
355 // Messages sent from the browser to the renderer.
357 // Notifies the embedding frame that a new CompositorFrame is ready to be
358 // presented. When the frame finishes presenting, a matching
359 // FrameHostMsg_CompositorFrameSwappedACK should be sent back to the
360 // RenderViewHost that was produced the CompositorFrame.
362 // This is used in the ubercomp compositing path.
363 IPC_MESSAGE_ROUTED1(FrameMsg_CompositorFrameSwapped
,
364 FrameMsg_CompositorFrameSwapped_Params
/* params */)
366 // Notifies the embedding frame that the process rendering the child frame's
367 // contents has terminated.
368 IPC_MESSAGE_ROUTED0(FrameMsg_ChildFrameProcessGone
)
370 // Sent in response to a FrameHostMsg_ContextMenu to let the renderer know that
371 // the menu has been closed.
372 IPC_MESSAGE_ROUTED1(FrameMsg_ContextMenuClosed
,
373 content::CustomContextMenuContext
/* custom_context */)
375 // Executes custom context menu action that was provided from Blink.
376 IPC_MESSAGE_ROUTED2(FrameMsg_CustomContextMenuAction
,
377 content::CustomContextMenuContext
/* custom_context */,
378 unsigned /* action */)
380 // Requests that the RenderFrame or RenderFrameProxy sets its opener to null.
381 IPC_MESSAGE_ROUTED0(FrameMsg_DisownOpener
)
383 // Instructs the renderer to create a new RenderFrame object with |routing_id|.
384 // The new frame should be created as a child of the object identified by
385 // |parent_routing_id| or as top level if that is MSG_ROUTING_NONE.
386 // If a valid |proxy_routing_id| is provided, the new frame will be configured
387 // to replace the proxy on commit.
388 IPC_MESSAGE_CONTROL3(FrameMsg_NewFrame
,
389 int /* routing_id */,
390 int /* parent_routing_id */,
391 int /* proxy_routing_id */)
393 // Instructs the renderer to create a new RenderFrameProxy object with
394 // |routing_id|. The new proxy should be created as a child of the object
395 // identified by |parent_routing_id| or as top level if that is
397 IPC_MESSAGE_CONTROL4(FrameMsg_NewFrameProxy
,
398 int /* routing_id */,
399 int /* parent_routing_id */,
400 int /* render_view_routing_id */,
401 content::FrameReplicationState
/* replication_state */)
403 // Tells the renderer to perform the specified navigation, interrupting any
404 // existing navigation.
405 IPC_MESSAGE_ROUTED1(FrameMsg_Navigate
, FrameMsg_Navigate_Params
)
407 // Instructs the renderer to invoke the frame's beforeunload event handler.
408 // Expects the result to be returned via FrameHostMsg_BeforeUnload_ACK.
409 IPC_MESSAGE_ROUTED0(FrameMsg_BeforeUnload
)
411 // Instructs the frame to swap out for a cross-site transition, including
412 // running the unload event handler and creating a RenderFrameProxy with the
413 // given |proxy_routing_id|. Expects a SwapOut_ACK message when finished.
414 IPC_MESSAGE_ROUTED3(FrameMsg_SwapOut
,
415 int /* proxy_routing_id */,
416 bool /* is_loading */,
417 content::FrameReplicationState
/* replication_state */)
419 // Instructs the frame to stop the load in progress, if any.
420 IPC_MESSAGE_ROUTED0(FrameMsg_Stop
)
422 // A message sent to RenderFrameProxy to indicate that its corresponding
423 // RenderFrame has started loading a document.
424 IPC_MESSAGE_ROUTED0(FrameMsg_DidStartLoading
)
426 // A message sent to RenderFrameProxy to indicate that its corresponding
427 // RenderFrame has completed loading.
428 IPC_MESSAGE_ROUTED0(FrameMsg_DidStopLoading
)
430 // Request for the renderer to insert CSS into the frame.
431 IPC_MESSAGE_ROUTED1(FrameMsg_CSSInsertRequest
,
432 std::string
/* css */)
434 // Request for the renderer to execute JavaScript in the frame's context.
436 // javascript is the string containing the JavaScript to be executed in the
437 // target frame's context.
439 // If the third parameter is true the result is sent back to the browser using
440 // the message FrameHostMsg_JavaScriptExecuteResponse.
441 // FrameHostMsg_JavaScriptExecuteResponse is passed the ID parameter so that the
442 // host can uniquely identify the request.
443 IPC_MESSAGE_ROUTED3(FrameMsg_JavaScriptExecuteRequest
,
444 base::string16
, /* javascript */
446 bool /* if true, a reply is requested */)
448 // ONLY FOR TESTS: Same as above but adds a fake UserGestureindicator around
449 // execution. (crbug.com/408426)
450 IPC_MESSAGE_ROUTED3(FrameMsg_JavaScriptExecuteRequestForTests
,
451 base::string16
, /* javascript */
453 bool /* if true, a reply is requested */)
455 // Selects between the given start and end offsets in the currently focused
457 IPC_MESSAGE_ROUTED2(FrameMsg_SetEditableSelectionOffsets
,
461 // Requests a navigation to the supplied markup, in an iframe with sandbox
463 IPC_MESSAGE_ROUTED1(FrameMsg_SetupTransitionView
,
464 std::string
/* markup */)
466 // Tells the renderer to hide the elements specified by the supplied CSS
467 // selector, and activates any exiting-transition stylesheets.
468 IPC_MESSAGE_ROUTED2(FrameMsg_BeginExitTransition
,
469 std::string
/* css_selector */,
470 bool /* exit_to_native_app */)
472 // Tell the renderer to revert the exit transition done before
473 IPC_MESSAGE_ROUTED0(FrameMsg_RevertExitTransition
)
475 // Tell the renderer to hide transition elements.
476 IPC_MESSAGE_ROUTED1(FrameMsg_HideTransitionElements
,
477 std::string
/* css_selector */)
479 // Tell the renderer to hide transition elements.
480 IPC_MESSAGE_ROUTED1(FrameMsg_ShowTransitionElements
,
481 std::string
/* css_selector */)
483 // Tells the renderer to reload the frame, optionally ignoring the cache while
485 IPC_MESSAGE_ROUTED1(FrameMsg_Reload
,
486 bool /* ignore_cache */)
488 // Notifies the color chooser client that the user selected a color.
489 IPC_MESSAGE_ROUTED2(FrameMsg_DidChooseColorResponse
, unsigned, SkColor
)
491 // Notifies the color chooser client that the color chooser has ended.
492 IPC_MESSAGE_ROUTED1(FrameMsg_DidEndColorChooser
, unsigned)
494 // Notifies the corresponding RenderFrameProxy object to replace itself with the
495 // RenderFrame object it is associated with.
496 IPC_MESSAGE_ROUTED0(FrameMsg_DeleteProxy
)
498 // Request the text surrounding the selection with a |max_length|. The response
499 // will be sent via FrameHostMsg_TextSurroundingSelectionResponse.
500 IPC_MESSAGE_ROUTED1(FrameMsg_TextSurroundingSelectionRequest
,
501 size_t /* max_length */)
503 // Tells the renderer to insert a link to the specified stylesheet. This is
504 // needed to support navigation transitions.
505 IPC_MESSAGE_ROUTED1(FrameMsg_AddStyleSheetByURL
, std::string
)
507 // Change the accessibility mode in the renderer process.
508 IPC_MESSAGE_ROUTED1(FrameMsg_SetAccessibilityMode
,
511 #if defined(OS_ANDROID)
513 // External popup menus.
514 IPC_MESSAGE_ROUTED2(FrameMsg_SelectPopupMenuItems
,
515 bool /* user canceled the popup */,
516 std::vector
<int> /* selected indices */)
518 #elif defined(OS_MACOSX)
520 // External popup menus.
521 IPC_MESSAGE_ROUTED1(FrameMsg_SelectPopupMenuItem
,
522 int /* selected index, -1 means no selection */)
527 // Tells the renderer that a navigation has been requested.
528 IPC_MESSAGE_ROUTED2(FrameMsg_RequestNavigation
,
529 content::CommonNavigationParams
, /* common_params */
530 content::RequestNavigationParams
/* request_params */)
533 // Tells the renderer that a navigation is ready to commit. The renderer should
534 // request |stream_url| to get access to the stream containing the body of the
536 IPC_MESSAGE_ROUTED4(FrameMsg_CommitNavigation
,
537 content::ResourceResponseHead
, /* response */
538 GURL
, /* stream_url */
539 content::CommonNavigationParams
, /* common_params */
540 content::CommitNavigationParams
/* commit_params */)
542 #if defined(ENABLE_PLUGINS)
543 // Notifies the renderer of updates to the Plugin Power Saver origin whitelist.
544 IPC_MESSAGE_ROUTED1(FrameMsg_UpdatePluginContentOriginWhitelist
,
545 std::set
<GURL
> /* origin_whitelist */)
546 #endif // defined(ENABLE_PLUGINS)
548 // -----------------------------------------------------------------------------
549 // Messages sent from the renderer to the browser.
551 // Blink and JavaScript error messages to log to the console
553 IPC_MESSAGE_ROUTED4(FrameHostMsg_AddMessageToConsole
,
554 int32
, /* log level */
555 base::string16
, /* msg */
556 int32
, /* line number */
557 base::string16
/* source id */ )
559 // Sent by the renderer when a child frame is created in the renderer.
561 // Each of these messages will have a corresponding FrameHostMsg_Detach message
562 // sent when the frame is detached from the DOM.
563 IPC_SYNC_MESSAGE_CONTROL2_1(FrameHostMsg_CreateChildFrame
,
564 int32
/* parent_routing_id */,
565 std::string
/* frame_name */,
566 int32
/* new_routing_id */)
568 // Sent by the renderer to the parent RenderFrameHost when a child frame is
569 // detached from the DOM.
570 IPC_MESSAGE_ROUTED0(FrameHostMsg_Detach
)
572 // Sent by the renderer when the frame becomes focused.
573 IPC_MESSAGE_ROUTED0(FrameHostMsg_FrameFocused
)
575 // Sent when the renderer starts a provisional load for a frame.
576 // |is_transition_navigation| signals that the frame has defined transition
577 // elements which can be animated by the navigation destination to provide
578 // a transition effect during load.
579 IPC_MESSAGE_ROUTED2(FrameHostMsg_DidStartProvisionalLoadForFrame
,
581 bool /* is_transition_navigation */)
583 // Sent when the renderer fails a provisional load with an error.
584 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidFailProvisionalLoadWithError
,
585 FrameHostMsg_DidFailProvisionalLoadWithError_Params
)
587 // Notifies the browser that a frame in the view has changed. This message
588 // has a lot of parameters and is packed/unpacked by functions defined in
589 // render_messages.h.
590 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidCommitProvisionalLoad
,
591 FrameHostMsg_DidCommitProvisionalLoad_Params
)
593 // Notifies the browser that a document has been loaded.
594 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidFinishDocumentLoad
)
596 IPC_MESSAGE_ROUTED3(FrameHostMsg_DidFailLoadWithError
,
597 GURL
/* validated_url */,
598 int /* error_code */,
599 base::string16
/* error_description */)
601 // Sent when the renderer decides to ignore a navigation.
602 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidDropNavigation
)
604 // Sent when the renderer starts loading the page. |to_different_document| will
605 // be true unless the load is a fragment navigation, or triggered by
606 // history.pushState/replaceState.
607 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidStartLoading
,
608 bool /* to_different_document */)
610 // Sent when the renderer is done loading a page.
611 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidStopLoading
)
613 // Sent when the renderer changed the progress of a load.
614 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidChangeLoadProgress
,
615 double /* load_progress */)
617 // Requests that the given URL be opened in the specified manner.
618 IPC_MESSAGE_ROUTED1(FrameHostMsg_OpenURL
, FrameHostMsg_OpenURL_Params
)
620 // Notifies the browser that a frame finished loading.
621 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidFinishLoad
,
622 GURL
/* validated_url */)
624 // Sent when after the onload handler has been invoked for the document
625 // in this frame. Sent for top-level frames. |report_type| and |ui_timestamp|
626 // are used to report navigation metrics starting on the ui input event that
627 // triggered the navigation timestamp.
628 IPC_MESSAGE_ROUTED2(FrameHostMsg_DocumentOnLoadCompleted
,
629 FrameMsg_UILoadMetricsReportType::Value
/* report_type */,
630 base::TimeTicks
/* ui_timestamp */)
632 // Notifies that the initial empty document of a view has been accessed.
633 // After this, it is no longer safe to show a pending navigation's URL without
634 // making a URL spoof possible.
635 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidAccessInitialDocument
)
637 // Sent when the frame sets its opener to null, disowning it for the lifetime of
638 // the window. Sent for top-level frames.
639 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidDisownOpener
)
641 // Notifies the browser that a page id was assigned.
642 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidAssignPageId
,
645 // Changes the title for the page in the UI when the page is navigated or the
646 // title changes. Sent for top-level frames.
647 IPC_MESSAGE_ROUTED2(FrameHostMsg_UpdateTitle
,
648 base::string16
/* title */,
649 blink::WebTextDirection
/* title direction */)
651 // Change the encoding name of the page in UI when the page has detected
652 // proper encoding name. Sent for top-level frames.
653 IPC_MESSAGE_ROUTED1(FrameHostMsg_UpdateEncoding
,
654 std::string
/* new encoding name */)
656 // Following message is used to communicate the values received by the
657 // callback binding the JS to Cpp.
658 // An instance of browser that has an automation host listening to it can
659 // have a javascript send a native value (string, number, boolean) to the
660 // listener in Cpp. (DomAutomationController)
661 IPC_MESSAGE_ROUTED2(FrameHostMsg_DomOperationResponse
,
662 std::string
/* json_string */,
663 int /* automation_id */)
665 #if defined(ENABLE_PLUGINS)
666 // Sent to the browser when the renderer detects it is blocked on a pepper
667 // plugin message for too long. This is also sent when it becomes unhung
668 // (according to the value of is_hung). The browser can give the user the
669 // option of killing the plugin.
670 IPC_MESSAGE_ROUTED3(FrameHostMsg_PepperPluginHung
,
671 int /* plugin_child_id */,
672 base::FilePath
/* path */,
675 // Sent by the renderer process to indicate that a plugin instance has crashed.
676 // Note: |plugin_pid| should not be trusted. The corresponding process has
677 // probably died. Moreover, the ID may have been reused by a new process. Any
678 // usage other than displaying it in a prompt to the user is very likely to be
680 IPC_MESSAGE_ROUTED2(FrameHostMsg_PluginCrashed
,
681 base::FilePath
/* plugin_path */,
682 base::ProcessId
/* plugin_pid */)
684 // Return information about a plugin for the given URL and MIME
685 // type. If there is no matching plugin, |found| is false.
686 // |actual_mime_type| is the actual mime type supported by the
688 IPC_SYNC_MESSAGE_CONTROL4_3(FrameHostMsg_GetPluginInfo
,
689 int /* render_frame_id */,
692 std::string
/* mime_type */,
694 content::WebPluginInfo
/* plugin info */,
695 std::string
/* actual_mime_type */)
697 // A renderer sends this to the browser process when it wants to temporarily
698 // whitelist an origin's plugin content as essential. This temporary whitelist
699 // is specific to a top level frame, and is cleared when the whitelisting
700 // RenderFrame is destroyed.
701 IPC_MESSAGE_ROUTED1(FrameHostMsg_PluginContentOriginAllowed
,
702 GURL
/* content_origin */)
703 #endif // defined(ENABLE_PLUGINS)
705 // A renderer sends this to the browser process when it wants to
706 // create a plugin. The browser will create the plugin process if
707 // necessary, and will return a handle to the channel on success.
708 // On error an empty string is returned.
709 IPC_SYNC_MESSAGE_CONTROL4_2(FrameHostMsg_OpenChannelToPlugin
,
710 int /* render_frame_id */,
713 std::string
/* mime_type */,
714 IPC::ChannelHandle
/* channel_handle */,
715 content::WebPluginInfo
/* info */)
717 // Acknowledge that we presented an ubercomp frame.
719 // See FrameMsg_CompositorFrameSwapped
720 IPC_MESSAGE_ROUTED1(FrameHostMsg_CompositorFrameSwappedACK
,
721 FrameHostMsg_CompositorFrameSwappedACK_Params
/* params */)
723 // Provides the result from handling BeforeUnload. |proceed| matches the return
724 // value of the frame's beforeunload handler: true if the user decided to
725 // proceed with leaving the page.
726 IPC_MESSAGE_ROUTED3(FrameHostMsg_BeforeUnload_ACK
,
728 base::TimeTicks
/* before_unload_start_time */,
729 base::TimeTicks
/* before_unload_end_time */)
731 // Indicates that the current frame has swapped out, after a SwapOut message.
732 IPC_MESSAGE_ROUTED0(FrameHostMsg_SwapOut_ACK
)
734 IPC_MESSAGE_ROUTED1(FrameHostMsg_ReclaimCompositorResources
,
735 FrameHostMsg_ReclaimCompositorResources_Params
/* params */)
737 // Forwards an input event to a child.
738 // TODO(nick): Temporary bridge, revisit once the browser process can route
739 // input directly to subframes. http://crbug.com/339659
740 IPC_MESSAGE_ROUTED1(FrameHostMsg_ForwardInputEvent
,
741 IPC::WebInputEventPointer
/* event */)
743 // Used to tell the parent that the user right clicked on an area of the
744 // content area, and a context menu should be shown for it. The params
745 // object contains information about the node(s) that were selected when the
746 // user right clicked.
747 IPC_MESSAGE_ROUTED1(FrameHostMsg_ContextMenu
, content::ContextMenuParams
)
749 // Initial drawing parameters for a child frame that has been swapped out to
751 IPC_MESSAGE_ROUTED2(FrameHostMsg_InitializeChildFrame
,
752 gfx::Rect
/* frame_rect */,
753 float /* scale_factor */)
755 // Response for FrameMsg_JavaScriptExecuteRequest, sent when a reply was
756 // requested. The ID is the parameter supplied to
757 // FrameMsg_JavaScriptExecuteRequest. The result has the value returned by the
758 // script as its only element, one of Null, Boolean, Integer, Real, Date, or
760 IPC_MESSAGE_ROUTED2(FrameHostMsg_JavaScriptExecuteResponse
,
762 base::ListValue
/* result */)
764 // A request to run a JavaScript dialog.
765 IPC_SYNC_MESSAGE_ROUTED4_2(FrameHostMsg_RunJavaScriptMessage
,
766 base::string16
/* in - alert message */,
767 base::string16
/* in - default prompt */,
768 GURL
/* in - originating page URL */,
769 content::JavaScriptMessageType
/* in - type */,
770 bool /* out - success */,
771 base::string16
/* out - user_input field */)
773 // Displays a dialog to confirm that the user wants to navigate away from the
774 // page. Replies true if yes, and false otherwise. The reply string is ignored,
775 // but is included so that we can use OnJavaScriptMessageBoxClosed.
776 IPC_SYNC_MESSAGE_ROUTED3_2(FrameHostMsg_RunBeforeUnloadConfirm
,
777 GURL
, /* in - originating frame URL */
778 base::string16
/* in - alert message */,
779 bool /* in - is a reload */,
780 bool /* out - success */,
781 base::string16
/* out - This is ignored.*/)
783 // Asks the browser to open the color chooser.
784 IPC_MESSAGE_ROUTED3(FrameHostMsg_OpenColorChooser
,
787 std::vector
<content::ColorSuggestion
> /* suggestions */)
789 // Asks the browser to end the color chooser.
790 IPC_MESSAGE_ROUTED1(FrameHostMsg_EndColorChooser
, int /* id */)
792 // Change the selected color in the color chooser.
793 IPC_MESSAGE_ROUTED2(FrameHostMsg_SetSelectedColorInColorChooser
,
797 // Notifies the browser that media has started/stopped playing.
798 IPC_MESSAGE_ROUTED4(FrameHostMsg_MediaPlayingNotification
,
799 int64
/* player_cookie, distinguishes instances */,
800 bool /* has_video */,
801 bool /* has_audio */,
802 bool /* is_remote */)
804 IPC_MESSAGE_ROUTED1(FrameHostMsg_MediaPausedNotification
,
805 int64
/* player_cookie, distinguishes instances */)
807 // Notify browser the theme color has been changed.
808 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidChangeThemeColor
,
809 SkColor
/* theme_color */)
811 // Response for FrameMsg_TextSurroundingSelectionRequest, |startOffset| and
812 // |endOffset| are the offsets of the selection in the returned |content|.
813 IPC_MESSAGE_ROUTED3(FrameHostMsg_TextSurroundingSelectionResponse
,
814 base::string16
, /* content */
815 size_t, /* startOffset */
816 size_t /* endOffset */)
818 // Notifies the browser that the renderer has a pending navigation transition.
819 // The string parameters are all UTF8.
820 IPC_MESSAGE_CONTROL1(FrameHostMsg_AddNavigationTransitionData
,
821 FrameHostMsg_AddNavigationTransitionData_Params
)
824 // Tells the browser to perform a navigation.
825 IPC_MESSAGE_ROUTED2(FrameHostMsg_BeginNavigation
,
826 FrameHostMsg_BeginNavigation_Params
,
827 content::CommonNavigationParams
)
829 // Sent once a paint happens after the first non empty layout. In other words
830 // after the frame has painted something.
831 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidFirstVisuallyNonEmptyPaint
)
833 #if defined(OS_MACOSX) || defined(OS_ANDROID)
835 // Message to show/hide a popup menu using native controls.
836 IPC_MESSAGE_ROUTED1(FrameHostMsg_ShowPopup
,
837 FrameHostMsg_ShowPopup_Params
)
838 IPC_MESSAGE_ROUTED0(FrameHostMsg_HidePopup
)