| 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 "ui/accessibility/platform/ax_platform_node_base.h" | 5 #include "ui/accessibility/platform/ax_platform_node_base.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "ui/accessibility/ax_node_data.h" | 8 #include "ui/accessibility/ax_node_data.h" |
| 9 #include "ui/accessibility/platform/ax_platform_node_delegate.h" | 9 #include "ui/accessibility/platform/ax_platform_node_delegate.h" |
| 10 | 10 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 return FromNativeViewAccessible(parent->ChildAtIndex(next_index)); | 86 return FromNativeViewAccessible(parent->ChildAtIndex(next_index)); |
| 87 return nullptr; | 87 return nullptr; |
| 88 } | 88 } |
| 89 | 89 |
| 90 bool AXPlatformNodeBase::IsDescendant(AXPlatformNodeBase* node) { | 90 bool AXPlatformNodeBase::IsDescendant(AXPlatformNodeBase* node) { |
| 91 CHECK(delegate_); | 91 CHECK(delegate_); |
| 92 if (!node) | 92 if (!node) |
| 93 return false; | 93 return false; |
| 94 if (node == this) | 94 if (node == this) |
| 95 return true; | 95 return true; |
| 96 AXPlatformNodeBase* parent = FromNativeViewAccessible(node->GetParent()); | 96 gfx::NativeViewAccessible native_parent = node->GetParent(); |
| 97 if (!native_parent) |
| 98 return false; |
| 99 AXPlatformNodeBase* parent = FromNativeViewAccessible(native_parent); |
| 97 return IsDescendant(parent); | 100 return IsDescendant(parent); |
| 98 } | 101 } |
| 99 | 102 |
| 100 bool AXPlatformNodeBase::HasBoolAttribute( | 103 bool AXPlatformNodeBase::HasBoolAttribute( |
| 101 ui::AXBoolAttribute attribute) const { | 104 ui::AXBoolAttribute attribute) const { |
| 102 CHECK(delegate_); | 105 CHECK(delegate_); |
| 103 return GetData().HasBoolAttribute(attribute); | 106 return GetData().HasBoolAttribute(attribute); |
| 104 } | 107 } |
| 105 | 108 |
| 106 bool AXPlatformNodeBase::GetBoolAttribute( | 109 bool AXPlatformNodeBase::GetBoolAttribute( |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 } | 192 } |
| 190 | 193 |
| 191 // static | 194 // static |
| 192 AXPlatformNodeBase* AXPlatformNodeBase::FromNativeViewAccessible( | 195 AXPlatformNodeBase* AXPlatformNodeBase::FromNativeViewAccessible( |
| 193 gfx::NativeViewAccessible accessible) { | 196 gfx::NativeViewAccessible accessible) { |
| 194 return static_cast<AXPlatformNodeBase*>( | 197 return static_cast<AXPlatformNodeBase*>( |
| 195 AXPlatformNode::FromNativeViewAccessible(accessible)); | 198 AXPlatformNode::FromNativeViewAccessible(accessible)); |
| 196 } | 199 } |
| 197 | 200 |
| 198 } // namespace ui | 201 } // namespace ui |
| OLD | NEW |