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 #include <execinfo.h> | 5 #include <execinfo.h> |
6 | 6 |
7 #import "content/browser/accessibility/browser_accessibility_cocoa.h" | 7 #import "content/browser/accessibility/browser_accessibility_cocoa.h" |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 1921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1932 | 1932 |
1933 if ([attribute isEqualToString:NSAccessibilityFocusedAttribute]) { | 1933 if ([attribute isEqualToString:NSAccessibilityFocusedAttribute]) { |
1934 BrowserAccessibilityManager* manager = browserAccessibility_->manager(); | 1934 BrowserAccessibilityManager* manager = browserAccessibility_->manager(); |
1935 NSNumber* focusedNumber = value; | 1935 NSNumber* focusedNumber = value; |
1936 BOOL focused = [focusedNumber intValue]; | 1936 BOOL focused = [focusedNumber intValue]; |
1937 if (focused) | 1937 if (focused) |
1938 manager->SetFocus(browserAccessibility_, true); | 1938 manager->SetFocus(browserAccessibility_, true); |
1939 } | 1939 } |
1940 if ([attribute isEqualToString:NSAccessibilitySelectedTextRangeAttribute]) { | 1940 if ([attribute isEqualToString:NSAccessibilitySelectedTextRangeAttribute]) { |
1941 NSRange range = [(NSValue*)value rangeValue]; | 1941 NSRange range = [(NSValue*)value rangeValue]; |
1942 [self delegate]->AccessibilitySetTextSelection( | 1942 [self delegate]->AccessibilitySetSelection( |
1943 browserAccessibility_->GetId(), | 1943 browserAccessibility_->GetId(), range.location, |
1944 range.location, range.location + range.length); | 1944 browserAccessibility_->GetId(), range.location + range.length); |
1945 } | 1945 } |
1946 } | 1946 } |
1947 | 1947 |
1948 // Returns the deepest accessibility child that should not be ignored. | 1948 // Returns the deepest accessibility child that should not be ignored. |
1949 // It is assumed that the hit test has been narrowed down to this object | 1949 // It is assumed that the hit test has been narrowed down to this object |
1950 // or one of its children, so this will never return nil unless this | 1950 // or one of its children, so this will never return nil unless this |
1951 // object is invalid. | 1951 // object is invalid. |
1952 - (id)accessibilityHitTest:(NSPoint)point { | 1952 - (id)accessibilityHitTest:(NSPoint)point { |
1953 if (!browserAccessibility_) | 1953 if (!browserAccessibility_) |
1954 return nil; | 1954 return nil; |
(...skipping 30 matching lines...) Expand all Loading... |
1985 if (!browserAccessibility_) | 1985 if (!browserAccessibility_) |
1986 return [super hash]; | 1986 return [super hash]; |
1987 return browserAccessibility_->GetId(); | 1987 return browserAccessibility_->GetId(); |
1988 } | 1988 } |
1989 | 1989 |
1990 - (BOOL)accessibilityShouldUseUniqueId { | 1990 - (BOOL)accessibilityShouldUseUniqueId { |
1991 return YES; | 1991 return YES; |
1992 } | 1992 } |
1993 | 1993 |
1994 @end | 1994 @end |
OLD | NEW |