Bug 1366837 - Add AccessibleHandler registration info to aboutSupport. r=smaug r=aklotz

This commit is contained in:
Eitan Isaacson 2017-06-15 09:04:36 -07:00
Родитель 109fff34b9
Коммит 309b4202e7
7 изменённых файлов: 36 добавлений и 4 удалений

Просмотреть файл

@ -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) {

Просмотреть файл

@ -534,6 +534,16 @@
<td id="a11y-force-disabled">
</td>
</tr>
#if defined(XP_WIN)
<tr>
<th class="column">
&aboutSupport.a11yHandlerUsed;
</th>
<td id="a11y-handler-used">
</td>
</tr>
#endif
</tbody>
</table>

Просмотреть файл

@ -108,6 +108,7 @@ variant of aboutSupport.showDir.label. -->
<!ENTITY aboutSupport.a11yTitle "Accessibility">
<!ENTITY aboutSupport.a11yActivated "Activated">
<!ENTITY aboutSupport.a11yForceDisabled "Prevent Accessibility">
<!ENTITY aboutSupport.a11yHandlerUsed "Accessible Handler Used">
<!ENTITY aboutSupport.libraryVersionsTitle "Library Versions">

Просмотреть файл

@ -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);
},

Просмотреть файл

@ -397,6 +397,9 @@ const SNAPSHOT_SCHEMA = {
forceDisabled: {
type: "number",
},
handlerUsed: {
type: "boolean",
},
},
},
libraryVersions: {

Просмотреть файл

@ -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)
{

Просмотреть файл

@ -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.
*/