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

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: 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 7668c851f55fb7f6fd06939e0beca6e63949eda9..cbc46f9d14e11ff7462ebdd877df55bdae7dee67 100644
--- a/content/browser/accessibility/browser_accessibility_cocoa.mm
+++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
@@ -517,16 +517,14 @@ NSDictionary* attributeToMethodNameMap = nil;
// 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();
-
- gfx::Rect bounds(origin.x, origin.y, size.width, size.height);
- gfx::Point point = delegate->AccessibilityOriginInScreen(bounds);
- return NSMakePoint(point.x(), point.y());
+ 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.
@@ -1548,4 +1546,3 @@ NSDictionary* attributeToMethodNameMap = nil;
}
@end
-

Powered by Google App Engine
This is Rietveld 408576698