1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ui/accessibility/platform/ax_platform_node_base.h"
7 #include "ui/accessibility/ax_node_data.h"
8 #include "ui/accessibility/platform/ax_platform_node_delegate.h"
12 AXPlatformNodeBase::AXPlatformNodeBase() {
15 AXPlatformNodeBase::~AXPlatformNodeBase() {
18 void AXPlatformNodeBase::Init(AXPlatformNodeDelegate
* delegate
) {
22 AXRole
AXPlatformNodeBase::GetRole() const {
23 return delegate_
? delegate_
->GetData()->role
: AX_ROLE_UNKNOWN
;
26 gfx::Rect
AXPlatformNodeBase::GetBoundsInScreen() const {
29 gfx::Rect bounds
= delegate_
->GetData()->location
;
30 bounds
.Offset(delegate_
->GetGlobalCoordinateOffset());
34 gfx::NativeViewAccessible
AXPlatformNodeBase::GetParent() {
35 return delegate_
? delegate_
->GetParent() : NULL
;
38 int AXPlatformNodeBase::GetChildCount() {
39 return delegate_
? delegate_
->GetChildCount() : 0;
42 gfx::NativeViewAccessible
AXPlatformNodeBase::ChildAtIndex(int index
) {
43 return delegate_
? delegate_
->ChildAtIndex(index
) : NULL
;
48 void AXPlatformNodeBase::Destroy() {
53 gfx::NativeViewAccessible
AXPlatformNodeBase::GetNativeViewAccessible() {