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