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

Unified Diff: content/browser/accessibility/browser_accessibility_manager.cc

Issue 849143003: Fix focus and bounds calculations for guest frames. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address 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
« no previous file with comments | « content/browser/accessibility/browser_accessibility_cocoa.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/accessibility/browser_accessibility_manager.cc
diff --git a/content/browser/accessibility/browser_accessibility_manager.cc b/content/browser/accessibility/browser_accessibility_manager.cc
index 1e368c6f8d8e7cf6691f96c52c30713537b5d071..0bc4260ac629c53f97b73de99dfd7371a88ace76 100644
--- a/content/browser/accessibility/browser_accessibility_manager.cc
+++ b/content/browser/accessibility/browser_accessibility_manager.cc
@@ -290,10 +290,24 @@ BrowserAccessibility* BrowserAccessibilityManager::GetActiveDescendantFocus(
BrowserAccessibility* BrowserAccessibilityManager::GetFocus(
BrowserAccessibility* root) {
- if (focus_ && (!root || focus_->IsDescendantOf(root->node())))
- return GetFromAXNode(focus_);
+ if (!focus_)
+ return NULL;
- return NULL;
+ if (root && !focus_->IsDescendantOf(root->node()))
+ return NULL;
+
+ if (!delegate())
+ return NULL;
+
+ BrowserAccessibility* obj = GetFromAXNode(focus_);
+ if (obj->HasBoolAttribute(ui::AX_ATTR_IS_AX_TREE_HOST)) {
+ BrowserAccessibilityManager* child_manager =
+ delegate()->AccessibilityGetChildFrame(obj->GetId());
+ if (child_manager)
+ return child_manager->GetFocus(child_manager->GetRoot());
+ }
+
+ return obj;
}
void BrowserAccessibilityManager::SetFocus(ui::AXNode* node, bool notify) {
« no previous file with comments | « content/browser/accessibility/browser_accessibility_cocoa.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698