OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "chrome/browser/chrome_browser_application_mac.h" | 5 #import "chrome/browser/chrome_browser_application_mac.h" |
6 | 6 |
7 #import "base/logging.h" | 7 #import "base/logging.h" |
8 #include "base/mac/crash_logging.h" | 8 #include "base/mac/crash_logging.h" |
9 #import "base/mac/scoped_nsexception_enabler.h" | 9 #import "base/mac/scoped_nsexception_enabler.h" |
10 #import "base/metrics/histogram.h" | 10 #import "base/metrics/histogram.h" |
11 #import "base/memory/scoped_nsobject.h" | 11 #import "base/memory/scoped_nsobject.h" |
12 #import "base/sys_string_conversions.h" | 12 #import "base/sys_string_conversions.h" |
13 #import "chrome/browser/app_controller_mac.h" | 13 #import "chrome/browser/app_controller_mac.h" |
14 #include "chrome/browser/ui/browser_list.h" | 14 #include "chrome/browser/ui/browser_list.h" |
15 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 15 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
16 #import "chrome/common/mac/objc_method_swizzle.h" | 16 #import "chrome/common/mac/objc_method_swizzle.h" |
17 #import "chrome/common/mac/objc_zombie.h" | 17 #import "chrome/common/mac/objc_zombie.h" |
18 #include "content/browser/accessibility/browser_accessibility_state.h" | 18 #include "content/browser/accessibility/browser_accessibility_state.h" |
19 #include "content/browser/renderer_host/render_view_host.h" | 19 #include "content/browser/renderer_host/render_view_host.h" |
| 20 #include "content/browser/tab_contents/tab_contents.h" |
20 | 21 |
21 // The implementation of NSExceptions break various assumptions in the | 22 // The implementation of NSExceptions break various assumptions in the |
22 // Chrome code. This category defines a replacement for | 23 // Chrome code. This category defines a replacement for |
23 // -initWithName:reason:userInfo: for purposes of forcing a break in | 24 // -initWithName:reason:userInfo: for purposes of forcing a break in |
24 // the debugger when an exception is raised. -raise sounds more | 25 // the debugger when an exception is raised. -raise sounds more |
25 // obvious to intercept, but it doesn't catch the original throw | 26 // obvious to intercept, but it doesn't catch the original throw |
26 // because the objc runtime doesn't use it. | 27 // because the objc runtime doesn't use it. |
27 @interface NSException (CrNSExceptionSwizzle) | 28 @interface NSException (CrNSExceptionSwizzle) |
28 - (id)crInitWithName:(NSString*)aName | 29 - (id)crInitWithName:(NSString*)aName |
29 reason:(NSString*)aReason | 30 reason:(NSString*)aReason |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 } | 471 } |
471 | 472 |
472 - (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute { | 473 - (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute { |
473 if ([attribute isEqualToString:@"AXEnhancedUserInterface"] && | 474 if ([attribute isEqualToString:@"AXEnhancedUserInterface"] && |
474 [value intValue] == 1) { | 475 [value intValue] == 1) { |
475 BrowserAccessibilityState::GetInstance()->OnScreenReaderDetected(); | 476 BrowserAccessibilityState::GetInstance()->OnScreenReaderDetected(); |
476 for (TabContentsIterator it; | 477 for (TabContentsIterator it; |
477 !it.done(); | 478 !it.done(); |
478 ++it) { | 479 ++it) { |
479 if (TabContentsWrapper* contents = *it) { | 480 if (TabContentsWrapper* contents = *it) { |
480 if (RenderViewHost* rvh = contents->render_view_host()) { | 481 if (RenderViewHost* rvh = |
| 482 contents->tab_contents()->render_view_host()) { |
481 rvh->EnableRendererAccessibility(); | 483 rvh->EnableRendererAccessibility(); |
482 } | 484 } |
483 } | 485 } |
484 } | 486 } |
485 } | 487 } |
486 return [super accessibilitySetValue:value forAttribute:attribute]; | 488 return [super accessibilitySetValue:value forAttribute:attribute]; |
487 } | 489 } |
488 | 490 |
489 @end | 491 @end |
OLD | NEW |