Bug 727408 - Remove nsIPrefBranch2 uses from comm-central, Part E - editor/ ; r=Neil
authorGeoff Lankow <geoff@darktrojan.net>
Wed, 22 Feb 2012 11:46:59 +1300
changeset 10908 38d22eafca6770250bd83ed420b81d52fea00e6d
parent 10907 8b3d55adf7a63521592c9ebc34dd99e43ecc1e88
child 10909 fd98bca81bec47ffb1022edb1163734c6908ff54
push id463
push userbugzilla@standard8.plus.com
push dateTue, 24 Apr 2012 17:34:51 +0000
treeherdercomm-beta@e53588e8f7b0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersNeil
bugs727408
Bug 727408 - Remove nsIPrefBranch2 uses from comm-central, Part E - editor/ ; r=Neil
editor/ui/composer/content/editor.js
editor/ui/composer/content/pref-editing.js
--- a/editor/ui/composer/content/editor.js
+++ b/editor/ui/composer/content/editor.js
@@ -143,27 +143,25 @@ function nsPrefListener(prefName)
 // implements nsIObserver
 nsPrefListener.prototype =
 {
   domain: "",
   startup: function(prefName)
   {
     this.domain = prefName;
     try {
-      var pbi = pref.QueryInterface(Components.interfaces.nsIPrefBranch2);
-      pbi.addObserver(this.domain, this, false);
+      pref.addObserver(this.domain, this, false);
     } catch(ex) {
       dump("Failed to observe prefs: " + ex + "\n");
     }
   },
   shutdown: function()
   {
     try {
-      var pbi = pref.QueryInterface(Components.interfaces.nsIPrefBranch2);
-      pbi.removeObserver(this.domain, this);
+      pref.removeObserver(this.domain, this);
     } catch(ex) {
       dump("Failed to remove pref observers: " + ex + "\n");
     }
   },
   observe: function(subject, topic, prefName)
   {
     if (!IsHTMLEditor())
       return;
--- a/editor/ui/composer/content/pref-editing.js
+++ b/editor/ui/composer/content/pref-editing.js
@@ -32,17 +32,17 @@
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 var gPrefService = Components.classes["@mozilla.org/preferences-service;1"]
-                             .getService(Components.interfaces.nsIPrefBranch2);
+                             .getService(Components.interfaces.nsIPrefBranch);
 const browserPrefsObserver =
 {
   observe: function(aSubject, aTopic, aData)
   {
     if (aTopic != "nsPref:changed" || document.getElementById("editor.use_custom_colors").value)
       return;
 
     switch (aData)