Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: expose app accessibility status api #16119

merged 2 commits into from Dec 18, 2018
Changes from all commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.


Just for now

@@ -89,6 +89,8 @@ void SystemPreferences::BuildPrototype(
.SetMethod("askForMediaAccess", &SystemPreferences::AskForMediaAccess)
@@ -92,6 +92,8 @@ class SystemPreferences : public mate::EventEmitter<SystemPreferences>
void RemoveUserDefault(const std::string& name);
bool IsSwipeTrackingFromScrollEventsEnabled();

bool IsTrustedAccessibilityClient(bool prompt);

// TODO(codebytere): Write tests for these methods once we
// are running tests on a Mojave machine
std::string GetMediaAccessStatus(const std::string& media_type,
@@ -378,6 +378,11 @@ AVMediaType ParseMediaType(const std::string& media_type) {

bool SystemPreferences::IsTrustedAccessibilityClient(bool prompt) {
NSDictionary* options = @{(id)kAXTrustedCheckOptionPrompt : @(prompt)};
return AXIsProcessTrustedWithOptions((CFDictionaryRef)options);

std::string SystemPreferences::GetMediaAccessStatus(
const std::string& media_type,
mate::Arguments* args) {
@@ -327,6 +327,12 @@ You can use the `setAppLevelAppearance` API to set this value.
Sets the appearance setting for your application, this should override the
system default and override the value of `getEffectiveAppearance`.

### `systemPreferences.isTrustedAccessibilityClient(prompt)` _macOS_

* `prompt` Boolean - whether or not the user will be informed via prompt if the current process is untrusted.

Returns `Boolean` - `true` if the current process is a trusted accessibility client and `false` if it is not.
This conversation was marked as resolved by codebytere

This comment has been minimized.

Copy link

BinaryMuse Dec 18, 2018


Does this return before or after the user is prompted? E.g. if the user opts to accept the prompt and add the app, will this return true?

This comment has been minimized.

Copy link

codebytere Dec 18, 2018

Author Member

the prompt can't be accepted per se, it just links to the system prefpane; so no :)

### `systemPreferences.getMediaAccessStatus(mediaType)` _macOS_

* `mediaType` String - `microphone` or `camera`.
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.