49 Components.utils.import(
"resource://app/jsmodules/AddOnUtils.jsm");
50 Components.utils.import(
"resource://app/jsmodules/DOMUtils.jsm");
60 if (typeof(
Cc) ==
"undefined")
61 var
Cc = Components.classes;
62 if (typeof(
Ci) ==
"undefined")
63 var
Ci = Components.interfaces;
64 if (typeof(
Cr) ==
"undefined")
65 var
Cr = Components.results;
66 if (typeof(
Cu) ==
"undefined")
67 var
Cu = Components.utils;
84 this._widget = aWidget;
111 _domEventListenerSet:
null,
112 _addOnBundleRunning:
false,
113 _addOnBundleLoader:
null,
126 initialize:
function firstRunAddOnsSvc_initialize() {
131 var wizardPageElem = this._widget.parentNode;
137 this._addOnBundleInitialize();
140 func =
function() {
return _this._doPageShow(); };
141 this._domEventListenerSet.add(wizardPageElem,
147 func =
function() {
return _this._doConnectionReset(); };
148 this._domEventListenerSet.add(firstRunWizard.wizardElem,
149 "firstRunConnectionReset",
162 finalize:
function firstRunAddOnsSvc_finalize() {
164 if (this._domEventListenerSet) {
165 this._domEventListenerSet.removeAll();
167 this._domEventListenerSet =
null;
170 this._addOnBundleFinalize();
174 this.addOnBundle =
null;
182 saveSettings:
function firstRunAddOnsSvc_saveSettings() {
184 if (this.addOnBundle) {
185 var extensionCount = this.addOnBundle.bundleExtensionCount;
186 for (var
i = 0;
i < extensionCount;
i++) {
188 var addOnID = this.addOnBundle.getExtensionAttribute(
i,
"id");
207 _doPageShow:
function firstRunAddOnsSvc__doPageShow() {
209 this._addOnBundleStart();
220 _doConnectionReset:
function firstRunAddOnsSvc__doConnectionReset() {
222 if (this.addOnBundle)
226 this._addOnBundleFinalize();
227 this._addOnBundleInitialize();
231 this._addOnBundleContinue();
245 _addOnBundleInitialize:
246 function firstRunAddOnSvc__addOnBundleInitialize() {
248 this.addOnBundle =
null;
249 this._addOnBundleLoader =
null;
257 _addOnBundleFinalize:
258 function firstRunAddOnSvc__addOnBundleFinalize() {
260 if (this._addOnBundleLoader) {
261 this._addOnBundleLoader.cancel();
262 this._addOnBundleLoader =
null;
266 this.addOnBundle =
null;
274 _addOnBundleStart:
function firstRunAddOnSvc__addOnBundleStart() {
276 this._addOnBundleRunning =
true;
277 this._addOnBundleContinue();
285 _addOnBundleContinue:
function firstRunAddOnSvc__addOnBundleContinue() {
287 if (!this._addOnBundleRunning)
299 _getAddOns:
function firstRunAddOnsSvc__getAddOns() {
301 if (!this._addOnBundleLoader) {
310 this._addOnBundleLoader.filterInstalledAddOns =
true;
311 this._addOnBundleLoader.filterBlacklistedAddOns =
true;
315 var func =
function() { _this._getAddOns(); };
316 this._addOnBundleLoader.start(func);
320 if (this._addOnBundleLoader.complete &&
321 Components.isSuccessCode(
this._addOnBundleLoader.result)) {
323 this.addOnBundle = this._addOnBundleLoader.addOnBundle;
326 var addOnBundleElem = this._getElement(
"add_on_bundle");
327 addOnBundleElem.addOnBundle = this._addOnBundleLoader.addOnBundle;
345 _update:
function firstRunAddOnsSvc__update() {
348 if (!this._addOnBundleLoader) {
349 selectedPanel = this._getElement(
"no_status");
353 else if (!this._addOnBundleLoader.complete) {
354 selectedPanel = this._getElement(
"add_ons_loading_status");
358 else if (Components.isSuccessCode(
this._addOnBundleLoader.result)) {
359 selectedPanel = this._getElement(
"add_on_bundle");
363 selectedPanel = this._getElement(
"add_ons_load_failed_status");
367 var statusDeckElem = this._getElement(
"status_deck");
368 statusDeckElem.selectedPanel = selectedPanel;
373 if (this._addOnBundleLoader &&
374 this._addOnBundleLoader.complete &&
375 !Components.isSuccessCode(
this._addOnBundleLoader.result)) {
376 firstRunWizard.handleConnectionError();
390 _getElement:
function firstRunAddOnsSvc__getElement(aElementID) {
391 return document.getAnonymousElementByAttribute(this._widget,
function DOMEventListenerSet()
DataRemote prototype constructor
function firstRunAddOnsSvc(aWidget)
_getSelectedPageStyle s i
function AddOnBundleLoader()