CLOSED TREE: TraceMonkey merge head. (a=blockers)
[mozilla-central.git] / toolkit / mozapps / extensions / amIWebInstallListener.idl
blob9a504563993160a2091e7c10aa47e638a2b26411
1 /* ***** BEGIN LICENSE BLOCK *****
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 * The contents of this file are subject to the Mozilla Public License Version
5 * 1.1 (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 * http://www.mozilla.org/MPL/
9 * Software distributed under the License is distributed on an "AS IS" basis,
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 * for the specific language governing rights and limitations under the
12 * License.
14 * The Original Code is the Extension Manager.
16 * The Initial Developer of the Original Code is
17 * the Mozilla Foundation.
18 * Portions created by the Initial Developer are Copyright (C) 2010
19 * the Initial Developer. All Rights Reserved.
21 * Contributor(s):
22 * Dave Townsend <dtownsend@oxymoronical.com>
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
38 #include "nsISupports.idl"
40 interface nsIDOMWindowInternal;
41 interface nsIURI;
42 interface nsIVariant;
44 /**
45 * amIWebInstallInfo is used by the default implementation of
46 * amIWebInstallListener to communicate with the running application and allow
47 * it to warn the user about blocked installs and start the installs running.
49 [scriptable, uuid(8710e692-3989-4dc7-b607-40d57610ae75)]
50 interface amIWebInstallInfo : nsISupports
52 readonly attribute nsIDOMWindowInternal originatingWindow;
53 readonly attribute nsIURI originatingURI;
54 readonly attribute nsIVariant installs;
56 /**
57 * Starts all installs.
59 void install();
62 /**
63 * The registered amIWebInstallListener is used to notify about new installs
64 * triggered by websites. The default implementation displays a confirmation
65 * dialog when add-ons are ready to install and uses the observer service to
66 * notify when installations are blocked.
68 [scriptable, uuid(a5503979-89c8-441e-9e4a-321df379c172)]
69 interface amIWebInstallListener : nsISupports
71 /**
72 * Called when installation by websites is currently disabled.
74 * @param aWindow
75 * The window that triggered the installs
76 * @param aUri
77 * The URI of the site that triggered the installs
78 * @param aInstalls
79 * The AddonInstalls that were blocked
80 * @param aCount
81 * The number of AddonInstalls
83 void onWebInstallDisabled(in nsIDOMWindowInternal aWindow, in nsIURI aUri,
84 [array, size_is(aCount)] in nsIVariant aInstalls,
85 [optional] in PRUint32 aCount);
87 /**
88 * Called when the website is not allowed to directly prompt the user to
89 * install add-ons.
91 * @param aWindow
92 * The window that triggered the installs
93 * @param aUri
94 * The URI of the site that triggered the installs
95 * @param aInstalls
96 * The AddonInstalls that were blocked
97 * @param aCount
98 * The number of AddonInstalls
99 * @return true if the caller should start the installs
101 boolean onWebInstallBlocked(in nsIDOMWindowInternal aWindow, in nsIURI aUri,
102 [array, size_is(aCount)] in nsIVariant aInstalls,
103 [optional] in PRUint32 aCount);
106 * Called when a website wants to ask the user to install add-ons.
108 * @param aWindow
109 * The window that triggered the installs
110 * @param aUri
111 * The URI of the site that triggered the installs
112 * @param aInstalls
113 * The AddonInstalls that were requested
114 * @param aCount
115 * The number of AddonInstalls
116 * @return true if the caller should start the installs
118 boolean onWebInstallRequested(in nsIDOMWindowInternal aWindow, in nsIURI aUri,
119 [array, size_is(aCount)] in nsIVariant aInstalls,
120 [optional] in PRUint32 aCount);
124 * amIWebInstallPrompt is used, if available, by the default implementation of
125 * amIWebInstallInfo to display a confirmation UI to the user before running
126 * installs.
128 [scriptable, uuid(c5529918-4291-4b56-bd46-e9268900f2a3)]
129 interface amIWebInstallPrompt : nsISupports
132 * Get a confirmation that the user wants to start the installs.
134 * @param aWindow
135 * The window that triggered the installs
136 * @param aUri
137 * The URI of the site that triggered the installs
138 * @param aInstalls
139 * The AddonInstalls that were requested
140 * @param aCount
141 * The number of AddonInstalls
143 void confirm(in nsIDOMWindowInternal aWindow, in nsIURI aUri,
144 [array, size_is(aCount)] in nsIVariant aInstalls,
145 [optional] in PRUint32 aCount);