summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chrome_browser_application_mac.mm
diff options
context:
space:
mode:
authordtseng@chromium.org <dtseng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-03 19:36:38 +0000
committerdtseng@chromium.org <dtseng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-03 19:36:38 +0000
commitf6855a0a211cadb37c953fe585405fb6d4ee02ba (patch)
tree4a81e68c4fffba5de7429e854c18d04d88ff7c03 /chrome/browser/chrome_browser_application_mac.mm
parent7b5481278dee3fd02fb9f7bc5a08bbddb4fc5ee5 (diff)
downloadchromium_src-f6855a0a211cadb37c953fe585405fb6d4ee02ba.zip
chromium_src-f6855a0a211cadb37c953fe585405fb6d4ee02ba.tar.gz
chromium_src-f6855a0a211cadb37c953fe585405fb6d4ee02ba.tar.bz2
Modify screen reader detection to use the AXEnhancedUserInterface attribute set on AXApplication when VoiceOver's turned on. This gives us the ability to turn on ax even after a render widget host has started.
BUG=none TEST=manually with VoiceOver. Launch Chrome, VoiceOver, windows, tabs (permuted order) and verify that ax is on. This sometimes required navigation to a different page or efreshing the current page. Review URL: http://codereview.chromium.org/6909013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83940 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chrome_browser_application_mac.mm')
-rw-r--r--chrome/browser/chrome_browser_application_mac.mm21
1 files changed, 21 insertions, 0 deletions
diff --git a/chrome/browser/chrome_browser_application_mac.mm b/chrome/browser/chrome_browser_application_mac.mm
index 7ba8cda..745e0ab 100644
--- a/chrome/browser/chrome_browser_application_mac.mm
+++ b/chrome/browser/chrome_browser_application_mac.mm
@@ -9,9 +9,13 @@
#import "base/memory/scoped_nsobject.h"
#import "base/sys_string_conversions.h"
#import "chrome/app/breakpad_mac.h"
+#include "chrome/browser/accessibility/browser_accessibility_state.h"
#import "chrome/browser/app_controller_mac.h"
+#include "chrome/browser/ui/browser_list.h"
#import "chrome/browser/ui/cocoa/objc_method_swizzle.h"
#import "chrome/browser/ui/cocoa/objc_zombie.h"
+#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
+#include "content/browser/renderer_host/render_view_host.h"
// The implementation of NSExceptions break various assumptions in the
// Chrome code. This category defines a replacement for
@@ -384,4 +388,21 @@ BOOL SwizzleNSExceptionInit() {
[super reportException:anException];
}
+- (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute {
+ if ([attribute isEqualToString:@"AXEnhancedUserInterface"] &&
+ [value intValue] == 1) {
+ BrowserAccessibilityState::GetInstance()->OnScreenReaderDetected();
+ for (TabContentsIterator it;
+ !it.done();
+ ++it) {
+ if (TabContentsWrapper* contents = *it) {
+ if (RenderViewHost* rvh = contents->render_view_host()) {
+ rvh->EnableRendererAccessibility();
+ }
+ }
+ }
+ }
+ return [super accessibilitySetValue:value forAttribute:attribute];
+}
+
@end