Flutter Engine
The Flutter Engine
ax_tree_manager_map.cc
Go to the documentation of this file.
1// Copyright 2019 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
6
7#include "ax_enums.h"
9#include "base/logging.h"
10
11namespace ui {
12
14
16
19 return *instance;
20}
21
24 if (tree_id != AXTreeIDUnknown())
25 map_[tree_id] = manager;
26}
27
29 if (tree_id != AXTreeIDUnknown())
30 map_.erase(tree_id);
31}
32
34 if (tree_id == AXTreeIDUnknown() || !base::Contains(map_, tree_id))
35 return nullptr;
36
37 return map_.at(tree_id);
38}
39
41 const AXNode& parent_node) {
42 if (!parent_node.data().HasStringAttribute(
44 return nullptr;
45 }
46
47 AXTreeID child_tree_id =
50 AXTreeManager* child_tree_manager =
52
53 // Some platforms do not use AXTreeManagers, so child trees don't exist in
54 // the browser process.
55 if (!child_tree_manager)
56 return nullptr;
57
58 BASE_DCHECK(child_tree_manager->GetParentNodeFromParentTreeAsAXNode()->id() ==
59 parent_node.id());
60
61 return child_tree_manager;
62}
63
64} // namespace ui
AXID id() const
Definition: ax_node.h:110
const AXNodeData & data() const
Definition: ax_node.h:112
static AXTreeID FromString(const std::string &string)
Definition: ax_tree_id.cc:37
void AddTreeManager(AXTreeID tree_id, AXTreeManager *manager)
AXTreeManager * GetManagerForChildTree(const AXNode &parent_node)
AXTreeManager * GetManager(AXTreeID tree_id)
static AXTreeManagerMap & GetInstance()
void RemoveTreeManager(AXTreeID tree_id)
virtual AXNode * GetParentNodeFromParentTreeAsAXNode() const =0
VkInstance instance
Definition: main.cc:48
bool Contains(const Container &container, const Value &value)
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font manager
Definition: switches.h:218
const AXTreeID & AXTreeIDUnknown()
Definition: ax_tree_id.cc:103
bool HasStringAttribute(ax::mojom::StringAttribute attribute) const
const std::string & GetStringAttribute(ax::mojom::StringAttribute attribute) const
#define BASE_DCHECK(condition)
Definition: logging.h:63