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 65834 7d04e5829627cd99e10c7195a11f2f0b7201a750
parent 65833 b28abc409615d295b2f15f6095364f1ca5334dd7
child 65835 62d70dbe8e2eae3d4082a33aadc58c1dfe36a0bc
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs529074
Bug 529074: Remove use of <preferences> and <preference> from <setting> (parts I missed)
mobile/chrome/content/bindings/setting.xml
--- a/mobile/chrome/content/bindings/setting.xml
+++ b/mobile/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>