Bug 1731613 - Move GetProcessSwitchBehavior method to C++, r=nika
[gecko.git] / dom / interfaces / base / nsIBrowser.idl
blob499580240ac2529b1b23b69d329a8b3246537158
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 #include "nsISupports.idl"
6 interface nsIContentSecurityPolicy;
7 interface nsIPrincipal;
8 interface nsITransportSecurityInfo;
9 interface nsIURI;
10 interface nsIWebProgress;
11 interface nsIReferrerInfo;
12 interface nsIOpenWindowInfo;
14 [scriptable, uuid(14e5a0cb-e223-4202-95e8-fe53275193ea)]
15 interface nsIBrowser : nsISupports
18 * Called by the child to inform the parent that links are dropped into
19 * content area.
21 * @param links a flat array of url, name, and type for each link
22 * @param triggeringPrincipal a principal that initiated loading
23 * of the dropped links
25 void dropLinks(in Array<AString> links,
26 in nsIPrincipal triggeringPrincipal);
28 /**
29 * Swapping of frameloaders are usually initiated from a frameloader owner
30 * or other components operating on frameloader owners. This is done by calling
31 * swapFrameLoaders at MozFrameLoaderOwner webidl interface.
33 * This function aimed to provide the other way around -
34 * if the swapping is initiated from frameloader itself or other platform level
35 * components, it uses this interface to delegate the swapping request to
36 * frameloader owners and ask them to re-initiate frameloader swapping, so that
37 * frameloader owners such as <xul:browser> can setup their properties and /
38 * or listeners properly on swapping.
40 void swapBrowsers(in nsIBrowser aOtherBrowser);
42 /**
43 * Close the browser (usually means to remove a tab).
45 void closeBrowser();
47 /**
48 * A browser can change from remote to non-remote and vice versa.
49 * For example, when navigating from an in-process chrome page to
50 * a web page, this value would change from false to true.
52 readonly attribute boolean isRemoteBrowser;
54 /**
55 * The browser's permanent key. This was added temporarily for Session Store,
56 * and will be removed in bug 1716788.
58 readonly attribute jsval permanentKey;
60 readonly attribute nsIPrincipal contentPrincipal;
61 readonly attribute nsIPrincipal contentPartitionedPrincipal;
62 readonly attribute nsIContentSecurityPolicy csp;
63 readonly attribute nsIReferrerInfo referrerInfo;
65 /**
66 * Whether or not the browser is in the process of an nsIWebNavigation
67 * navigation method.
69 attribute boolean isNavigating;
71 /**
72 * Whether or not the character encoding menu may be enabled.
74 attribute boolean mayEnableCharacterEncodingMenu;
76 /**
77 * Called by Gecko to update the browser when its state changes.
79 * @param aCharset the new character set of the document
80 * @param aDocumentURI the URI of the current document
81 * @param aContentType the content type of the document
83 void updateForStateChange(in AString aCharset,
84 in nsIURI aDocumentURI,
85 in AString aContentType);
87 /**
88 * Called by Gecko to update the nsIWebNavigation when a location change occurs.
90 * @param aCanGoBack whether or not the nsIWebNavigation can go backwards in
91 * history
92 * @param aCanGoForward whether or not the nsIWebNavigation can go
93 * forward in history
95 void updateWebNavigationForLocationChange(in boolean aCanGoBack,
96 in boolean aCanGoForward);
98 /**
99 * Called by Gecko to update the browser when a location change occurs.
101 * @param aLocation the new location
102 * @param aCharset the character set of the document
103 * @param aMayEnableCharacterEncodingMenu whether or not the content encoding
104 * menu may be enabled
105 * @param aDocumentURI the URI of the new document
106 * @param aTitle the title of the new doucment
107 * @param aContentPrincipal the security principal of the new document
108 * @param aContentPartitionedPrincipal the security principal for the new
109 * document's storage
110 * @param aCSP the content security policy of the new document
111 * @param aReferrerInfo the referrer info of the new document
112 * @param aIsSynthetic whether or not the document is synthetic
113 * @param aHasRequestContextID whether or not the the request context has a
114 * value (true) or null should be used (false)
115 * @param aRequestContextID the request context ID
116 * @param aContentType the content type of the document
118 void updateForLocationChange(in nsIURI aLocation,
119 in AString aCharset,
120 in boolean aMayEnableCharacterEncodingMenu,
121 in nsIURI aDocumentURI,
122 in AString aTitle,
123 in nsIPrincipal aContentPrincipal,
124 in nsIPrincipal aContentPartitionedPrincipal,
125 in nsIContentSecurityPolicy aCSP,
126 in nsIReferrerInfo aReferrerInfo,
127 in boolean aIsSynthetic,
128 in boolean aHasRequestContextID,
129 in uint64_t aRequestContextID,
130 in AString aContentType);
133 * Called to perform any async tasks which must be completed before changing
134 * remoteness. Gecko will wait for the returned promise to resolve before
135 * performing the process switch.
137 Promise prepareToChangeRemoteness();
139 /** Called immediately before changing remoteness */
140 void beforeChangeRemoteness();
143 * Called immediately after changing remoteness.
145 * If this method returns `true`, Gecko will assume frontend handled resuming
146 * the load, and will not attempt to resume the load itself.
148 bool finishChangeRemoteness(in uint64_t aPendingSwitchId);