From 309b4202e7f774abedfa7bb13c978b47eb410ba7 Mon Sep 17 00:00:00 2001 From: Eitan Isaacson Date: Thu, 15 Jun 2017 09:04:36 -0700 Subject: [PATCH] Bug 1366837 - Add AccessibleHandler registration info to aboutSupport. r=smaug r=aklotz --- toolkit/content/aboutSupport.js | 1 + toolkit/content/aboutSupport.xhtml | 10 ++++++++++ .../locales/en-US/chrome/global/aboutSupport.dtd | 1 + toolkit/modules/Troubleshoot.jsm | 5 ++--- .../modules/tests/browser/browser_Troubleshoot.js | 3 +++ toolkit/xre/nsAppRunner.cpp | 13 +++++++++++++ xpcom/system/nsIXULRuntime.idl | 7 ++++++- 7 files changed, 36 insertions(+), 4 deletions(-) diff --git a/toolkit/content/aboutSupport.js b/toolkit/content/aboutSupport.js index e2389a513360..5f410877e18a 100644 --- a/toolkit/content/aboutSupport.js +++ b/toolkit/content/aboutSupport.js @@ -564,6 +564,7 @@ var snapshotFormatters = { accessibility: function accessibility(data) { $("a11y-activated").textContent = data.isActive; $("a11y-force-disabled").textContent = data.forceDisabled || 0; + $("a11y-handler-used").textContent = data.handlerUsed; }, libraryVersions: function libraryVersions(data) { diff --git a/toolkit/content/aboutSupport.xhtml b/toolkit/content/aboutSupport.xhtml index f8e1b3c1924f..d63829d5f869 100644 --- a/toolkit/content/aboutSupport.xhtml +++ b/toolkit/content/aboutSupport.xhtml @@ -534,6 +534,16 @@ +#if defined(XP_WIN) + + + &aboutSupport.a11yHandlerUsed; + + + + + +#endif diff --git a/toolkit/locales/en-US/chrome/global/aboutSupport.dtd b/toolkit/locales/en-US/chrome/global/aboutSupport.dtd index 77875bbb4d63..668b82a1ba4d 100644 --- a/toolkit/locales/en-US/chrome/global/aboutSupport.dtd +++ b/toolkit/locales/en-US/chrome/global/aboutSupport.dtd @@ -108,6 +108,7 @@ variant of aboutSupport.showDir.label. --> + diff --git a/toolkit/modules/Troubleshoot.jsm b/toolkit/modules/Troubleshoot.jsm index 12d4139772db..c214b9a3ede8 100644 --- a/toolkit/modules/Troubleshoot.jsm +++ b/toolkit/modules/Troubleshoot.jsm @@ -541,14 +541,13 @@ var dataProviders = { accessibility: function accessibility(done) { let data = {}; - data.isActive = Cc["@mozilla.org/xre/app-info;1"]. - getService(Ci.nsIXULRuntime). - accessibilityEnabled; + data.isActive = Services.appinfo.accessibilityEnabled; // eslint-disable-next-line mozilla/use-default-preference-values try { data.forceDisabled = Services.prefs.getIntPref("accessibility.force_disabled"); } catch (e) {} + data.handlerUsed = Services.appinfo.accessibleHandlerUsed; done(data); }, diff --git a/toolkit/modules/tests/browser/browser_Troubleshoot.js b/toolkit/modules/tests/browser/browser_Troubleshoot.js index 0f7c44039c48..0d671567b37c 100644 --- a/toolkit/modules/tests/browser/browser_Troubleshoot.js +++ b/toolkit/modules/tests/browser/browser_Troubleshoot.js @@ -397,6 +397,9 @@ const SNAPSHOT_SCHEMA = { forceDisabled: { type: "number", }, + handlerUsed: { + type: "boolean", + }, }, }, libraryVersions: { diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index 839e237ab3bf..0d5ae04b39a1 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -121,6 +121,7 @@ #include "nsAccessibilityService.h" #if defined(XP_WIN) #include "mozilla/a11y/Compatibility.h" +#include "mozilla/a11y/Platform.h" #endif #endif @@ -968,6 +969,18 @@ nsXULAppInfo::GetAccessibilityEnabled(bool* aResult) return NS_OK; } +NS_IMETHODIMP +nsXULAppInfo::GetAccessibleHandlerUsed(bool* aResult) +{ +#if defined(ACCESSIBILITY) && defined(XP_WIN) + *aResult = Preferences::GetBool("accessibility.handler.enabled", false) && + a11y::IsHandlerRegistered(); +#else + *aResult = false; +#endif + return NS_OK; +} + NS_IMETHODIMP nsXULAppInfo::GetIs64Bit(bool* aResult) { diff --git a/xpcom/system/nsIXULRuntime.idl b/xpcom/system/nsIXULRuntime.idl index 91480aaddadf..1f5e909d1473 100644 --- a/xpcom/system/nsIXULRuntime.idl +++ b/xpcom/system/nsIXULRuntime.idl @@ -24,7 +24,7 @@ uint32_t GetMaxWebProcessCount(); * stable/frozen, please contact Benjamin Smedberg. */ -[scriptable, uuid(a1b2e167-b748-42bf-ba85-996ec39062b9)] +[scriptable, uuid(03602fac-fa3f-4a50-9baa-b88456fb4a0f)] interface nsIXULRuntime : nsISupports { /** @@ -131,6 +131,11 @@ interface nsIXULRuntime : nsISupports */ readonly attribute boolean accessibilityEnabled; + /** + * If true, the AccessibleHandler dll is used. + */ + readonly attribute boolean accessibleHandlerUsed; + /** * Indicates whether the current Firefox build is 64-bit. */