mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1140523: Send correct onEnabling/onDisabling notifications when EME preferences change. r=mossop
This commit is contained in:
parent
36d22b63e9
commit
8334bc893e
@ -176,8 +176,8 @@ function GMPWrapper(aPluginInfo) {
|
||||
Preferences.observe(GMPPrefs.getPrefKey(KEY_PLUGIN_VERSION, this._plugin.id),
|
||||
this.onPrefVersionChanged, this);
|
||||
if (this._plugin.isEME) {
|
||||
Preferences.observe(GMPPrefs.getPrefKey(KEY_EME_ENABLED, this._plugin.id),
|
||||
this.onPrefEnabledChanged, this);
|
||||
Preferences.observe(KEY_EME_ENABLED, this.onPrefEMEGlobalEnabledChanged,
|
||||
this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -377,7 +377,7 @@ GMPWrapper.prototype = {
|
||||
return this.version && this.version.length > 0;
|
||||
},
|
||||
|
||||
onPrefEnabledChanged: function() {
|
||||
_handleEnabledChanged: function() {
|
||||
AddonManagerPrivate.callAddonListeners(this.isActive ?
|
||||
"onEnabling" : "onDisabling",
|
||||
this, false);
|
||||
@ -397,6 +397,20 @@ GMPWrapper.prototype = {
|
||||
this);
|
||||
},
|
||||
|
||||
onPrefEMEGlobalEnabledChanged: function() {
|
||||
AddonManagerPrivate.callAddonListeners("onPropertyChanged", this,
|
||||
["appDisabled"]);
|
||||
if (!this.userDisabled) {
|
||||
this._handleEnabledChanged();
|
||||
}
|
||||
},
|
||||
|
||||
onPrefEnabledChanged: function() {
|
||||
if (!this._plugin.isEME || !this.appDisabled) {
|
||||
this._handleEnabledChanged();
|
||||
}
|
||||
},
|
||||
|
||||
onPrefVersionChanged: function() {
|
||||
AddonManagerPrivate.callAddonListeners("onUninstalling", this, false);
|
||||
if (this._gmpPath) {
|
||||
@ -428,9 +442,9 @@ GMPWrapper.prototype = {
|
||||
this.onPrefEnabledChanged, this);
|
||||
Preferences.ignore(GMPPrefs.getPrefKey(KEY_PLUGIN_VERSION, this._plugin.id),
|
||||
this.onPrefVersionChanged, this);
|
||||
if (this._isEME) {
|
||||
Preferences.ignore(GMPPrefs.getPrefKey(KEY_EME_ENABLED, this._plugin.id),
|
||||
this.onPrefEnabledChanged, this);
|
||||
if (this._plugin.isEME) {
|
||||
Preferences.ignore(KEY_EME_ENABLED, this.onPrefEMEGlobalEnabledChanged,
|
||||
this);
|
||||
}
|
||||
return this._updateTask;
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user