Bug 529074: Remove use of <preferences> and <preference> from <setting> (parts I missed)
authorMark Finkle <mfinkle@mozilla.com>
Mon, 23 Nov 2009 08:25:11 -0500
changeset 1146 3f5505c912c2223e64ee339911c0d0e87d4fbc7d
parent 1145 1aadf6e5827033e1a424354ea1b6068d3f2dbea7
child 1147 597af8186228ef6efd0cdff0351b23317fed498e
push id1013
push usermfinkle@mozilla.com
push dateMon, 23 Nov 2009 13:25:46 +0000
bugs529074
Bug 529074: Remove use of <preferences> and <preference> from <setting> (parts I missed)
chrome/content/bindings/setting.xml
--- a/chrome/content/bindings/setting.xml
+++ b/chrome/content/bindings/setting.xml
@@ -53,17 +53,17 @@
       <field name="prefs">
         Components.classes["@mozilla.org/preferences-service;1"]
                   .getService(Components.interfaces.nsIPrefBranch2);
       </field>
     </implementation>
   </binding>
 
   <binding id="setting-base">
-    <implementation implements="nsIObserver">
+    <implementation>
       <constructor><![CDATA[
         this.preferenceChanged();
         
         if (this.usePref)
           this._prefs.addObserver(this.pref, this._observer, true);
       ]]></constructor>
 
       <field name="_observer"><![CDATA[({
@@ -155,18 +155,20 @@
       </method>
 
       <property name="usePref" readonly="true" onget="return this.hasAttribute('pref');"/>
       <property name="pref" readonly="true" onget="return this.getAttribute('pref');"/>
       <property name="type" readonly="true" onget="return this.getAttribute('type');"/>
       <property name="value" onget="return this.input.value;" onset="return this.input.value = val;"/>
 
       <field name="_prefs">
-        Components.classes["@mozilla.org/preferences-service;1"]
-                  .getService(Components.interfaces.nsIPrefBranch2);
+        this.settings ?
+          this.settings.prefs :
+          Components.classes["@mozilla.org/preferences-service;1"]
+                    .getService(Components.interfaces.nsIPrefBranch2);
       </field>
 
       <field name="_updatingInput">false</field>
       <field name="input">document.getAnonymousElementByAttribute(this, "anonid", "input");</field>
 
       <field name="settings">
         this.parentNode.localName == "settings" ? this.parentNode : null;
       </field>