Bug 1665252 - remove allowpaymentrequest attribute from HTMLIFrameElement r=dom-worke...
[gecko.git] / dom / base / nsIObjectLoadingContent.idl
blob81fba90f8a33561388cde0b0f5e9868cca7a04e5
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "nsISupports.idl"
8 interface nsIChannel;
9 interface nsIRequest;
10 interface nsIFrame;
11 interface nsIObjectFrame;
12 interface nsIPluginTag;
13 interface nsIURI;
15 webidl BrowsingContext;
17 %{C++
18 class nsNPAPIPluginInstance;
20 [ptr] native nsNPAPIPluginInstancePtr(nsNPAPIPluginInstance);
22 /**
23 * This interface represents a content node that loads objects.
25 * Please make sure to update the MozObjectLoadingContent WebIDL
26 * mixin to mirror this interface when changing it.
29 [scriptable, builtinclass, uuid(2eb3195e-3eea-4083-bb1d-d2d70fa35ccb)]
30 interface nsIObjectLoadingContent : nsISupports
32 /**
33 * See notes in nsObjectLoadingContent.h
35 const unsigned long TYPE_LOADING = 0;
36 const unsigned long TYPE_IMAGE = 1;
37 const unsigned long TYPE_PLUGIN = 2;
38 const unsigned long TYPE_FAKE_PLUGIN = 3;
39 const unsigned long TYPE_DOCUMENT = 4;
40 const unsigned long TYPE_NULL = 5;
42 const unsigned long PLUGIN_ACTIVE = 0xFF;
44 // The content type is not supported (e.g. plugin not installed)
45 const unsigned long PLUGIN_UNSUPPORTED = 0;
46 // Showing alternate content
47 const unsigned long PLUGIN_ALTERNATE = 1;
48 // The plugin exists, but is disabled
49 const unsigned long PLUGIN_DISABLED = 2;
50 // The plugin is blocklisted and disabled
51 const unsigned long PLUGIN_BLOCKLISTED = 3;
52 // The plugin is considered outdated, but not disabled
53 const unsigned long PLUGIN_OUTDATED = 4;
54 // The plugin has crashed
55 const unsigned long PLUGIN_CRASHED = 5;
56 /// ** All values >= PLUGIN_CLICK_TO_PLAY are plugin placeholder types that
57 /// would be replaced by a real plugin if activated (playPlugin())
58 /// ** Furthermore, values >= PLUGIN_CLICK_TO_PLAY and
59 /// <= PLUGIN_CLICK_TO_PLAY_QUIET are click-to-play types.
60 // The plugin is disabled until the user clicks on it
61 const unsigned long PLUGIN_CLICK_TO_PLAY = 8;
62 // The plugin is vulnerable (update available)
63 const unsigned long PLUGIN_VULNERABLE_UPDATABLE = 9;
64 // The plugin is vulnerable (no update available)
65 const unsigned long PLUGIN_VULNERABLE_NO_UPDATE = 10;
66 // The plugin is click-to-play, but the user won't see overlays
67 const unsigned long PLUGIN_CLICK_TO_PLAY_QUIET = 11;
69 // Plugins-specific permission indicating that we want to prompt the user
70 // to decide whether they want to allow a plugin, but to do so in a less
71 // intrusive way than PROMPT_ACTION would entail. At the time of writing,
72 // this means hiding all in-content plugin overlays, but still showing the
73 // plugin badge in the URL bar.
74 const unsigned long PLUGIN_PERMISSION_PROMPT_ACTION_QUIET = 8;
76 /**
77 * The actual mime type (the one we got back from the network
78 * request) for the element.
80 readonly attribute ACString actualType;
82 /**
83 * Gets the type of the content that's currently loaded. See
84 * the constants above for the list of possible values.
86 readonly attribute unsigned long displayedType;
88 /**
89 * Gets the content type that corresponds to the give MIME type. See the
90 * constants above for the list of possible values. If nothing else fits,
91 * TYPE_NULL will be returned.
93 unsigned long getContentTypeForMIMEType(in AUTF8String aMimeType);
95 /**
96 * Returns the plugin instance if it has already been instantiated. This
97 * will never instantiate the plugin and so is safe to call even when
98 * content script must not execute.
100 [notxpcom,nostdcall] readonly attribute nsNPAPIPluginInstancePtr pluginInstance;
103 * Tells the content about an associated object frame.
104 * This can be called multiple times for different frames.
106 * This is noscript because this is an internal method that will go away, and
107 * because nsIObjectFrame is unscriptable.
109 [noscript] void hasNewFrame(in nsIObjectFrame aFrame);
112 * If this object is in going to be printed, this method
113 * returns the nsIObjectFrame object which should be used when
114 * printing the plugin. The returned nsIFrame is in the original document,
115 * not in the static clone.
117 [noscript] nsIFrame getPrintFrame();
120 * Notifications from pluginhost that our instance crashed or was destroyed.
122 [noscript] void pluginDestroyed();
123 [noscript] void pluginCrashed(in nsIPluginTag pluginTag,
124 in AString pluginDumpID,
125 in boolean submittedCrashReport);
128 * Forces a re-evaluation and reload of the tag, optionally invalidating its
129 * click-to-play state. This can be used when the MIME type that provides a
130 * type has changed, for instance, to force the tag to re-evalulate the
131 * handler to use.
133 void reload(in boolean aClearActivation);
136 * This attribute will return true if the current content type has been
137 * activated, either explicitly or by passing checks that would have it be
138 * click-to-play.
140 readonly attribute boolean activated;
142 [noscript] void stopPluginInstance();
144 [noscript] void syncStartPluginInstance();
145 [noscript] void asyncStartPluginInstance();
148 * Puts the tag in the "waiting on a channel" state and adopts this
149 * channel. This does not override the normal logic of examining attributes
150 * and the channel type, so the load may cancel this channel if it decides not
151 * to use one.
153 * This assumes:
154 * - This tag has not begun loading yet
155 * - This channel has not yet hit OnStartRequest
156 * - The caller will continue to pass channel events to us as a listener
158 [noscript] void initializeFromChannel(in nsIRequest request);
161 * The URL of the data/src loaded in the object. This may be null (i.e.
162 * an <embed> with no src).
164 readonly attribute nsIURI srcURI;
167 * Disable the use of fake plugins and reload the tag if necessary.
169 void skipFakePlugins();
172 * Switch the tag into the TYPE_DOCUMENT state, and returns the
173 * BrowsingContext which the load should complete in.
175 [noscript] BrowsingContext upgradeLoadToDocument(in nsIChannel channel);