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

Unified Diff: ui/views/view.cc

Issue 2210763002: MacViews a11y: Sync VoiceOver cursor with keyboard focus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments, delete accessibilityShouldUseUniqueId. 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
« ui/views/cocoa/bridged_content_view.mm ('K') | « ui/views/view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
}
« ui/views/cocoa/bridged_content_view.mm ('K') | « ui/views/view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698