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