2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2012-12-10 16:35:05 -08:00
|
|
|
interface nsIRequest;
|
2009-12-10 20:02:13 -08:00
|
|
|
interface nsIFrame;
|
2007-03-22 10:30:00 -07:00
|
|
|
interface nsIObjectFrame;
|
2010-03-16 22:10:08 -07:00
|
|
|
interface nsIPluginTag;
|
2009-11-20 08:26:10 -08:00
|
|
|
interface nsIDOMElement;
|
|
|
|
interface nsIDOMClientRect;
|
2012-02-27 13:58:00 -08:00
|
|
|
interface nsIURI;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-05-17 18:48:34 -07:00
|
|
|
%{C++
|
2013-08-26 22:05:29 -07:00
|
|
|
class nsNPAPIPluginInstance;
|
2011-05-17 18:48:34 -07:00
|
|
|
%}
|
|
|
|
[ptr] native nsNPAPIPluginInstancePtr(nsNPAPIPluginInstance);
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
/**
|
|
|
|
* This interface represents a content node that loads objects.
|
2013-03-04 11:08:24 -08:00
|
|
|
*
|
|
|
|
* Please make sure to update the MozObjectLoadingContent WebIDL
|
|
|
|
* interface to mirror this interface when changing it.
|
2007-03-22 10:30:00 -07:00
|
|
|
*/
|
2012-06-19 16:25:56 -07:00
|
|
|
|
2015-08-20 13:15:18 -07:00
|
|
|
[scriptable, uuid(2eb3195e-3eea-4083-bb1d-d2d70fa35ccb)]
|
2007-03-22 10:30:00 -07:00
|
|
|
interface nsIObjectLoadingContent : nsISupports
|
|
|
|
{
|
2012-07-05 14:07:46 -07:00
|
|
|
/**
|
|
|
|
* See notes in nsObjectLoadingContent.h
|
|
|
|
*/
|
2007-03-22 10:30:00 -07:00
|
|
|
const unsigned long TYPE_LOADING = 0;
|
|
|
|
const unsigned long TYPE_IMAGE = 1;
|
|
|
|
const unsigned long TYPE_PLUGIN = 2;
|
|
|
|
const unsigned long TYPE_DOCUMENT = 3;
|
|
|
|
const unsigned long TYPE_NULL = 4;
|
|
|
|
|
2013-06-24 05:51:07 -07:00
|
|
|
const unsigned long PLUGIN_ACTIVE = 0xFF;
|
|
|
|
|
2012-08-20 15:00:51 -07:00
|
|
|
// The content type is not supported (e.g. plugin not installed)
|
|
|
|
const unsigned long PLUGIN_UNSUPPORTED = 0;
|
|
|
|
// Showing alternate content
|
|
|
|
const unsigned long PLUGIN_ALTERNATE = 1;
|
|
|
|
// The plugin exists, but is disabled
|
|
|
|
const unsigned long PLUGIN_DISABLED = 2;
|
|
|
|
// The plugin is blocklisted and disabled
|
|
|
|
const unsigned long PLUGIN_BLOCKLISTED = 3;
|
|
|
|
// The plugin is considered outdated, but not disabled
|
|
|
|
const unsigned long PLUGIN_OUTDATED = 4;
|
|
|
|
// The plugin has crashed
|
|
|
|
const unsigned long PLUGIN_CRASHED = 5;
|
|
|
|
// Suppressed by security policy
|
|
|
|
const unsigned long PLUGIN_SUPPRESSED = 6;
|
|
|
|
// Blocked by content policy
|
|
|
|
const unsigned long PLUGIN_USER_DISABLED = 7;
|
2012-10-04 12:57:24 -07:00
|
|
|
/// ** All values >= PLUGIN_CLICK_TO_PLAY are plugin placeholder types that
|
|
|
|
/// would be replaced by a real plugin if activated (playPlugin())
|
2012-12-05 13:00:52 -08:00
|
|
|
/// ** Furthermore, values >= PLUGIN_CLICK_TO_PLAY and
|
|
|
|
/// <= PLUGIN_VULNERABLE_NO_UPDATE are click-to-play types.
|
2012-08-20 15:00:51 -07:00
|
|
|
// The plugin is disabled until the user clicks on it
|
|
|
|
const unsigned long PLUGIN_CLICK_TO_PLAY = 8;
|
|
|
|
// The plugin is vulnerable (update available)
|
|
|
|
const unsigned long PLUGIN_VULNERABLE_UPDATABLE = 9;
|
|
|
|
// The plugin is vulnerable (no update available)
|
|
|
|
const unsigned long PLUGIN_VULNERABLE_NO_UPDATE = 10;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
/**
|
|
|
|
* The actual mime type (the one we got back from the network
|
|
|
|
* request) for the element.
|
|
|
|
*/
|
|
|
|
readonly attribute ACString actualType;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the type of the content that's currently loaded. See
|
|
|
|
* the constants above for the list of possible values.
|
|
|
|
*/
|
|
|
|
readonly attribute unsigned long displayedType;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the content type that corresponds to the give MIME type. See the
|
|
|
|
* constants above for the list of possible values. If nothing else fits,
|
|
|
|
* TYPE_NULL will be returned.
|
|
|
|
*/
|
|
|
|
unsigned long getContentTypeForMIMEType(in AUTF8String aMimeType);
|
|
|
|
|
2013-03-21 18:02:23 -07:00
|
|
|
/**
|
|
|
|
* Returns the base URI of the object as seen by plugins. This differs from
|
|
|
|
* the normal codebase in that it takes <param> tags and plugin-specific
|
|
|
|
* quirks into account.
|
|
|
|
*/
|
|
|
|
[noscript] readonly attribute nsIURI baseURI;
|
|
|
|
|
2008-03-14 16:08:57 -07:00
|
|
|
/**
|
|
|
|
* Returns the plugin instance if it has already been instantiated. This
|
|
|
|
* will never instantiate the plugin and so is safe to call even when
|
|
|
|
* content script must not execute.
|
|
|
|
*/
|
2011-05-17 18:48:34 -07:00
|
|
|
[noscript] readonly attribute nsNPAPIPluginInstancePtr pluginInstance;
|
2008-03-14 16:08:57 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
/**
|
|
|
|
* Tells the content about an associated object frame.
|
|
|
|
* This can be called multiple times for different frames.
|
|
|
|
*
|
|
|
|
* This is noscript because this is an internal method that will go away, and
|
|
|
|
* because nsIObjectFrame is unscriptable.
|
|
|
|
*/
|
|
|
|
[noscript] void hasNewFrame(in nsIObjectFrame aFrame);
|
2009-11-20 08:26:10 -08:00
|
|
|
|
2009-12-10 20:02:13 -08:00
|
|
|
/**
|
|
|
|
* If this object is in going to be printed, this method
|
|
|
|
* returns the nsIObjectFrame object which should be used when
|
|
|
|
* printing the plugin. The returned nsIFrame is in the original document,
|
|
|
|
* not in the static clone.
|
|
|
|
*/
|
|
|
|
[noscript] nsIFrame getPrintFrame();
|
2010-01-13 08:42:41 -08:00
|
|
|
|
2013-03-19 15:38:25 -07:00
|
|
|
/*
|
|
|
|
* Notifications from pluginhost that our instance crashed or was destroyed.
|
|
|
|
*/
|
|
|
|
[noscript] void pluginDestroyed();
|
2010-03-16 22:10:08 -07:00
|
|
|
[noscript] void pluginCrashed(in nsIPluginTag pluginTag,
|
2010-03-24 14:22:04 -07:00
|
|
|
in AString pluginDumpID,
|
|
|
|
in AString browserDumpID,
|
2010-02-09 17:05:31 -08:00
|
|
|
in boolean submittedCrashReport);
|
2011-12-10 09:23:05 -08:00
|
|
|
|
|
|
|
/**
|
2015-08-20 13:15:18 -07:00
|
|
|
* This method will play a plugin that has been stopped by click-to-play.
|
2011-12-10 09:23:05 -08:00
|
|
|
*/
|
|
|
|
void playPlugin();
|
2012-01-31 13:55:54 -08:00
|
|
|
|
2013-06-18 14:35:26 -07:00
|
|
|
/**
|
|
|
|
* Forces a re-evaluation and reload of the tag, optionally invalidating its
|
|
|
|
* click-to-play state. This can be used when the MIME type that provides a
|
|
|
|
* type has changed, for instance, to force the tag to re-evalulate the
|
|
|
|
* handler to use.
|
|
|
|
*/
|
|
|
|
void reload(in boolean aClearActivation);
|
|
|
|
|
2012-03-28 08:53:56 -07:00
|
|
|
/**
|
2012-10-04 12:57:24 -07:00
|
|
|
* This attribute will return true if the current content type has been
|
|
|
|
* activated, either explicitly or by passing checks that would have it be
|
2015-08-20 13:15:18 -07:00
|
|
|
* click-to-play.
|
2012-03-28 08:53:56 -07:00
|
|
|
*/
|
|
|
|
readonly attribute boolean activated;
|
|
|
|
|
2012-01-31 13:55:54 -08:00
|
|
|
[noscript] void stopPluginInstance();
|
|
|
|
|
|
|
|
[noscript] void syncStartPluginInstance();
|
|
|
|
[noscript] void asyncStartPluginInstance();
|
2012-03-12 09:48:27 -07:00
|
|
|
|
2012-12-10 16:35:05 -08:00
|
|
|
/**
|
|
|
|
* Puts the tag in the "waiting on a channel" state and adopts this
|
|
|
|
* channel. This does not override the normal logic of examining attributes
|
|
|
|
* and the channel type, so the load may cancel this channel if it decides not
|
|
|
|
* to use one.
|
|
|
|
*
|
|
|
|
* This assumes:
|
|
|
|
* - This tag has not begun loading yet
|
|
|
|
* - This channel has not yet hit OnStartRequest
|
|
|
|
* - The caller will continue to pass channel events to us as a listener
|
|
|
|
*/
|
|
|
|
[noscript] void initializeFromChannel(in nsIRequest request);
|
|
|
|
|
2012-03-12 09:48:27 -07:00
|
|
|
/**
|
|
|
|
* The URL of the data/src loaded in the object. This may be null (i.e.
|
|
|
|
* an <embed> with no src).
|
|
|
|
*/
|
|
|
|
readonly attribute nsIURI srcURI;
|
2012-08-20 15:00:51 -07:00
|
|
|
|
2013-06-24 05:51:07 -07:00
|
|
|
/**
|
|
|
|
* The plugin's current state of fallback content. This property
|
|
|
|
* only makes sense if the plugin is not activated.
|
|
|
|
*/
|
2012-08-20 15:00:51 -07:00
|
|
|
readonly attribute unsigned long pluginFallbackType;
|
2012-08-25 14:18:44 -07:00
|
|
|
|
2013-03-07 16:11:27 -08:00
|
|
|
/**
|
|
|
|
* If this object currently owns a running plugin, regardless of whether or
|
|
|
|
* not one is pending spawn/despawn.
|
|
|
|
*/
|
|
|
|
readonly attribute bool hasRunningPlugin;
|
|
|
|
|
2015-03-17 10:28:32 -07:00
|
|
|
/**
|
|
|
|
* If this plugin runs out-of-process, it has a runID to differentiate
|
|
|
|
* between different times the plugin process has been instantiated.
|
|
|
|
*
|
|
|
|
* This throws NS_ERROR_NOT_IMPLEMENTED for in-process plugins.
|
|
|
|
*/
|
|
|
|
readonly attribute unsigned long runID;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|