Bug 650965 Permaorange, logging for Fennec's extension manager r=wesj

This commit is contained in:
Benjamin Stover 2011-04-28 16:29:38 -07:00
parent 633ec13004
commit dc8fd85183

View File

@ -59,6 +59,11 @@ XPCOMUtils.defineLazyGetter(this, "AddonRepository", function() {
return AddonRepository;
});
XPCOMUtils.defineLazyGetter(this, "AddonLogger", function() {
Cu.import("resource://gre/modules/AddonLogging.jsm");
return LogManager.getLogger("FennecExtensions");
});
var ExtensionsView = {
_strings: {},
_list: null,
@ -447,6 +452,7 @@ var ExtensionsView = {
uninstall: function ev_uninstall(aItem) {
let opType;
if (aItem.getAttribute("type") == "search") {
AddonLogger.log("Removing search engine.");
// Make sure the engine isn't hidden before removing it, to make sure it's
// visible if the user later re-adds it (works around bug 341833)
aItem._engine.hidden = false;
@ -454,7 +460,10 @@ var ExtensionsView = {
// the search-engine-modified observer in browser.js will take care of
// updating the list
} else {
AddonLogger.log("Removing extension.");
if (!aItem.addon) {
AddonLogger.log("No addon object, early return.");
this._list.removeChild(aItem);
return;
}
@ -463,6 +472,7 @@ var ExtensionsView = {
opType = this._getOpTypeForOperations(aItem.addon.pendingOperations);
if (aItem.addon.pendingOperations & AddonManager.PENDING_UNINSTALL) {
AddonLogger.log("Add-on is not restartless. Keeping in list.");
this.showRestart();
// A disabled addon doesn't need a restart so it has no pending ops and
@ -472,6 +482,7 @@ var ExtensionsView = {
aItem.setAttribute("opType", opType);
} else {
AddonLogger.log("Add-on is restartless. Removed from list.");
this._list.removeChild(aItem);
}
}