mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 698738 - Use the observer method for idle-daily and formhistory-expire-now in nsFormHistory.js. r=mak.
This commit is contained in:
parent
cad36b0123
commit
1cb06a8637
@ -138,8 +138,8 @@ FormHistory.prototype = {
|
||||
this.messageManager.addMessageListener("FormHistory:FormSubmitEntries", this);
|
||||
|
||||
// Add observers
|
||||
Services.obs.addObserver(function() { self.expireOldEntries() }, "idle-daily", false);
|
||||
Services.obs.addObserver(function() { self.expireOldEntries() }, "formhistory-expire-now", false);
|
||||
Services.obs.addObserver(this, "idle-daily", false);
|
||||
Services.obs.addObserver(this, "formhistory-expire-now", false);
|
||||
},
|
||||
|
||||
/* ---- message listener ---- */
|
||||
@ -395,10 +395,18 @@ FormHistory.prototype = {
|
||||
|
||||
|
||||
observe : function (subject, topic, data) {
|
||||
if (topic == "nsPref:changed")
|
||||
switch(topic) {
|
||||
case "nsPref:changed":
|
||||
this.updatePrefs();
|
||||
else
|
||||
break;
|
||||
case "idle-daily":
|
||||
case "formhistory-expire-now":
|
||||
this.expireOldEntries();
|
||||
break;
|
||||
default:
|
||||
this.log("Oops! Unexpected notification: " + topic);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user