michael@0: /* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #import michael@0: michael@0: #include "Platform.h" michael@0: michael@0: #include "nsAppShell.h" michael@0: michael@0: namespace mozilla { michael@0: namespace a11y { michael@0: michael@0: // Mac a11y whitelisting michael@0: static bool sA11yShouldBeEnabled = false; michael@0: michael@0: bool michael@0: ShouldA11yBeEnabled() michael@0: { michael@0: EPlatformDisabledState disabledState = PlatformDisabledState(); michael@0: return (disabledState == ePlatformIsForceEnabled) || ((disabledState == ePlatformIsEnabled) && sA11yShouldBeEnabled); michael@0: } michael@0: michael@0: void michael@0: PlatformInit() michael@0: { michael@0: } michael@0: michael@0: void michael@0: PlatformShutdown() michael@0: { michael@0: } michael@0: michael@0: } michael@0: } michael@0: michael@0: @interface GeckoNSApplication(a11y) michael@0: -(void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute; michael@0: @end michael@0: michael@0: @implementation GeckoNSApplication(a11y) michael@0: michael@0: -(void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute michael@0: { michael@0: if ([attribute isEqualToString:@"AXEnhancedUserInterface"]) michael@0: mozilla::a11y::sA11yShouldBeEnabled = ([value intValue] == 1); michael@0: michael@0: return [super accessibilitySetValue:value forAttribute:attribute]; michael@0: } michael@0: michael@0: @end michael@0: