OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #include "ui/accessibility/platform/ax_platform_node_base.h" |
| 6 |
| 7 #include "ui/accessibility/ax_node_data.h" |
| 8 #include "ui/accessibility/platform/ax_platform_node_delegate.h" |
| 9 |
| 10 namespace ui { |
| 11 |
| 12 AXPlatformNodeBase::AXPlatformNodeBase() { |
| 13 } |
| 14 |
| 15 AXPlatformNodeBase::~AXPlatformNodeBase() { |
| 16 } |
| 17 |
| 18 void AXPlatformNodeBase::Init(AXPlatformNodeDelegate* delegate) { |
| 19 delegate_ = delegate; |
| 20 } |
| 21 |
| 22 AXRole AXPlatformNodeBase::GetRole() const { |
| 23 return delegate_ ? delegate_->GetData()->role : AX_ROLE_UNKNOWN; |
| 24 } |
| 25 |
| 26 gfx::Rect AXPlatformNodeBase::GetBoundsInScreen() const { |
| 27 if (!delegate_) |
| 28 return gfx::Rect(); |
| 29 gfx::Rect bounds = delegate_->GetData()->location; |
| 30 bounds.Offset(delegate_->GetGlobalCoordinateOffset()); |
| 31 return bounds; |
| 32 } |
| 33 |
| 34 gfx::NativeViewAccessible AXPlatformNodeBase::GetParent() { |
| 35 return delegate_ ? delegate_->GetParent() : NULL; |
| 36 } |
| 37 |
| 38 int AXPlatformNodeBase::GetChildCount() { |
| 39 return delegate_ ? delegate_->GetChildCount() : 0; |
| 40 } |
| 41 |
| 42 gfx::NativeViewAccessible AXPlatformNodeBase::ChildAtIndex(int index) { |
| 43 return delegate_ ? delegate_->ChildAtIndex(index) : NULL; |
| 44 } |
| 45 |
| 46 // AXPlatformNode |
| 47 |
| 48 void AXPlatformNodeBase::Destroy() { |
| 49 delegate_ = NULL; |
| 50 delete this; |
| 51 } |
| 52 |
| 53 gfx::NativeViewAccessible AXPlatformNodeBase::GetNativeViewAccessible() { |
| 54 return NULL; |
| 55 } |
| 56 |
| 57 |
| 58 } // namespace ui |
OLD | NEW |