summaryrefslogtreecommitdiff
path: root/chromium/ui/accessibility/ax_host_delegate.cc
blob: a7ecd1b0cdab5497181c477db6b54b162ad3a53f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// 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/accessibility/ax_host_delegate.h"

#include "ui/accessibility/ax_tree_id_registry.h"

namespace ui {

AXHostDelegate::AXHostDelegate()
    : tree_id_(AXTreeIDRegistry::GetInstance()->GetOrCreateAXTreeID(this)) {}

AXHostDelegate::AXHostDelegate(int32_t tree_id) : tree_id_(tree_id) {
  AXTreeIDRegistry::GetInstance()->SetDelegateForID(this, tree_id);
}

AXHostDelegate::~AXHostDelegate() {
  AXTreeIDRegistry::GetInstance()->RemoveAXTreeID(tree_id_);
}

}  // namespace ui