Chromium Code Reviews| 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..27b1a4fc8cbba80ac0db3ba3c142a45b76d70a29 |
| --- /dev/null |
| +++ b/ui/views/accessibility/native_view_accessibility_mac.mm |
| @@ -0,0 +1,33 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
|
tapted
2017/02/21 04:22:39
nit: 2017
Patti Lor
2017/02/21 22:52:49
Done.
|
| +// 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 |