| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/accessibility/ax_tree_id_registry.h" | 5 #include "ui/accessibility/ax_tree_id_registry.h" |
| 6 | 6 |
| 7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
| 8 #include "ui/accessibility/ax_host_delegate.h" | 8 #include "ui/accessibility/ax_host_delegate.h" |
| 9 | 9 |
| 10 namespace ui { | 10 namespace ui { |
| 11 | 11 |
| 12 // static | 12 // static |
| 13 const AXTreeIDRegistry::AXTreeID AXTreeIDRegistry::kNoAXTreeID = -1; | |
| 14 | |
| 15 // static | |
| 16 AXTreeIDRegistry* AXTreeIDRegistry::GetInstance() { | 13 AXTreeIDRegistry* AXTreeIDRegistry::GetInstance() { |
| 17 return base::Singleton<AXTreeIDRegistry>::get(); | 14 return base::Singleton<AXTreeIDRegistry>::get(); |
| 18 } | 15 } |
| 19 | 16 |
| 20 AXTreeIDRegistry::AXTreeID AXTreeIDRegistry::GetOrCreateAXTreeID( | 17 AXTreeIDRegistry::AXTreeID AXTreeIDRegistry::GetOrCreateAXTreeID( |
| 21 int process_id, | 18 int process_id, |
| 22 int routing_id) { | 19 int routing_id) { |
| 23 FrameID frame_id(process_id, routing_id); | 20 FrameID frame_id(process_id, routing_id); |
| 24 auto it = frame_to_ax_tree_id_map_.find(frame_id); | 21 auto it = frame_to_ax_tree_id_map_.find(frame_id); |
| 25 if (it != frame_to_ax_tree_id_map_.end()) | 22 if (it != frame_to_ax_tree_id_map_.end()) |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 } | 75 } |
| 79 | 76 |
| 80 AXTreeIDRegistry::AXTreeIDRegistry() : ax_tree_id_counter_(-1) { | 77 AXTreeIDRegistry::AXTreeIDRegistry() : ax_tree_id_counter_(-1) { |
| 81 // Always populate default desktop tree value (0 -> 0, 0). | 78 // Always populate default desktop tree value (0 -> 0, 0). |
| 82 GetOrCreateAXTreeID(0, 0); | 79 GetOrCreateAXTreeID(0, 0); |
| 83 } | 80 } |
| 84 | 81 |
| 85 AXTreeIDRegistry::~AXTreeIDRegistry() {} | 82 AXTreeIDRegistry::~AXTreeIDRegistry() {} |
| 86 | 83 |
| 87 } // namespace ui | 84 } // namespace ui |
| OLD | NEW |