| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } |
| 89 | 89 |
| 90 auto manager = BrowserAccessibilityManager::FromID(tree_id); | 90 auto* manager = BrowserAccessibilityManager::FromID(tree_id); |
| 91 if (!manager) | 91 if (!manager) |
| 92 return nullptr; | 92 return nullptr; |
| 93 return manager->GetFromID(node_id); | 93 return manager->GetFromID(node_id); |
| 94 } | 94 } |
| 95 | 95 |
| 96 int AXPlatformPosition::MaxTextOffset() const { | 96 int AXPlatformPosition::MaxTextOffset() const { |
| 97 if (IsNullPosition()) | 97 if (IsNullPosition()) |
| 98 return INVALID_OFFSET; | 98 return INVALID_OFFSET; |
| 99 return static_cast<int>(GetInnerText().length()); | 99 return static_cast<int>(GetInnerText().length()); |
| 100 } | 100 } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 int previous_on_line_id; | 140 int previous_on_line_id; |
| 141 if (!node || | 141 if (!node || |
| 142 !node->GetIntAttribute(ui::AX_ATTR_PREVIOUS_ON_LINE_ID, | 142 !node->GetIntAttribute(ui::AX_ATTR_PREVIOUS_ON_LINE_ID, |
| 143 &previous_on_line_id)) { | 143 &previous_on_line_id)) { |
| 144 return INVALID_ANCHOR_ID; | 144 return INVALID_ANCHOR_ID; |
| 145 } | 145 } |
| 146 return static_cast<int32_t>(previous_on_line_id); | 146 return static_cast<int32_t>(previous_on_line_id); |
| 147 } | 147 } |
| 148 | 148 |
| 149 } // namespace content | 149 } // namespace content |
| OLD | NEW |