Bug 577694 done - included accessibility instantiation in metaata.
authorJono X <jono@mozilla.com>
Wed, 06 Apr 2011 10:58:44 -0700
changeset 576 06e4b698b9fd
parent 575 31d411b1c202
child 577 c09552e85ab4
push id476
push userjdicarlo@mozilla.com
push dateWed, 06 Apr 2011 17:59:04 +0000
bugs577694
Bug 577694 done - included accessibility instantiation in metaata.
extension/modules/metadata.js
--- a/extension/modules/metadata.js
+++ b/extension/modules/metadata.js
@@ -112,16 +112,29 @@ let MetadataCollector = {
 
     for (let i = 0; i < length; i++) {
       prefName = "accessibility." + children[i];
       prefValue =
         Application.prefs.getValue(prefName, "");
       accessibilities.push({ name: prefName, value: prefValue });
     }
 
+    /* Detect accessibility instantiation
+     * (David Bolter's code from bug 577694) */
+    let enabled;
+    try {
+      enabled = Components.manager.QueryInterface(Ci.nsIServiceManager)
+                  .isServiceInstantiatedByContractID(
+                    "@mozilla.org/accessibilityService;1",
+                    Ci.nsISupports);
+    } catch (ex) {
+      enabled = false;
+    }
+    accessibilities.push({name: "isInstantiated", value: enabled});
+
     return accessibilities;
   },
 
   getLocation: function MetadataCollector_getLocation() {
     // we don't want the lat/long, we just want the country
     // so use the Locale.
     return Application.prefs.getValue(LOCALE_PREF, "");
   },