Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Side by Side Diff: chrome/browser/chrome_browser_application_mac.mm

Issue 602133002: Disable accessibility when VoiceOver is turned off. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/renderer/accessibility/renderer_accessibility.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #import "base/auto_reset.h" 7 #import "base/auto_reset.h"
8 #include "base/debug/crash_logging.h" 8 #include "base/debug/crash_logging.h"
9 #include "base/debug/stack_trace.h" 9 #include "base/debug/stack_trace.h"
10 #import "base/logging.h" 10 #import "base/logging.h"
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 } 531 }
532 trackedFirstException = YES; 532 trackedFirstException = YES;
533 533
534 reportingException = NO; 534 reportingException = NO;
535 } 535 }
536 536
537 [super reportException:anException]; 537 [super reportException:anException];
538 } 538 }
539 539
540 - (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute { 540 - (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute {
541 if ([attribute isEqualToString:@"AXEnhancedUserInterface"] && 541 // This is an undocument attribute that's set when VoiceOver is turned on/off.
542 [value intValue] == 1) { 542 if ([attribute isEqualToString:@"AXEnhancedUserInterface"]) {
543 content::BrowserAccessibilityState::GetInstance()->OnScreenReaderDetected(); 543 content::BrowserAccessibilityState* accessibility_state =
544 content::BrowserAccessibilityState::GetInstance();
545 if ([value intValue] == 1)
546 accessibility_state->OnScreenReaderDetected();
547 else
548 accessibility_state->DisableAccessibility();
544 } 549 }
545 return [super accessibilitySetValue:value forAttribute:attribute]; 550 return [super accessibilitySetValue:value forAttribute:attribute];
546 } 551 }
547 552
548 - (void)_cycleWindowsReversed:(BOOL)arg1 { 553 - (void)_cycleWindowsReversed:(BOOL)arg1 {
549 base::AutoReset<BOOL> pin(&cyclingWindows_, YES); 554 base::AutoReset<BOOL> pin(&cyclingWindows_, YES);
550 [super _cycleWindowsReversed:arg1]; 555 [super _cycleWindowsReversed:arg1];
551 } 556 }
552 557
553 - (BOOL)isCyclingWindows { 558 - (BOOL)isCyclingWindows {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 std::vector<NSWindow*>::iterator window_iterator = 608 std::vector<NSWindow*>::iterator window_iterator =
604 std::find(previousKeyWindows_.begin(), 609 std::find(previousKeyWindows_.begin(),
605 previousKeyWindows_.end(), 610 previousKeyWindows_.end(),
606 window); 611 window);
607 if (window_iterator != previousKeyWindows_.end()) { 612 if (window_iterator != previousKeyWindows_.end()) {
608 previousKeyWindows_.erase(window_iterator); 613 previousKeyWindows_.erase(window_iterator);
609 } 614 }
610 } 615 }
611 616
612 @end 617 @end
OLDNEW
« no previous file with comments | « no previous file | content/renderer/accessibility/renderer_accessibility.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698