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

Side by Side Diff: ui/views/accessibility/native_view_accessibility_mac.mm

Issue 2119413004: a11y: Exclude children of nested keyboard accessible controls from a11y tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase on top of 2704263002. Created 3 years, 10 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 (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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698