| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "content/browser/accessibility/ax_platform_position.h" | 5 #include "content/browser/accessibility/ax_platform_position.h" |
| 6 | 6 |
| 7 #include "content/browser/accessibility/browser_accessibility.h" | 7 #include "content/browser/accessibility/browser_accessibility.h" |
| 8 #include "content/browser/accessibility/browser_accessibility_manager.h" | 8 #include "content/browser/accessibility/browser_accessibility_manager.h" |
| 9 #include "ui/accessibility/ax_enums.h" | 9 #include "ui/accessibility/ax_enums.h" |
| 10 | 10 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 int AXPlatformPosition::AnchorIndexInParent() const { | 62 int AXPlatformPosition::AnchorIndexInParent() const { |
| 63 return GetAnchor() ? static_cast<int>(GetAnchor()->GetIndexInParent()) | 63 return GetAnchor() ? static_cast<int>(GetAnchor()->GetIndexInParent()) |
| 64 : AXPosition::INVALID_INDEX; | 64 : AXPosition::INVALID_INDEX; |
| 65 } | 65 } |
| 66 | 66 |
| 67 void AXPlatformPosition::AnchorParent(AXTreeID* tree_id, | 67 void AXPlatformPosition::AnchorParent(AXTreeID* tree_id, |
| 68 int32_t* parent_id) const { | 68 int32_t* parent_id) const { |
| 69 DCHECK(tree_id); | 69 DCHECK(tree_id); |
| 70 DCHECK(parent_id); | 70 DCHECK(parent_id); |
| 71 | 71 |
| 72 if (!GetAnchor() || !GetAnchor()->GetParent()) { | 72 if (!GetAnchor() || !GetAnchor()->PlatformGetParent()) { |
| 73 *tree_id = AXPosition::INVALID_TREE_ID; | 73 *tree_id = AXPosition::INVALID_TREE_ID; |
| 74 *parent_id = AXPosition::INVALID_ANCHOR_ID; | 74 *parent_id = AXPosition::INVALID_ANCHOR_ID; |
| 75 return; | 75 return; |
| 76 } | 76 } |
| 77 | 77 |
| 78 BrowserAccessibility* parent = GetAnchor()->GetParent(); | 78 BrowserAccessibility* parent = GetAnchor()->PlatformGetParent(); |
| 79 *tree_id = parent->manager()->ax_tree_id(); | 79 *tree_id = parent->manager()->ax_tree_id(); |
| 80 *parent_id = parent->GetId(); | 80 *parent_id = parent->GetId(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 BrowserAccessibility* AXPlatformPosition::GetNodeInTree(AXTreeID tree_id, | 83 BrowserAccessibility* AXPlatformPosition::GetNodeInTree(AXTreeID tree_id, |
| 84 int32_t node_id) const { | 84 int32_t node_id) const { |
| 85 if (tree_id == AXPosition::INVALID_TREE_ID || | 85 if (tree_id == AXPosition::INVALID_TREE_ID || |
| 86 node_id == AXPosition::INVALID_ANCHOR_ID) { | 86 node_id == AXPosition::INVALID_ANCHOR_ID) { |
| 87 return nullptr; | 87 return nullptr; |
| 88 } | 88 } |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 int previous_on_line_id; | 156 int previous_on_line_id; |
| 157 if (!node || | 157 if (!node || |
| 158 !node->GetIntAttribute(ui::AX_ATTR_PREVIOUS_ON_LINE_ID, | 158 !node->GetIntAttribute(ui::AX_ATTR_PREVIOUS_ON_LINE_ID, |
| 159 &previous_on_line_id)) { | 159 &previous_on_line_id)) { |
| 160 return INVALID_ANCHOR_ID; | 160 return INVALID_ANCHOR_ID; |
| 161 } | 161 } |
| 162 return static_cast<int32_t>(previous_on_line_id); | 162 return static_cast<int32_t>(previous_on_line_id); |
| 163 } | 163 } |
| 164 | 164 |
| 165 } // namespace content | 165 } // namespace content |
| OLD | NEW |