Source code

Revision control

Other Tools

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"
5
6
interface nsIContentSecurityPolicy;
7
interface nsIPrincipal;
8
interface nsITransportSecurityInfo;
9
interface nsIURI;
10
interface nsIWebProgress;
11
interface nsIReferrerInfo;
12
13
webidl FrameLoader;
14
15
[scriptable, uuid(14e5a0cb-e223-4202-95e8-fe53275193ea)]
16
interface nsIBrowser : nsISupports
17
{
18
/**
19
* Gets an optional frame loader that is "related" to this browser.
20
* If this exists, then we should attempt to use the same content parent as
21
* this frame loader for any new remote tabs. For example, view source
22
* browsers set this to the frame loader for the original content to ensure
23
* they are loaded in the same process as the content.
24
*/
25
readonly attribute FrameLoader sameProcessAsFrameLoader;
26
27
/*
28
* Called by the child to inform the parent that links are dropped into
29
* content area.
30
*
31
* @param links a flat array of url, name, and type for each link
32
* @param triggeringPrincipal a principal that initiated loading
33
* of the dropped links
34
*/
35
void dropLinks(in Array<AString> links,
36
in nsIPrincipal triggeringPrincipal);
37
38
/**
39
* Swapping of frameloaders are usually initiated from a frameloader owner
40
* or other components operating on frameloader owners. This is done by calling
41
* swapFrameLoaders at MozFrameLoaderOwner webidl interface.
42
*
43
* This function aimed to provide the other way around -
44
* if the swapping is initiated from frameloader itself or other platform level
45
* components, it uses this interface to delegate the swapping request to
46
* frameloader owners and ask them to re-initiate frameloader swapping, so that
47
* frameloader owners such as <xul:browser> can setup their properties and /
48
* or listeners properly on swapping.
49
*/
50
void swapBrowsers(in nsIBrowser aOtherBrowser);
51
52
/**
53
* Close the browser (usually means to remove a tab).
54
*/
55
void closeBrowser();
56
57
/**
58
* A browser can change from remote to non-remote and vice versa.
59
* For example, when navigating from an in-process chrome page to
60
* a web page, this value would change from false to true.
61
*/
62
readonly attribute boolean isRemoteBrowser;
63
64
/**
65
* The nsIWebProgress instance responsible for handling progress events
66
* from the content process.
67
*
68
* Will always be non-null when isRemoteBrowser is true.
69
*/
70
readonly attribute nsIWebProgress remoteWebProgressManager;
71
72
/**
73
* Called by the child to inform the parent that a command update has occurred
74
* and the supplied set of commands are now enabled and disabled.
75
*
76
* @param action command updater action
77
* @param enabledCommands commands to enable
78
* @param disabledCommand commands to disable
79
*/
80
void enableDisableCommandsRemoteOnly(in AString action,
81
in Array<ACString> enabledCommands,
82
in Array<ACString> disabledCommands);
83
84
readonly attribute nsIPrincipal contentPrincipal;
85
readonly attribute nsIPrincipal contentStoragePrincipal;
86
readonly attribute nsIPrincipal contentBlockingAllowListPrincipal;
87
readonly attribute nsIContentSecurityPolicy csp;
88
readonly attribute nsIReferrerInfo referrerInfo;
89
90
/**
91
* Whether or not the browser is in the process of an nsIWebNavigation
92
* navigation method.
93
*/
94
attribute boolean isNavigating;
95
96
/**
97
* Whether or not the character encoding menu may be enabled.
98
*/
99
attribute boolean mayEnableCharacterEncodingMenu;
100
101
/**
102
* Whether or not the character encoding was detected by analyzing
103
* content (as opposed to reading a protocol label).
104
*/
105
attribute boolean charsetAutodetected;
106
107
/**
108
* Called by Gecko to update the browser when its state changes.
109
*
110
* @param aCharset the new character set of the document
111
* @param aDocumentURI the URI of the current document
112
* @param aContentType the content type of the document
113
*/
114
void updateForStateChange(in AString aCharset,
115
in nsIURI aDocumentURI,
116
in AString aContentType);
117
118
/**
119
* Called by Gecko to update the nsIWebNavigation when a location change occurs.
120
*
121
* @param aCanGoBack whether or not the nsIWebNavigation can go backwards in
122
* history
123
* @param aCanGoForward whether or not the nsIWebNavigation can go
124
* forward in history
125
*/
126
void updateWebNavigationForLocationChange(in boolean aCanGoBack,
127
in boolean aCanGoForward);
128
129
/**
130
* Called by Gecko to update the browser when a location change occurs.
131
*
132
* @param aLocation the new location
133
* @param aCharset the character set of the document
134
* @param aMayEnableCharacterEncodingMenu whether or not the content encoding
135
* menu may be enabled
136
* @param aCharsetAutodetected whether or not the given character set was
137
* autodetected
138
* @param aDocumentURI the URI of the new document
139
* @param aTitle the title of the new doucment
140
* @param aContentPrincipal the security principal of the new document
141
* @param aContentStoragePrincipal the security principal for the new
142
* document's storage
143
* @param aCSP the content security policy of the new document
144
* @param aReferrerInfo the referrer info of the new document
145
* @param aIsSynthetic whether or not the document is synthetic
146
* @param aInnerWindowID the inner window ID of the document
147
* @param aHasRequestContextID whether or not the the request context has a
148
* value (true) or null should be used (false)
149
* @param aRequestContextID the request context ID
150
* @param aContentType the content type of the document
151
*/
152
void updateForLocationChange(in nsIURI aLocation,
153
in AString aCharset,
154
in boolean aMayEnableCharacterEncodingMenu,
155
in boolean aCharsetAutodetected,
156
in nsIURI aDocumentURI,
157
in AString aTitle,
158
in nsIPrincipal aContentPrincipal,
159
in nsIPrincipal aContentStoragePrincipal,
160
in nsIPrincipal aContentBlockingAllowListPrincipal,
161
in nsIContentSecurityPolicy aCSP,
162
in nsIReferrerInfo aReferrerInfo,
163
in boolean aIsSynthetic,
164
in uint64_t aInnerWindowID,
165
in boolean aHasRequestContextID,
166
in uint64_t aRequestContextID,
167
in AString aContentType);
168
169
/**
170
* Called by Gecko when a security chang event needs to update the event
171
* state stored in the security UI object stored in the parent process.
172
*
173
* @param aSecurityInfo the transport security information from the content
174
* process
175
* @param aState the flags from the OnSecurityChange event that triggered
176
* this method, as outlined in nsIWebProgressListener
177
* @param aIsSecureContext whether or not the context is secure
178
*/
179
void updateSecurityUIForSecurityChange(in nsITransportSecurityInfo aSecurityInfo,
180
in uint32_t aState,
181
in boolean aIsSecureContext);
182
};