dom/webidl/InstallTrigger.webidl

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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 file,
     3  * You can obtain one at http://mozilla.org/MPL/2.0/.
     4  */
     7 /**
     8  * A callback function that webpages can implement to be notified when triggered
     9  * installs complete.
    10  */
    11 callback InstallTriggerCallback = void(DOMString url, short status);
    13 dictionary InstallTriggerData {
    14   DOMString URL;
    15   DOMString? IconURL;
    16   DOMString? Hash;
    17 };
    19 /**
    20  * The interface for the InstallTrigger object available to all websites.
    21  */
    22 [ChromeOnly,
    23  JSImplementation="@mozilla.org/addons/installtrigger;1"]
    24 interface InstallTriggerImpl {
    25   /**
    26    * Retained for backwards compatibility.
    27    */
    28   const unsigned short SKIN = 1;
    29   const unsigned short LOCALE = 2;
    30   const unsigned short CONTENT = 4;
    31   const unsigned short PACKAGE = 7;
    33   /**
    34    * Tests if installation is enabled.
    35    */
    36   boolean enabled();
    38   /**
    39    * Tests if installation is enabled.
    40    *
    41    * @deprecated Use "enabled" in the future.
    42    */
    43   boolean updateEnabled();
    45   /**
    46    * Starts a new installation of a set of add-ons.
    47    *
    48    * @param  aArgs
    49    *         The add-ons to install. This should be a JS object, each property
    50    *         is the name of an add-on to be installed. The value of the
    51    *         property should either be a string URL, or an object with the
    52    *         following properties:
    53    *          * URL for the add-on's URL
    54    *          * IconURL for an icon for the add-on
    55    *          * Hash for a hash of the add-on
    56    * @param  aCallback
    57    *         A callback to call as each installation succeeds or fails
    58    * @return true if the installations were successfully started
    59    */
    60   boolean install(MozMap<(DOMString or InstallTriggerData)> installs,
    61                   optional InstallTriggerCallback callback);
    63   /**
    64    * Starts installing a new add-on.
    65    *
    66    * @deprecated use "install" in the future.
    67    *
    68    * @param  aType
    69    *         Unused, retained for backwards compatibility
    70    * @param  aUrl
    71    *         The URL of the add-on
    72    * @param  aSkin
    73    *         Unused, retained for backwards compatibility
    74    * @return true if the installation was successfully started
    75    */
    76   boolean installChrome(unsigned short type, DOMString url, DOMString skin);
    78   /**
    79    * Starts installing a new add-on.
    80    *
    81    * @deprecated use "install" in the future.
    82    *
    83    * @param  aUrl
    84    *         The URL of the add-on
    85    * @param  aFlags
    86    *         Unused, retained for backwards compatibility
    87    * @return true if the installation was successfully started
    88    */
    89   boolean startSoftwareUpdate(DOMString url, optional unsigned short flags);
    90 };

mercurial