| 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/views/accessibility/ax_aura_obj_cache.h" | 5 #include "ui/views/accessibility/ax_aura_obj_cache.h" |
| 6 | 6 |
| 7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
| 10 #include "ui/views/accessibility/ax_aura_obj_wrapper.h" | 10 #include "ui/views/accessibility/ax_aura_obj_wrapper.h" |
| 11 #include "ui/views/accessibility/ax_view_obj_wrapper.h" | 11 #include "ui/views/accessibility/ax_view_obj_wrapper.h" |
| 12 #include "ui/views/accessibility/ax_widget_obj_wrapper.h" | 12 #include "ui/views/accessibility/ax_widget_obj_wrapper.h" |
| 13 #include "ui/views/accessibility/ax_window_obj_wrapper.h" | 13 #include "ui/views/accessibility/ax_window_obj_wrapper.h" |
| 14 #include "ui/views/view.h" | 14 #include "ui/views/view.h" |
| 15 #include "ui/views/widget/widget.h" | 15 #include "ui/views/widget/widget.h" |
| 16 | 16 |
| 17 namespace views { | 17 namespace views { |
| 18 | 18 |
| 19 // static | 19 // static |
| 20 AXAuraObjCache* AXAuraObjCache::GetInstance() { | 20 AXAuraObjCache* AXAuraObjCache::GetInstance() { |
| 21 return Singleton<AXAuraObjCache>::get(); | 21 return base::Singleton<AXAuraObjCache>::get(); |
| 22 } | 22 } |
| 23 | 23 |
| 24 AXAuraObjWrapper* AXAuraObjCache::GetOrCreate(View* view) { | 24 AXAuraObjWrapper* AXAuraObjCache::GetOrCreate(View* view) { |
| 25 return CreateInternal<AXViewObjWrapper>(view, view_to_id_map_); | 25 return CreateInternal<AXViewObjWrapper>(view, view_to_id_map_); |
| 26 } | 26 } |
| 27 | 27 |
| 28 AXAuraObjWrapper* AXAuraObjCache::GetOrCreate(Widget* widget) { | 28 AXAuraObjWrapper* AXAuraObjCache::GetOrCreate(Widget* widget) { |
| 29 return CreateInternal<AXWidgetObjWrapper>(widget, widget_to_id_map_); | 29 return CreateInternal<AXWidgetObjWrapper>(widget, widget_to_id_map_); |
| 30 } | 30 } |
| 31 | 31 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 void AXAuraObjCache::RemoveInternal( | 142 void AXAuraObjCache::RemoveInternal( |
| 143 AuraView* aura_view, std::map<AuraView*, int32>& aura_view_to_id_map) { | 143 AuraView* aura_view, std::map<AuraView*, int32>& aura_view_to_id_map) { |
| 144 int32 id = GetID(aura_view); | 144 int32 id = GetID(aura_view); |
| 145 if (id == -1) | 145 if (id == -1) |
| 146 return; | 146 return; |
| 147 aura_view_to_id_map.erase(aura_view); | 147 aura_view_to_id_map.erase(aura_view); |
| 148 Remove(id); | 148 Remove(id); |
| 149 } | 149 } |
| 150 | 150 |
| 151 } // namespace views | 151 } // namespace views |
| OLD | NEW |