50 Components.utils.import(
"resource://app/jsmodules/ArrayConverter.jsm");
51 Components.utils.import(
"resource://app/jsmodules/DOMUtils.jsm");
52 Components.utils.import(
"resource://app/jsmodules/StringUtils.jsm");
62 if (typeof(
Cc) ==
"undefined")
63 var
Cc = Components.classes;
64 if (typeof(
Ci) ==
"undefined")
65 var
Ci = Components.interfaces;
66 if (typeof(
Cr) ==
"undefined")
67 var
Cr = Components.results;
68 if (typeof(
Cu) ==
"undefined")
69 var
Cu = Components.utils;
86 this._widget = aWidget;
106 _domEventListenerSet:
null,
108 _wizardPageElem:
null,
109 _addOnBundleInstallerElem:
null,
122 initialize:
function firstRunInstallAddOnsSvc_initialize() {
130 this._wizardPageElem = this._widget.parentNode;
131 this._wizardElem = this._wizardPageElem.parentNode;
134 this._addOnBundleInstallerElem =
135 this._getElement(
"add_on_bundle_installer");
138 func =
function() { _this._doPageShow(); };
139 this._domEventListenerSet.add(this._wizardPageElem,
143 func =
function() { _this._doPageHide(); };
144 this._domEventListenerSet.add(this._wizardPageElem,
150 func =
function(aEvent) {
return _this._doInstallComplete(aEvent); };
151 this._domEventListenerSet.add(this._addOnBundleInstallerElem,
162 finalize:
function firstRunInstallAddOnsSvc_finalize() {
164 if (this._domEventListenerSet) {
165 this._domEventListenerSet.removeAll();
167 this._domEventListenerSet =
null;
170 if (this._addOnBundleInstallerElem)
171 this._addOnBundleInstallerElem.cancel();
175 this._wizardElem =
null;
176 this._addOnBundleInstallerElem =
null;
190 _doPageShow:
function firstRunInstallAddOnsSvc__doPageShow() {
192 var addOnsID = this._widget.getAttribute(
"addonsid");
193 var addOnBundleProperty =
194 this._widget.getAttribute(
"addonbundleproperty");
195 var addOnsElem = document.getElementById(addOnsID);
196 var addOnBundle = addOnsElem[addOnBundleProperty];
201 this._addOnBundleInstallerElem.install(addOnBundle);
203 this._wizardElem.canAdvance =
true;
204 this._wizardElem.advance();
213 _doPageHide:
function firstRunInstallAddOnsSvc__doPageHide() {
215 this._addOnBundleInstallerElem.cancel();
226 function firstRunInstallAddOnsSvc__doInstallComplete(aEvent) {
228 if (this._addOnBundleInstallerElem.restartRequired)
229 firstRunWizard.restartApp =
true;
233 if (this._addOnBundleInstallerElem.errorCount == 0) {
235 this._wizardElem.canAdvance =
true;
236 this._wizardElem.advance();
239 var okButton = this._wizardElem.getButton(
"next");
240 okButton.label =
SBString(
"first_run.ok.label");
241 okButton.accessKey =
SBString(
"first_run.ok.accesskey");
244 this._wizardPageElem.setAttribute(
"hidecancel",
"true");
245 this._wizardPageElem.setAttribute(
"shownext",
"true");
265 _getElement:
function firstRunInstallAddOnsSvc__getElement(aElementID) {
266 return document.getAnonymousElementByAttribute(this._widget,
function DOMEventListenerSet()
function SBString(aKey, aDefault, aStringBundle)
DataRemote prototype constructor
function firstRunInstallAddOnsSvc(aWidget)