mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 529769 - notify observers when lightweight theme is selected. r=dtownsend
This commit is contained in:
parent
cb5d727842
commit
085ba1f40e
@ -42,7 +42,7 @@ function LightweightThemeConsumer(aDocument) {
|
||||
|
||||
Components.classes["@mozilla.org/observer-service;1"]
|
||||
.getService(Components.interfaces.nsIObserverService)
|
||||
.addObserver(this, "lightweight-theme-changed", false);
|
||||
.addObserver(this, "lightweight-theme-styling-update", false);
|
||||
|
||||
var temp = {};
|
||||
Components.utils.import("resource://gre/modules/LightweightThemeManager.jsm", temp);
|
||||
@ -51,7 +51,7 @@ function LightweightThemeConsumer(aDocument) {
|
||||
|
||||
LightweightThemeConsumer.prototype = {
|
||||
observe: function (aSubject, aTopic, aData) {
|
||||
if (aTopic != "lightweight-theme-changed")
|
||||
if (aTopic != "lightweight-theme-styling-update")
|
||||
return;
|
||||
|
||||
this._update(JSON.parse(aData));
|
||||
@ -60,7 +60,7 @@ LightweightThemeConsumer.prototype = {
|
||||
destroy: function () {
|
||||
Components.classes["@mozilla.org/observer-service;1"]
|
||||
.getService(Components.interfaces.nsIObserverService)
|
||||
.removeObserver(this, "lightweight-theme-changed");
|
||||
.removeObserver(this, "lightweight-theme-styling-update");
|
||||
|
||||
this._doc = null;
|
||||
},
|
||||
|
@ -133,6 +133,7 @@ var LightweightThemeManager = {
|
||||
|
||||
_prefs.setBoolPref("isThemeSelected", aData != null);
|
||||
_notifyWindows(aData);
|
||||
_observerService.notifyObservers(null, "lightweight-theme-changed", null);
|
||||
|
||||
if (PERSIST_ENABLED && aData)
|
||||
_persistImages(aData);
|
||||
@ -282,7 +283,7 @@ function _updateUsedThemes(aList) {
|
||||
}
|
||||
|
||||
function _notifyWindows(aThemeData) {
|
||||
_observerService.notifyObservers(null, "lightweight-theme-changed",
|
||||
_observerService.notifyObservers(null, "lightweight-theme-styling-update",
|
||||
JSON.stringify(aThemeData));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user