| Index: content/browser/accessibility/browser_accessibility.cc
|
| diff --git a/content/browser/accessibility/browser_accessibility.cc b/content/browser/accessibility/browser_accessibility.cc
|
| index fe71fef965aa95dfdd32a16d0c22d738e9430e99..fd9b30d94d0ad5b60d6f8e336b91810a2fbf7f8f 100644
|
| --- a/content/browser/accessibility/browser_accessibility.cc
|
| +++ b/content/browser/accessibility/browser_accessibility.cc
|
| @@ -26,7 +26,8 @@ BrowserAccessibility* BrowserAccessibility::Create() {
|
|
|
| BrowserAccessibility::BrowserAccessibility()
|
| : manager_(NULL),
|
| - node_(NULL) {
|
| + node_(NULL),
|
| + child_frame_tree_node_id_(0) {
|
| }
|
|
|
| BrowserAccessibility::~BrowserAccessibility() {
|
| @@ -63,7 +64,14 @@ bool BrowserAccessibility::PlatformIsLeaf() const {
|
| }
|
|
|
| uint32 BrowserAccessibility::PlatformChildCount() const {
|
| - return PlatformIsLeaf() ? 0 : InternalChildCount();
|
| + if (child_frame_tree_node_id_ == 0 ||
|
| + !manager_ || !manager_->delegate()) {
|
| + return PlatformIsLeaf() ? 0 : InternalChildCount();
|
| + }
|
| + BrowserAccessibilityManager* child_manager =
|
| + manager_->delegate()->AccessibilityGetChildFrame(
|
| + child_frame_tree_node_id_);
|
| + return child_manager ? 1 : 0;
|
| }
|
|
|
| bool BrowserAccessibility::IsNative() const {
|
| @@ -83,6 +91,18 @@ bool BrowserAccessibility::IsDescendantOf(
|
|
|
| BrowserAccessibility* BrowserAccessibility::PlatformGetChild(
|
| uint32 child_index) const {
|
| + if (child_index == 0 && child_frame_tree_node_id_ &&
|
| + manager_ &&
|
| + manager_->delegate()) {
|
| + BrowserAccessibilityManager* child_manager =
|
| + manager_->delegate()->AccessibilityGetChildFrame(
|
| + child_frame_tree_node_id_);
|
| + if (!child_manager)
|
| + return NULL;
|
| +
|
| + return child_manager->GetRoot();
|
| + }
|
| +
|
| DCHECK(child_index < InternalChildCount());
|
| return InternalGetChild(child_index);
|
| }
|
| @@ -122,7 +142,9 @@ BrowserAccessibility* BrowserAccessibility::GetParent() const {
|
| if (!node_ || !manager_)
|
| return NULL;
|
| ui::AXNode* parent = node_->parent();
|
| - return parent ? manager_->GetFromAXNode(parent) : NULL;
|
| + if (parent)
|
| + return manager_->GetFromAXNode(parent);
|
| + return manager_->GetCrossFrameParent();
|
| }
|
|
|
| int32 BrowserAccessibility::GetIndexInParent() const {
|
| @@ -680,4 +702,10 @@ int BrowserAccessibility::GetStaticTextLenRecursive() const {
|
| return len;
|
| }
|
|
|
| +void BrowserAccessibility::SetChildFrameTreeNodeId(
|
| + int64 child_frame_tree_node_id) {
|
| + child_frame_tree_node_id_ = child_frame_tree_node_id;
|
| + manager_->NotifyAccessibilityEvent(ui::AX_EVENT_CHILDREN_CHANGED, this);
|
| +}
|
| +
|
| } // namespace content
|
|
|