| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "modules/accessibility/InspectorAccessibilityAgent.h" | 5 #include "modules/accessibility/InspectorAccessibilityAgent.h" |
| 6 | 6 |
| 7 #include "core/HTMLNames.h" | 7 #include "core/HTMLNames.h" |
| 8 #include "core/dom/AXObjectCache.h" | 8 #include "core/dom/AXObjectCache.h" |
| 9 #include "core/dom/DOMNodeIds.h" | 9 #include "core/dom/DOMNodeIds.h" |
| 10 #include "core/dom/Element.h" | 10 #include "core/dom/Element.h" |
| (...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 716 child_ids->addItem(String::Number(inspected_ax_object->AxObjectID())); | 716 child_ids->addItem(String::Number(inspected_ax_object->AxObjectID())); |
| 717 return; | 717 return; |
| 718 } | 718 } |
| 719 | 719 |
| 720 const AXObject::AXObjectVector& children = ax_object.Children(); | 720 const AXObject::AXObjectVector& children = ax_object.Children(); |
| 721 for (unsigned i = 0; i < children.size(); i++) { | 721 for (unsigned i = 0; i < children.size(); i++) { |
| 722 AXObject& child_ax_object = *children[i].Get(); | 722 AXObject& child_ax_object = *children[i].Get(); |
| 723 child_ids->addItem(String::Number(child_ax_object.AxObjectID())); | 723 child_ids->addItem(String::Number(child_ax_object.AxObjectID())); |
| 724 if (&child_ax_object == inspected_ax_object) | 724 if (&child_ax_object == inspected_ax_object) |
| 725 continue; | 725 continue; |
| 726 if (&ax_object != inspected_ax_object && | 726 if (&ax_object != inspected_ax_object) { |
| 727 (ax_object.GetNode() || | 727 if (!inspected_ax_object) |
| 728 ax_object.ParentObjectUnignored() != inspected_ax_object)) { | 728 continue; |
| 729 continue; | 729 if (&ax_object != inspected_ax_object->ParentObjectUnignored()) |
| 730 continue; |
| 730 } | 731 } |
| 731 | 732 |
| 732 // Only add children of inspected node (or un-inspectable children of | 733 // Only add children of inspected node (or un-inspectable children of |
| 733 // inspected node) to returned nodes. | 734 // inspected node) to returned nodes. |
| 734 std::unique_ptr<AXNode> child_node = BuildProtocolAXObject( | 735 std::unique_ptr<AXNode> child_node = BuildProtocolAXObject( |
| 735 child_ax_object, inspected_ax_object, true, nodes, cache); | 736 child_ax_object, inspected_ax_object, true, nodes, cache); |
| 736 nodes->addItem(std::move(child_node)); | 737 nodes->addItem(std::move(child_node)); |
| 737 } | 738 } |
| 738 } | 739 } |
| 739 | 740 |
| 740 DEFINE_TRACE(InspectorAccessibilityAgent) { | 741 DEFINE_TRACE(InspectorAccessibilityAgent) { |
| 741 visitor->Trace(page_); | 742 visitor->Trace(page_); |
| 742 visitor->Trace(dom_agent_); | 743 visitor->Trace(dom_agent_); |
| 743 InspectorBaseAgent::Trace(visitor); | 744 InspectorBaseAgent::Trace(visitor); |
| 744 } | 745 } |
| 745 | 746 |
| 746 } // namespace blink | 747 } // namespace blink |
| OLD | NEW |