20 auto it = frame_to_ax_tree_id_map_.find(
frame_id);
21 if (it != frame_to_ax_tree_id_map_.end()) {
26 frame_to_ax_tree_id_map_[
frame_id] = ax_tree_id;
27 ax_tree_to_frame_id_map_[ax_tree_id] =
frame_id;
32 auto it = ax_tree_to_frame_id_map_.find(ax_tree_id);
33 if (it != ax_tree_to_frame_id_map_.end())
40 auto it = frame_to_ax_tree_id_map_.find(
frame_id);
41 if (it != frame_to_ax_tree_id_map_.end())
48 for (
auto it : id_to_action_handler_) {
49 if (it.second == handler)
53 SetAXTreeID(new_id, handler);
58 auto it = id_to_action_handler_.find(ax_tree_id);
59 if (it == id_to_action_handler_.end())
64void AXTreeIDRegistry::SetAXTreeID(
const ui::AXTreeID&
id,
66 BASE_DCHECK(id_to_action_handler_.find(
id) == id_to_action_handler_.end());
67 id_to_action_handler_[
id] = action_handler;
71 auto frame_it = ax_tree_to_frame_id_map_.find(ax_tree_id);
72 if (frame_it != ax_tree_to_frame_id_map_.end()) {
73 frame_to_ax_tree_id_map_.erase(frame_it->second);
74 ax_tree_to_frame_id_map_.erase(frame_it);
77 auto action_it = id_to_action_handler_.find(ax_tree_id);
78 if (action_it != id_to_action_handler_.end())
79 id_to_action_handler_.erase(action_it);
82AXTreeIDRegistry::AXTreeIDRegistry() {}
std::pair< int, int > FrameID
AXActionHandlerBase * GetActionHandler(AXTreeID ax_tree_id)
void RemoveAXTreeID(AXTreeID ax_tree_id)
static AXTreeIDRegistry & GetInstance()
AXTreeID GetAXTreeID(FrameID frame_id)
FrameID GetFrameID(const AXTreeID &ax_tree_id)
virtual ~AXTreeIDRegistry()
void SetFrameIDForAXTreeID(const FrameID &frame_id, const AXTreeID &ax_tree_id)
static AXTreeID CreateNewAXTreeID()
const AXTreeID & AXTreeIDUnknown()
#define BASE_DCHECK(condition)
#define BASE_UNREACHABLE()