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 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1414 // Returns the deepest accessibility child that should not be ignored. | 1414 // Returns the deepest accessibility child that should not be ignored. |
1415 // It is assumed that the hit test has been narrowed down to this object | 1415 // It is assumed that the hit test has been narrowed down to this object |
1416 // or one of its children, so this will never return nil unless this | 1416 // or one of its children, so this will never return nil unless this |
1417 // object is invalid. | 1417 // object is invalid. |
1418 - (id)accessibilityHitTest:(NSPoint)point { | 1418 - (id)accessibilityHitTest:(NSPoint)point { |
1419 if (!browserAccessibility_) | 1419 if (!browserAccessibility_) |
1420 return nil; | 1420 return nil; |
1421 | 1421 |
1422 BrowserAccessibilityCocoa* hit = self; | 1422 BrowserAccessibilityCocoa* hit = self; |
1423 for (BrowserAccessibilityCocoa* child in [self children]) { | 1423 for (BrowserAccessibilityCocoa* child in [self children]) { |
| 1424 if (!child->browserAccessibility_) |
| 1425 continue; |
1424 NSPoint origin = [child origin]; | 1426 NSPoint origin = [child origin]; |
1425 NSSize size = [[child size] sizeValue]; | 1427 NSSize size = [[child size] sizeValue]; |
1426 NSRect rect; | 1428 NSRect rect; |
1427 rect.origin = origin; | 1429 rect.origin = origin; |
1428 rect.size = size; | 1430 rect.size = size; |
1429 if (NSPointInRect(point, rect)) { | 1431 if (NSPointInRect(point, rect)) { |
1430 hit = child; | 1432 hit = child; |
1431 id childResult = [child accessibilityHitTest:point]; | 1433 id childResult = [child accessibilityHitTest:point]; |
1432 if (![childResult accessibilityIsIgnored]) { | 1434 if (![childResult accessibilityIsIgnored]) { |
1433 hit = childResult; | 1435 hit = childResult; |
(...skipping 16 matching lines...) Expand all Loading... |
1450 return [super hash]; | 1452 return [super hash]; |
1451 return browserAccessibility_->renderer_id(); | 1453 return browserAccessibility_->renderer_id(); |
1452 } | 1454 } |
1453 | 1455 |
1454 - (BOOL)accessibilityShouldUseUniqueId { | 1456 - (BOOL)accessibilityShouldUseUniqueId { |
1455 return YES; | 1457 return YES; |
1456 } | 1458 } |
1457 | 1459 |
1458 @end | 1460 @end |
1459 | 1461 |
OLD | NEW |