|
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/. */ |
|
6 |
|
7 #import <Cocoa/Cocoa.h> |
|
8 |
|
9 #include "Platform.h" |
|
10 |
|
11 #include "nsAppShell.h" |
|
12 |
|
13 namespace mozilla { |
|
14 namespace a11y { |
|
15 |
|
16 // Mac a11y whitelisting |
|
17 static bool sA11yShouldBeEnabled = false; |
|
18 |
|
19 bool |
|
20 ShouldA11yBeEnabled() |
|
21 { |
|
22 EPlatformDisabledState disabledState = PlatformDisabledState(); |
|
23 return (disabledState == ePlatformIsForceEnabled) || ((disabledState == ePlatformIsEnabled) && sA11yShouldBeEnabled); |
|
24 } |
|
25 |
|
26 void |
|
27 PlatformInit() |
|
28 { |
|
29 } |
|
30 |
|
31 void |
|
32 PlatformShutdown() |
|
33 { |
|
34 } |
|
35 |
|
36 } |
|
37 } |
|
38 |
|
39 @interface GeckoNSApplication(a11y) |
|
40 -(void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute; |
|
41 @end |
|
42 |
|
43 @implementation GeckoNSApplication(a11y) |
|
44 |
|
45 -(void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute |
|
46 { |
|
47 if ([attribute isEqualToString:@"AXEnhancedUserInterface"]) |
|
48 mozilla::a11y::sA11yShouldBeEnabled = ([value intValue] == 1); |
|
49 |
|
50 return [super accessibilitySetValue:value forAttribute:attribute]; |
|
51 } |
|
52 |
|
53 @end |
|
54 |