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

Unified Diff: ui/views/view.cc

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: Fix compile error and final test in NativeWidgetMacTest. Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/view.cc
diff --git a/ui/views/view.cc b/ui/views/view.cc
index 847f807f356b944d275b238348bdb7db88b62032..607f2908e847f19d96b37391f86aae4d4ab5df46 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -1319,12 +1319,16 @@ bool View::ExceededDragThreshold(const gfx::Vector2d& delta) {
// Accessibility----------------------------------------------------------------
-gfx::NativeViewAccessible View::GetNativeViewAccessible() {
+NativeViewAccessibility* View::GetNativeViewAccessibility() {
if (!native_view_accessibility_)
native_view_accessibility_ = NativeViewAccessibility::Create(this);
- if (native_view_accessibility_)
- return native_view_accessibility_->GetNativeObject();
- return NULL;
+ return native_view_accessibility_;
+}
+
+gfx::NativeViewAccessible View::GetNativeViewAccessible() {
+ if (GetNativeViewAccessibility())
+ return GetNativeViewAccessibility()->GetNativeObject();
+ return nullptr;
}
void View::NotifyAccessibilityEvent(
@@ -1334,10 +1338,8 @@ void View::NotifyAccessibilityEvent(
ViewsDelegate::GetInstance()->NotifyAccessibilityEvent(this, event_type);
if (send_native_event && GetWidget()) {
- if (!native_view_accessibility_)
- native_view_accessibility_ = NativeViewAccessibility::Create(this);
- if (native_view_accessibility_)
- native_view_accessibility_->NotifyAccessibilityEvent(event_type);
+ if (GetNativeViewAccessibility())
+ GetNativeViewAccessibility()->NotifyAccessibilityEvent(event_type);
}
}

Powered by Google App Engine
This is Rietveld 408576698