cc: Make VideoResourceUpdater use CopyToResource instead of SetPixels.
[chromium-blink-merge.git] / ui / accessibility / platform / ax_platform_node_base.cc
blob3479af14ab5d1daa5204100454b551f02c3e67d9
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"
10 namespace ui {
12 AXPlatformNodeBase::AXPlatformNodeBase() {
15 AXPlatformNodeBase::~AXPlatformNodeBase() {
18 void AXPlatformNodeBase::Init(AXPlatformNodeDelegate* delegate) {
19 delegate_ = delegate;
22 AXRole AXPlatformNodeBase::GetRole() const {
23 return delegate_ ? delegate_->GetData()->role : AX_ROLE_UNKNOWN;
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;
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;
46 // AXPlatformNode
48 void AXPlatformNodeBase::Destroy() {
49 delegate_ = NULL;
50 delete this;
53 gfx::NativeViewAccessible AXPlatformNodeBase::GetNativeViewAccessible() {
54 return NULL;
58 } // namespace ui