OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/views/accessibility/native_view_accessibility_mac.h" | 5 #include "ui/views/accessibility/native_view_accessibility_mac.h" |
6 | 6 |
7 #include "ui/views/view.h" | 7 #include "ui/views/view.h" |
8 #include "ui/views/widget/widget.h" | 8 #include "ui/views/widget/widget.h" |
9 | 9 |
10 namespace views { | 10 namespace views { |
11 | 11 |
12 // static | 12 // static |
13 NativeViewAccessibility* NativeViewAccessibility::Create(View* view) { | 13 NativeViewAccessibility* NativeViewAccessibility::Create(View* view) { |
14 return new NativeViewAccessibilityMac(view); | 14 return new NativeViewAccessibilityMac(view); |
15 } | 15 } |
16 | 16 |
17 NativeViewAccessibilityMac::NativeViewAccessibilityMac(View* view) | 17 NativeViewAccessibilityMac::NativeViewAccessibilityMac(View* view) |
18 : NativeViewAccessibility(view) {} | 18 : NativeViewAccessibility(view) {} |
19 | 19 |
20 gfx::NativeViewAccessible NativeViewAccessibilityMac::GetParent() { | 20 gfx::NativeViewAccessible NativeViewAccessibilityMac::GetParent() { |
21 if (view_->parent()) | 21 View* parent_view = view_->parent(); |
22 return view_->parent()->GetNativeViewAccessible(); | 22 if (parent_view) { |
23 if (NativeViewAccessibility::GetForView(parent_view)->GetData().role == | |
24 ui::AX_ROLE_IGNORED) | |
Patti Lor
2017/02/21 03:29:17
I just inlined IsViewA11yIgnored() from native_vie
tapted
2017/02/21 06:01:12
Can this do something like
gfx::NativeViewAccessi
Patti Lor
2017/02/27 05:31:04
Done, kinda - traded your GetToolkitParent() sugge
| |
25 return GetForView(parent_view)->GetParent(); | |
26 return parent_view->GetNativeViewAccessible(); | |
27 } | |
23 | 28 |
24 if (view_->GetWidget()) | 29 if (view_->GetWidget()) |
25 return view_->GetWidget()->GetNativeView(); | 30 return view_->GetWidget()->GetNativeView(); |
26 | 31 |
27 if (parent_widget_) | 32 if (parent_widget_) |
28 return parent_widget_->GetRootView()->GetNativeViewAccessible(); | 33 return parent_widget_->GetRootView()->GetNativeViewAccessible(); |
29 | 34 |
30 return nullptr; | 35 return nullptr; |
31 } | 36 } |
32 | 37 |
33 } // namespace views | 38 } // namespace views |
OLD | NEW |