mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 529769 - notify observers when lightweight theme is selected. r=dtownsend
This commit is contained in:
parent
1ccefba1bf
commit
becf5522cc
@ -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