blob: 993119fb012470e1d13fc60c6e0843259daf0b44 [file] [log] [blame]
// 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/view_ax_platform_node_delegate_mac.h"
#include <memory>
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
namespace views {
// static
std::unique_ptr<ViewAccessibility> ViewAccessibility::Create(View* view) {
return std::make_unique<ViewAXPlatformNodeDelegateMac>(view);
}
ViewAXPlatformNodeDelegateMac::ViewAXPlatformNodeDelegateMac(View* view)
: ViewAXPlatformNodeDelegate(view) {}
ViewAXPlatformNodeDelegateMac::~ViewAXPlatformNodeDelegateMac() = default;
gfx::NativeViewAccessible ViewAXPlatformNodeDelegateMac::GetParent() {
if (view()->parent())
return view()->parent()->GetNativeViewAccessible();
if (view()->GetWidget())
return view()->GetWidget()->GetNativeView();
return nullptr;
}
} // namespace views