2012-02-23 19:34:18 -08:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2013-06-28 20:25:08 -07:00
|
|
|
"use strict";
|
2012-02-23 19:34:18 -08:00
|
|
|
|
2014-06-10 20:01:00 -07:00
|
|
|
// NB: this file can be loaded from aboutSupport.xhtml or from the
|
|
|
|
// resetProfile.xul dialog, and so Cu may or may not exist already.
|
|
|
|
// Proceed with caution:
|
|
|
|
if (!("Cu" in window)) {
|
|
|
|
window.Cu = Components.utils;
|
|
|
|
}
|
2013-06-28 20:25:08 -07:00
|
|
|
|
|
|
|
Cu.import("resource://gre/modules/Services.jsm");
|
|
|
|
Cu.import("resource://gre/modules/ResetProfile.jsm");
|
2012-03-09 15:21:03 -08:00
|
|
|
|
2012-02-23 19:34:18 -08:00
|
|
|
// based on onImportItemsPageShow from migration.js
|
2012-03-09 15:21:03 -08:00
|
|
|
function populateResetPane(aContainerID) {
|
|
|
|
let resetProfileItems = document.getElementById(aContainerID);
|
|
|
|
try {
|
2013-06-28 20:25:08 -07:00
|
|
|
let dataTypes = ResetProfile.getMigratedData();
|
2012-03-09 15:21:03 -08:00
|
|
|
for (let dataType of dataTypes) {
|
|
|
|
let label = document.createElement("label");
|
|
|
|
label.setAttribute("value", dataType);
|
|
|
|
resetProfileItems.appendChild(label);
|
|
|
|
}
|
|
|
|
} catch (ex) {
|
|
|
|
Cu.reportError(ex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-02-23 19:34:18 -08:00
|
|
|
function onResetProfileLoad() {
|
2012-03-09 15:21:03 -08:00
|
|
|
populateResetPane("migratedItems");
|
|
|
|
}
|
|
|
|
|
2012-02-23 19:34:18 -08:00
|
|
|
function onResetProfileAccepted() {
|
2012-03-09 15:21:03 -08:00
|
|
|
let retVals = window.arguments[0];
|
2012-02-23 19:34:18 -08:00
|
|
|
retVals.reset = true;
|
|
|
|
}
|