Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(309)

Side by Side Diff: ui/accessibility/platform/ax_platform_node_base.cc

Issue 1811403002: IAccessible::get_accChild should only return a descendant. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/browser/accessibility/browser_accessibility_win_unittest.cc ('k') | ui/accessibility/platform/ax_platform_node_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698