Bug 577694 - Add detection of accessibility instantiation [r=mark.finkle]
authorJono X <jdicarlo@mozilla.com>
Mon, 11 Apr 2011 22:30:44 -0400
changeset 67891 a18b849ec285
parent 67890 f7a0e34308cd
child 67892 2a2c474ec4a1
push id19453
push usermfinkle@mozilla.com
push dateTue, 12 Apr 2011 02:35:14 +0000
treeherdermozilla-central@2a2c474ec4a1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmark
bugs577694
milestone2.2a1pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 577694 - Add detection of accessibility instantiation [r=mark.finkle]
browser/app/profile/extensions/testpilot@labs.mozilla.com/modules/metadata.js
--- a/browser/app/profile/extensions/testpilot@labs.mozilla.com/modules/metadata.js
+++ b/browser/app/profile/extensions/testpilot@labs.mozilla.com/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, "");
   },