diff options
author | Einar Egilsson | 2009-10-20 13:04:15 +0000 |
---|---|---|
committer | Einar Egilsson | 2009-10-20 13:04:15 +0000 |
commit | 1059664ff4a3c92b2c6a4720f695e158aed215e4 (patch) | |
tree | a8313f1f52d9a10d13bd5e2a27e7a563ef3e8e3a /chrome/content/code/browserOverlay.xul.js | |
parent | 85e1989a00957f4f08ea6720e0b884b278f24714 (diff) |
Changed to use actual interfaces! Seems to work, tiny bug left in unit tests.
git-svn-id: http://einaregilsson.googlecode.com/svn/mozilla/redirector/trunk@285 119bf307-c92d-0410-89bd-8f53e6181181
Diffstat (limited to 'chrome/content/code/browserOverlay.xul.js')
-rw-r--r-- | chrome/content/code/browserOverlay.xul.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/chrome/content/code/browserOverlay.xul.js b/chrome/content/code/browserOverlay.xul.js index 28047b1..2a6fbac 100644 --- a/chrome/content/code/browserOverlay.xul.js +++ b/chrome/content/code/browserOverlay.xul.js @@ -1,10 +1,11 @@ //// $Id$ -var Redirector = Components.classes["@einaregilsson.com/redirector;1"].getService(Components.interfaces.nsISupports).wrappedJSObject; +var Redirector = Components.classes["@einaregilsson.com/redirector;1"].getService(Components.interfaces.rdIRedirector); var RedirectorOverlay = { strings : null, + prefs : null, onLoad : function(event) { try { @@ -14,8 +15,9 @@ var RedirectorOverlay = { .addEventListener("popupshowing", function(e) { RedirectorOverlay.showContextMenu(e); }, false); this.strings = document.getElementById("redirector-strings"); - this.changedPrefs(Redirector.prefs); - Redirector.prefs.addListener(this); + this.prefs = new Prefs(); + this.changedPrefs(this.prefs); + this.prefs.addListener(this); } catch(e) { if (this.strings) { alert(this.strings.getString("initError") + "\n\n" + e); @@ -26,7 +28,7 @@ var RedirectorOverlay = { }, onUnload : function(event) { - Redirector.prefs.removeListener(this); + this.prefs.dispose(); Redirector.debug("Finished cleanup"); }, @@ -71,7 +73,7 @@ var RedirectorOverlay = { }, toggleEnabled : function(event) { - Redirector.prefs.enabled = !Redirector.prefs.enabled; + this.prefs.enabled = !this.prefs.enabled; }, openSettings : function() { |