blob: c864e2f6efec7cc37e4ec935d184d18233026bbd [file] [log] [blame]
ben76f52b242016-06-18 05:42:481// Copyright 2014 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
5module content.mojom;
6
csharrison95f01e922017-04-24 18:52:357import "content/public/common/window_container_type.mojom";
rockot734fb662016-10-15 16:41:308import "services/service_manager/public/interfaces/interface_provider.mojom";
csharrison95f01e922017-04-24 18:52:359import "third_party/WebKit/public/platform/referrer.mojom";
10import "third_party/WebKit/public/web/window_features.mojom";
11import "ui/base/mojo/window_open_disposition.mojom";
12import "url/mojo/url.mojom";
ben76f52b242016-06-18 05:42:4813
ben275a5652016-10-28 16:55:5014// The name of the InterfaceProviderSpec in service manifests used by the
15// frame tree to expose frame-specific interfaces between renderer and browser.
16const string kNavigation_FrameSpec = "navigation:frame";
17
ben76f52b242016-06-18 05:42:4818// Implemented by the frame provider (e.g. renderer processes).
19interface Frame {
rockot400ea35b2016-10-15 19:15:3220 GetInterfaceProvider(service_manager.mojom.InterfaceProvider& interfaces);
ben76f52b242016-06-18 05:42:4821};
22
sammc7f6c6a02017-01-30 00:53:5123// Implemented by the frame (e.g. renderer processes).
24// Instances of this interface must be associated with (i.e., FIFO with) the
25// legacy IPC channel.
26interface FrameBindingsControl {
27 // Used to tell a render frame whether it should expose various bindings
28 // that allow JS content extended privileges. See BindingsPolicy for valid
29 // flag values.
30 AllowBindings(int32 enabled_bindings_flags);
31};
32
ben76f52b242016-06-18 05:42:4833// Implemented by the frame server (i.e. the browser process).
csharrison95f01e922017-04-24 18:52:3534interface FrameHostInterfaceBroker {
rockot400ea35b2016-10-15 19:15:3235 GetInterfaceProvider(service_manager.mojom.InterfaceProvider& interfaces);
ben76f52b242016-06-18 05:42:4836};
37
38// Implemented by a service that provides implementations of the Frame
39// interface. (e.g. renderer processes).
40interface FrameFactory {
csharrison95f01e922017-04-24 18:52:3541 CreateFrame(int32 frame_routing_id, Frame& frame, FrameHostInterfaceBroker host);
42};
43
44// TODO(csharrison): Clean up this struct. Some of the entries (like
45// opener_top_level_frame_url) are better suited to be computed in the browser
46// process. See http://crbug.com/674307.
47struct CreateNewWindowParams {
48 // True if this open request came in the context of a user gesture.
49 bool user_gesture;
50
51 // Type of window requested.
52 WindowContainerType window_container_type;
53
54 // The session storage namespace ID this window should use.
55 int64 session_storage_namespace_id;
56
57 // The name of the resulting frame that should be created (empty if none
58 // has been specified). UTF8 encoded string.
59 string frame_name;
60
61 // The URL of the frame initiating the open.
62 url.mojom.Url opener_url;
63
64 // The URL of the top frame containing the opener.
65 url.mojom.Url opener_top_level_frame_url;
66
67 // The security origin of the frame initiating the open.
68 url.mojom.Url opener_security_origin;
69
70 // Whether the opener will be suppressed in the new window, in which case
71 // scripting the new window is not allowed.
72 bool opener_suppressed;
73
74 // Whether the window should be opened in the foreground, background, etc.
75 ui.mojom.WindowOpenDisposition disposition;
76
77 // The URL that will be loaded in the new window (empty if none has been
78 // specified).
79 url.mojom.Url target_url;
80
81 // The referrer that will be used to load |target_url| (empty if none has
82 // been specified).
83 blink.mojom.Referrer referrer;
84
85 // The window features to use for the new window.
86 blink.mojom.WindowFeatures features;
87};
88
89struct CreateNewWindowReply {
90 // The ID of the view to be created. If the ID is MSG_ROUTING_NONE, then the
91 // opener RenderFrame should not create a RenderView in its process.
92 // MSG_ROUTING_NONE does not necessarily indicate failure; it may also occur
93 // in cases where a window was created, but the opener relationship is
94 // severed.
95 int32 route_id;
96
97 // The ID of the main frame hosted in the view.
98 int32 main_frame_route_id;
99
100 // The ID of the widget for the main frame.
101 int32 main_frame_widget_route_id;
102
103 // Duplicated from CreateNewWindowParams because legacy code.
104 int64 cloned_session_storage_namespace_id;
105};
106
107// Implemented by the frame server (i.e. the browser process). For messages that
108// must be associated with the IPC channel.
109interface FrameHost {
110 // Sent by the renderer when it is creating a new window. The browser creates
111 // a tab for it. If |reply.route_id| is MSG_ROUTING_NONE, the window couldn't
112 // be created.
113 [Sync] CreateNewWindow(CreateNewWindowParams params)
114 => (CreateNewWindowReply reply);
ben76f52b242016-06-18 05:42:48115};