зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1384672
- Add accessibility instantiator to about:support. r=jimm
This commit is contained in:
Родитель
d25ebee412
Коммит
e6166bf4d1
|
@ -45,7 +45,16 @@ bool ShouldA11yBeEnabled();
|
|||
#endif
|
||||
|
||||
#if defined(XP_WIN)
|
||||
/*
|
||||
* Do we have AccessibleHandler.dll registered.
|
||||
*/
|
||||
bool IsHandlerRegistered();
|
||||
|
||||
/*
|
||||
* Name of platform service that instantiated accessibility
|
||||
*/
|
||||
void SetInstantiator(const nsAString& aInstantiator);
|
||||
bool GetInstantiator(nsAString& aInstantiator);
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include "MainThreadUtils.h"
|
||||
#include "mozilla/a11y/Accessible.h"
|
||||
#include "mozilla/a11y/Platform.h"
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/mscom/MainThreadRuntime.h"
|
||||
#include "mozilla/mscom/Registration.h"
|
||||
|
@ -262,6 +263,13 @@ LazyInstantiator::ShouldInstantiate(const DWORD aClientTid)
|
|||
}
|
||||
*/
|
||||
|
||||
// Store full path to executable for support purposes.
|
||||
nsAutoString filePath;
|
||||
nsresult rv = clientExe->GetPath(filePath);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
a11y::SetInstantiator(filePath);
|
||||
}
|
||||
|
||||
#if defined(MOZ_TELEMETRY_REPORTING) || defined(MOZ_CRASHREPORTER)
|
||||
if (!mTelemetryThread) {
|
||||
// Call GatherTelemetry on a background thread because it does I/O on
|
||||
|
|
|
@ -30,6 +30,8 @@ static StaticAutoPtr<RegisteredProxy> gRegCustomProxy;
|
|||
static StaticAutoPtr<RegisteredProxy> gRegProxy;
|
||||
static StaticAutoPtr<RegisteredProxy> gRegAccTlb;
|
||||
static StaticAutoPtr<RegisteredProxy> gRegMiscTlb;
|
||||
static nsString* gInstantiator = nullptr;
|
||||
|
||||
void
|
||||
a11y::PlatformInit()
|
||||
{
|
||||
|
@ -65,6 +67,11 @@ a11y::PlatformShutdown()
|
|||
gRegProxy = nullptr;
|
||||
gRegAccTlb = nullptr;
|
||||
gRegMiscTlb = nullptr;
|
||||
|
||||
if (gInstantiator) {
|
||||
delete gInstantiator;
|
||||
gInstantiator = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -206,3 +213,24 @@ a11y::IsHandlerRegistered()
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
a11y::SetInstantiator(const nsAString& aInstantiator)
|
||||
{
|
||||
if (!gInstantiator) {
|
||||
gInstantiator = new nsString();
|
||||
}
|
||||
|
||||
gInstantiator->Assign(aInstantiator);
|
||||
}
|
||||
|
||||
bool
|
||||
a11y::GetInstantiator(nsAString& aInstantiator)
|
||||
{
|
||||
if (!gInstantiator) {
|
||||
return false;
|
||||
}
|
||||
|
||||
aInstantiator.Assign(*gInstantiator);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -709,10 +709,16 @@ var snapshotFormatters = {
|
|||
accessibility: function accessibility(data) {
|
||||
$("a11y-activated").textContent = data.isActive;
|
||||
$("a11y-force-disabled").textContent = data.forceDisabled || 0;
|
||||
|
||||
let a11yHandlerUsed = $("a11y-handler-used");
|
||||
if (a11yHandlerUsed) {
|
||||
a11yHandlerUsed.textContent = data.handlerUsed;
|
||||
}
|
||||
|
||||
let a11yInstantiator = $("a11y-instantiator");
|
||||
if (a11yInstantiator) {
|
||||
a11yInstantiator.textContent = data.instantiator;
|
||||
}
|
||||
},
|
||||
|
||||
libraryVersions: function libraryVersions(data) {
|
||||
|
|
|
@ -646,6 +646,15 @@
|
|||
<td id="a11y-handler-used">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th class="column">
|
||||
&aboutSupport.a11yInstantiator;
|
||||
</th>
|
||||
|
||||
<td id="a11y-instantiator">
|
||||
</td>
|
||||
</tr>
|
||||
#endif
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
@ -111,6 +111,7 @@ variant of aboutSupport.showDir.label. -->
|
|||
<!ENTITY aboutSupport.a11yActivated "Activated">
|
||||
<!ENTITY aboutSupport.a11yForceDisabled "Prevent Accessibility">
|
||||
<!ENTITY aboutSupport.a11yHandlerUsed "Accessible Handler Used">
|
||||
<!ENTITY aboutSupport.a11yInstantiator "Accessibility Instantiator">
|
||||
|
||||
<!ENTITY aboutSupport.libraryVersionsTitle "Library Versions">
|
||||
|
||||
|
|
|
@ -605,6 +605,7 @@ var dataProviders = {
|
|||
Services.prefs.getIntPref("accessibility.force_disabled");
|
||||
} catch (e) {}
|
||||
data.handlerUsed = Services.appinfo.accessibleHandlerUsed;
|
||||
data.instantiator = Services.appinfo.accessibilityInstantiator;
|
||||
done(data);
|
||||
},
|
||||
|
||||
|
|
|
@ -567,6 +567,9 @@ const SNAPSHOT_SCHEMA = {
|
|||
handlerUsed: {
|
||||
type: "boolean",
|
||||
},
|
||||
instantiator: {
|
||||
type: "string"
|
||||
}
|
||||
},
|
||||
},
|
||||
libraryVersions: {
|
||||
|
|
|
@ -978,6 +978,19 @@ nsXULAppInfo::GetAccessibleHandlerUsed(bool* aResult)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXULAppInfo::GetAccessibilityInstantiator(nsAString &aInstantiator)
|
||||
{
|
||||
#if defined(ACCESSIBILITY) && defined(XP_WIN)
|
||||
if (!a11y::GetInstantiator(aInstantiator)) {
|
||||
aInstantiator = NS_LITERAL_STRING("");
|
||||
}
|
||||
#else
|
||||
aInstantiator = NS_LITERAL_STRING("");
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXULAppInfo::GetIs64Bit(bool* aResult)
|
||||
{
|
||||
|
|
|
@ -136,6 +136,11 @@ interface nsIXULRuntime : nsISupports
|
|||
*/
|
||||
readonly attribute boolean accessibleHandlerUsed;
|
||||
|
||||
/**
|
||||
* Executable of Windows service that activated accessibility.
|
||||
*/
|
||||
readonly attribute DOMString accessibilityInstantiator;
|
||||
|
||||
/**
|
||||
* Indicates whether the current Firefox build is 64-bit.
|
||||
*/
|
||||
|
|
Загрузка…
Ссылка в новой задаче