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

Unified Diff: content/browser/accessibility/browser_accessibility_cocoa.mm

Issue 799633007: Make Windows accessibility event firing aware of guest / child frames. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webview_fixes
Patch Set: Address more feedback Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
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 1b720658e242816b88432d9b22c9c6afb2ac7cf8..198f119c154c8aa738839f0d6dd6c5bc97419e50 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;
@@ -534,9 +535,16 @@ 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.
+ BrowserAccessibilityDelegate* delegate = GetDelegateFromRootManager();
+ 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.
@@ -1558,4 +1566,3 @@ NSDictionary* attributeToMethodNameMap = nil;
}
@end
-

Powered by Google App Engine
This is Rietveld 408576698