Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include <objc/objc-exception.h> | 7 #include <objc/objc-exception.h> |
| 8 | 8 |
| 9 #import "base/auto_reset.h" | 9 #import "base/auto_reset.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/debug/crash_logging.h" | 11 #include "base/debug/crash_logging.h" |
| 12 #include "base/debug/stack_trace.h" | 12 #include "base/debug/stack_trace.h" |
| 13 #import "base/logging.h" | 13 #import "base/logging.h" |
| 14 #include "base/mac/call_with_eh_frame.h" | 14 #include "base/mac/call_with_eh_frame.h" |
| 15 #import "base/mac/scoped_nsobject.h" | 15 #import "base/mac/scoped_nsobject.h" |
| 16 #import "base/mac/scoped_objc_class_swizzler.h" | 16 #import "base/mac/scoped_objc_class_swizzler.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #import "base/metrics/histogram.h" | 18 #import "base/metrics/histogram.h" |
| 19 #include "base/strings/stringprintf.h" | 19 #include "base/strings/stringprintf.h" |
| 20 #import "base/strings/sys_string_conversions.h" | 20 #import "base/strings/sys_string_conversions.h" |
| 21 #import "chrome/browser/app_controller_mac.h" | 21 #import "chrome/browser/app_controller_mac.h" |
| 22 #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" | 22 #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" |
| 23 #include "chrome/common/chrome_switches.h" | 23 #include "chrome/common/chrome_switches.h" |
| 24 #include "chrome/common/crash_keys.h" | 24 #include "chrome/common/crash_keys.h" |
| 25 #import "components/crash/core/common/objc_zombie.h" | 25 #import "components/crash/core/common/objc_zombie.h" |
| 26 #include "content/public/browser/browser_accessibility_state.h" | 26 #include "content/public/browser/browser_accessibility_state.h" |
| 27 #include "content/public/browser/render_view_host.h" | 27 #include "content/public/browser/render_view_host.h" |
| 28 #include "content/public/browser/web_contents.h" | 28 #include "content/public/browser/web_contents.h" |
| 29 #import "ui/accessibility/platform/ax_platform_node_mac.h" | |
|
tapted
2016/09/26 05:19:17
nit: we can revert this file back to how it was so
Patti Lor
2016/09/28 00:29:14
Done.
| |
| 30 #include "ui/views/accessibility/native_view_accessibility.h" | |
| 31 #include "ui/views/widget/widget.h" | |
| 29 | 32 |
| 30 namespace chrome_browser_application_mac { | 33 namespace chrome_browser_application_mac { |
| 31 | 34 |
| 32 // Maximum number of known named exceptions we'll support. There is | 35 // Maximum number of known named exceptions we'll support. There is |
| 33 // no central registration, but I only find about 75 possibilities in | 36 // no central registration, but I only find about 75 possibilities in |
| 34 // the system frameworks, and many of them are probably not | 37 // the system frameworks, and many of them are probably not |
| 35 // interesting to track in aggregate (those relating to distributed | 38 // interesting to track in aggregate (those relating to distributed |
| 36 // objects, for instance). | 39 // objects, for instance). |
| 37 const size_t kKnownNSExceptionCount = 25; | 40 const size_t kKnownNSExceptionCount = 25; |
| 38 | 41 |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 340 | 343 |
| 341 default: { | 344 default: { |
| 342 base::mac::ScopedSendingEvent sendingEventScoper; | 345 base::mac::ScopedSendingEvent sendingEventScoper; |
| 343 [super sendEvent:event]; | 346 [super sendEvent:event]; |
| 344 } | 347 } |
| 345 } | 348 } |
| 346 }); | 349 }); |
| 347 } | 350 } |
| 348 | 351 |
| 349 - (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute { | 352 - (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute { |
| 350 // This is an undocument attribute that's set when VoiceOver is turned on/off. | 353 // This is an undocumented attribute, set whenever VoiceOver is turned on/off. |
| 351 if ([attribute isEqualToString:@"AXEnhancedUserInterface"]) { | 354 if ([attribute isEqualToString:@"AXEnhancedUserInterface"]) { |
| 352 content::BrowserAccessibilityState* accessibility_state = | 355 content::BrowserAccessibilityState* accessibility_state = |
| 353 content::BrowserAccessibilityState::GetInstance(); | 356 content::BrowserAccessibilityState::GetInstance(); |
| 354 if ([value intValue] == 1) | 357 if ([value intValue] == 1) |
| 355 accessibility_state->OnScreenReaderDetected(); | 358 accessibility_state->OnScreenReaderDetected(); |
| 356 else | 359 else |
| 357 accessibility_state->DisableAccessibility(); | 360 accessibility_state->DisableAccessibility(); |
| 358 } | 361 } |
| 359 return [super accessibilitySetValue:value forAttribute:attribute]; | 362 return [super accessibilitySetValue:value forAttribute:attribute]; |
| 360 } | 363 } |
| 361 | 364 |
| 362 - (void)_cycleWindowsReversed:(BOOL)arg1 { | 365 - (void)_cycleWindowsReversed:(BOOL)arg1 { |
| 363 base::AutoReset<BOOL> pin(&cyclingWindows_, YES); | 366 base::AutoReset<BOOL> pin(&cyclingWindows_, YES); |
| 364 [super _cycleWindowsReversed:arg1]; | 367 [super _cycleWindowsReversed:arg1]; |
| 365 } | 368 } |
| 366 | 369 |
| 367 - (BOOL)isCyclingWindows { | 370 - (BOOL)isCyclingWindows { |
| 368 return cyclingWindows_; | 371 return cyclingWindows_; |
| 369 } | 372 } |
| 370 | 373 |
| 371 @end | 374 @end |
| OLD | NEW |