| Index: content/browser/accessibility/browser_accessibility_cocoa.mm
|
| diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/content/browser/accessibility/browser_accessibility_cocoa.mm
|
| index 92515d542894d31b8b2baa16a18ff8c17eb9871f..dd91619d4cf508c3e163827660a4ece3595b6ae4 100644
|
| --- a/content/browser/accessibility/browser_accessibility_cocoa.mm
|
| +++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
|
| @@ -25,6 +25,7 @@ extern "C" void NSAccessibilityUnregisterUniqueIdForUIElement(id element);
|
|
|
| using ui::AXNodeData;
|
| using content::BrowserAccessibility;
|
| +using content::BrowserAccessibilityDelegate;
|
| using content::BrowserAccessibilityManager;
|
| using content::BrowserAccessibilityManagerMac;
|
| using content::ContentClient;
|
| @@ -508,9 +509,22 @@ NSDictionary* attributeToMethodNameMap = nil;
|
| if (!browserAccessibility_)
|
| return NSZeroPoint;
|
|
|
| - gfx::Rect bounds(origin.x, origin.y, size.width, size.height);
|
| - gfx::Point point = [self delegate]->AccessibilityOriginInScreen(bounds);
|
| - return NSMakePoint(point.x(), point.y());
|
| + // Get the delegate for the topmost BrowserAccessibilityManager, because
|
| + // that's the only one that can convert points to their origin in the screen.
|
| + BrowserAccessibilityManager* manager = browserAccessibility_->manager();
|
| + BrowserAccessibility* root = manager->GetRoot();
|
| + while (root->GetParent())
|
| + root = root->GetParent()->manager()->GetRoot();
|
| + manager = root->manager();
|
| + BrowserAccessibilityDelegate* delegate = manager->delegate();
|
| +
|
| + if (delegate) {
|
| + gfx::Rect bounds(origin.x, origin.y, size.width, size.height);
|
| + gfx::Point point = delegate->AccessibilityOriginInScreen(bounds);
|
| + return NSMakePoint(point.x(), point.y());
|
| + } else {
|
| + return NSZeroPoint;
|
| + }
|
| }
|
|
|
| // Returns a string indicating the NSAccessibility role of this object.
|
|
|