diff --git a/dom/webidl/AddonManager.webidl b/dom/webidl/AddonManager.webidl index 714cf28c3e18..1701b575828d 100644 --- a/dom/webidl/AddonManager.webidl +++ b/dom/webidl/AddonManager.webidl @@ -3,9 +3,8 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ -/* We need a JSImplementation but cannot get one without a contract ID. - Since Addon and AddonInstall are only ever created from JS they don't need - real contract IDs. */ +/* We need a JSImplementation but cannot get one without a contract ID. Since + This object is only ever created from JS we don't need a real contract ID. */ [ChromeOnly, JSImplementation="dummy"] interface Addon { // The add-on's ID. @@ -24,27 +23,6 @@ interface Addon { readonly attribute boolean isEnabled; // If the add-on is currently active in the browser. readonly attribute boolean isActive; - - Promise uninstall(); -}; - -[ChromeOnly, JSImplementation="dummy"] -interface AddonInstall : EventTarget { - // One of the STATE_* symbols from AddonManager.jsm - readonly attribute DOMString state; - // One of the ERROR_* symbols from AddonManager.jsm, or null - readonly attribute DOMString? error; - // How many bytes have been downloaded - readonly attribute long long progress; - // How many total bytes will need to be downloaded or -1 if unknown - readonly attribute long long maxProgress; - - Promise install(); - Promise cancel(); -}; - -dictionary addonInstallOptions { - required DOMString url; }; [HeaderFile="mozilla/AddonManagerWebAPI.h", @@ -60,13 +38,4 @@ interface AddonManager { * @return A promise. It will resolve to an Addon if the add-on is installed. */ Promise getAddonByID(DOMString id); - - /** - * Creates an AddonInstall object for a given URL. - * - * @param options - * Only one supported option: 'url', the URL of the addon to install. - * @return A promise that resolves to an instance of AddonInstall. - */ - Promise createInstall(optional addonInstallOptions options); }; diff --git a/toolkit/mozapps/extensions/amWebAPI.js b/toolkit/mozapps/extensions/amWebAPI.js index 68b468ca982c..e83a9ccadb84 100644 --- a/toolkit/mozapps/extensions/amWebAPI.js +++ b/toolkit/mozapps/extensions/amWebAPI.js @@ -55,16 +55,11 @@ const APIBroker = { APIBroker.init(); -function Addon(win, properties) { +function Addon(properties) { // We trust the webidl binding to broker access to our properties. for (let key of Object.keys(properties)) { this[key] = properties[key]; } - - this.uninstall = function() { - let err = new win.Error("not yet implemented"); - return win.Promise.reject(err); - }; } /** @@ -102,14 +97,9 @@ WebAPI.prototype = { getAddonByID: WebAPITask(function*(id) { let addonInfo = yield APIBroker.sendRequest("getAddonByID", id); - return addonInfo ? new Addon(this.window, addonInfo) : null; + return addonInfo ? new Addon(addonInfo) : null; }), - createInstall() { - let err = new this.window.Error("not yet implemented"); - return this.window.Promise.reject(err); - }, - classID: Components.ID("{8866d8e3-4ea5-48b7-a891-13ba0ac15235}"), contractID: "@mozilla.org/addon-web-api/manager;1", QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports, Ci.nsIDOMGlobalPropertyInitializer])