fix: enable basic a11y when voice control is active (#37122)
c.f. https://chromium-review.googlesource.com/c/chromium/src/+/2680102
This commit is contained in:
parent
9ec13afeaf
commit
7dcd97f864
1 changed files with 12 additions and 0 deletions
|
@ -193,6 +193,18 @@ inline void dispatch_sync_main(dispatch_block_t block) {
|
||||||
return [super accessibilitySetValue:value forAttribute:attribute];
|
return [super accessibilitySetValue:value forAttribute:attribute];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSAccessibilityRole)accessibilityRole {
|
||||||
|
// For non-VoiceOver AT, such as Voice Control, Apple recommends turning on
|
||||||
|
// a11y when an AT accesses the 'accessibilityRole' property. This function
|
||||||
|
// is accessed frequently so we only change the accessibility state when
|
||||||
|
// accessibility is disabled.
|
||||||
|
auto* ax_state = content::BrowserAccessibilityState::GetInstance();
|
||||||
|
if (!ax_state->GetAccessibilityMode().has_mode(ui::kAXModeBasic.flags())) {
|
||||||
|
ax_state->AddAccessibilityModeFlags(ui::kAXModeBasic);
|
||||||
|
}
|
||||||
|
return [super accessibilityRole];
|
||||||
|
}
|
||||||
|
|
||||||
- (void)orderFrontStandardAboutPanel:(id)sender {
|
- (void)orderFrontStandardAboutPanel:(id)sender {
|
||||||
electron::Browser::Get()->ShowAboutPanel();
|
electron::Browser::Get()->ShowAboutPanel();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue