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

Unified Diff: ui/views/accessibility/native_view_accessibility_mac.mm

Issue 2704263002: MacViews/a11y: Implement NativeViewAccessibilityMac. (Closed)
Patch Set: Review comments. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/accessibility/native_view_accessibility_mac.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/accessibility/native_view_accessibility_mac.mm
diff --git a/ui/views/accessibility/native_view_accessibility_mac.mm b/ui/views/accessibility/native_view_accessibility_mac.mm
new file mode 100644
index 0000000000000000000000000000000000000000..68e58caaa33a5158036311c8b007e0c2ea87d573
--- /dev/null
+++ b/ui/views/accessibility/native_view_accessibility_mac.mm
@@ -0,0 +1,33 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/views/accessibility/native_view_accessibility_mac.h"
+
+#include "ui/views/view.h"
+#include "ui/views/widget/widget.h"
+
+namespace views {
+
+// static
+NativeViewAccessibility* NativeViewAccessibility::Create(View* view) {
+ return new NativeViewAccessibilityMac(view);
+}
+
+NativeViewAccessibilityMac::NativeViewAccessibilityMac(View* view)
+ : NativeViewAccessibility(view) {}
+
+gfx::NativeViewAccessible NativeViewAccessibilityMac::GetParent() {
+ if (view_->parent())
+ return view_->parent()->GetNativeViewAccessible();
+
+ if (view_->GetWidget())
+ return view_->GetWidget()->GetNativeView();
+
+ if (parent_widget_)
+ return parent_widget_->GetRootView()->GetNativeViewAccessible();
+
+ return nullptr;
+}
+
+} // namespace views
« no previous file with comments | « ui/views/accessibility/native_view_accessibility_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698