Skip to content

Commit

Permalink
Bug 1881190: Switch to a properly defined static pref for enabling of…
Browse files Browse the repository at this point in the history
… UI Automation. r=nlapre

Previously, we used an undefined (and thus hidden) pref, making it more difficult to toggle.
Also, we used GetBoolPref, which is slightly less efficient.
But mostly, this is just cleaner.

Differential Revision: https://phabricator.services.mozilla.com/D202383
  • Loading branch information
jcsteh committed Feb 23, 2024
1 parent 631e82f commit 8d12f77
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions accessible/windows/msaa/ServiceProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "uiaRawElmProvider.h"

#include "mozilla/a11y/DocAccessibleChild.h"
#include "mozilla/Preferences.h"
#include "mozilla/StaticPrefs_accessibility.h"

#include "ISimpleDOM.h"

Expand Down Expand Up @@ -44,7 +44,7 @@ ServiceProvider::QueryService(REFGUID aGuidService, REFIID aIID,

// UIA IAccessibleEx
if (aGuidService == IID_IAccessibleEx &&
Preferences::GetBool("accessibility.uia.enable") && localAcc) {
StaticPrefs::accessibility_uia_enable() && localAcc) {
uiaRawElmProvider* accEx = new uiaRawElmProvider(localAcc);
HRESULT hr = accEx->QueryInterface(aIID, aInstancePtr);
if (FAILED(hr)) delete accEx;
Expand Down
6 changes: 6 additions & 0 deletions modules/libpref/init/StaticPrefList.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,12 @@
#endif
mirror: always

# Whether to enable support for the UI Automation API on Windows.
- name: accessibility.uia.enable
type: bool
value: false
mirror: always

# Whether to avoid accessibility activation on Windows shortly after clipboard
# copy.
#
Expand Down

0 comments on commit 8d12f77

Please sign in to comment.