Bug 1477137 - Part 1: Add onUninstalling and onOperationCancelled listeners to detect removal/undo extension in aboutaddons. r?jdescottes
MozReview-Commit-ID: RaDFBOirgL
--- a/devtools/client/aboutdebugging/components/addons/Panel.js
+++ b/devtools/client/aboutdebugging/components/addons/Panel.js
@@ -49,16 +49,18 @@ class AddonsPanel extends Component {
this.updateDebugStatus = this.updateDebugStatus.bind(this);
this.updateShowSystemStatus = this.updateShowSystemStatus.bind(this);
this.updateAddonsList = this.updateAddonsList.bind(this);
this.onInstalled = this.onInstalled.bind(this);
this.onUninstalled = this.onUninstalled.bind(this);
this.onEnabled = this.onEnabled.bind(this);
this.onDisabled = this.onDisabled.bind(this);
+ this.onUninstalling = this.onUninstalling.bind(this);
+ this.onOperationCancelled = this.onOperationCancelled.bind(this);
}
componentDidMount() {
AddonManager.addAddonListener(this);
// Listen to startup since that's when errors and warnings
// get populated on the extension.
Management.on("startup", this.updateAddonsList);
@@ -147,16 +149,30 @@ class AddonsPanel extends Component {
/**
* Mandatory callback as AddonManager listener.
*/
onDisabled() {
this.updateAddonsList();
}
+ /**
+ * Mandatory callback as AddonManager listener.
+ */
+ onUninstalling() {
+ this.updateAddonsList();
+ }
+
+ /**
+ * Mandatory callback as AddonManager listener.
+ */
+ onOperationCancelled() {
+ this.updateAddonsList();
+ }
+
render() {
const { client, connect, id } = this.props;
const { debugDisabled, extensions: targets, showSystemAddons } = this.state;
const installedName = Strings.GetStringFromName("extensions");
const temporaryName = Strings.GetStringFromName("temporaryExtensions");
const systemName = Strings.GetStringFromName("systemExtensions");
const targetClass = AddonTarget;