accessible/src/mac/Platform.mm

Wed, 31 Dec 2014 07:16:47 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:16:47 +0100
branch
TOR_BUG_9701
changeset 3
141e0f1194b1
permissions
-rw-r--r--

Revert simplistic fix pending revisit of Mozilla integration attempt.

     1 /* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* vim: set ts=2 et sw=2 tw=80: */
     3 /* This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 #import <Cocoa/Cocoa.h>
     9 #include "Platform.h"
    11 #include "nsAppShell.h"
    13 namespace mozilla {
    14 namespace a11y {
    16 // Mac a11y whitelisting
    17 static bool sA11yShouldBeEnabled = false;
    19 bool
    20 ShouldA11yBeEnabled()
    21 {
    22   EPlatformDisabledState disabledState = PlatformDisabledState();
    23   return (disabledState == ePlatformIsForceEnabled) || ((disabledState == ePlatformIsEnabled) && sA11yShouldBeEnabled);
    24 }
    26 void
    27 PlatformInit()
    28 {
    29 }
    31 void
    32 PlatformShutdown()
    33 {
    34 }
    36 }
    37 }
    39 @interface GeckoNSApplication(a11y)
    40 -(void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute;
    41 @end
    43 @implementation GeckoNSApplication(a11y)
    45 -(void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute
    46 {
    47   if ([attribute isEqualToString:@"AXEnhancedUserInterface"])
    48     mozilla::a11y::sA11yShouldBeEnabled = ([value intValue] == 1);
    50   return [super accessibilitySetValue:value forAttribute:attribute];
    51 }
    53 @end

mercurial