| 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/client/focus_client.h" | 9 #include "ui/aura/client/focus_client.h" |
| 10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 } | 115 } |
| 116 | 116 |
| 117 AXAuraObjCache::AXAuraObjCache() | 117 AXAuraObjCache::AXAuraObjCache() |
| 118 : current_id_(1), | 118 : current_id_(1), |
| 119 focus_client_(nullptr), | 119 focus_client_(nullptr), |
| 120 is_destroying_(false) { | 120 is_destroying_(false) { |
| 121 } | 121 } |
| 122 | 122 |
| 123 AXAuraObjCache::~AXAuraObjCache() { | 123 AXAuraObjCache::~AXAuraObjCache() { |
| 124 is_destroying_ = true; | 124 is_destroying_ = true; |
| 125 STLDeleteContainerPairSecondPointers(cache_.begin(), cache_.end()); | 125 base::STLDeleteContainerPairSecondPointers(cache_.begin(), cache_.end()); |
| 126 cache_.clear(); | 126 cache_.clear(); |
| 127 } | 127 } |
| 128 | 128 |
| 129 View* AXAuraObjCache::GetFocusedView() { | 129 View* AXAuraObjCache::GetFocusedView() { |
| 130 if (!focus_client_) | 130 if (!focus_client_) |
| 131 return nullptr; | 131 return nullptr; |
| 132 | 132 |
| 133 aura::Window* focused_window = focus_client_->GetFocusedWindow(); | 133 aura::Window* focused_window = focus_client_->GetFocusedWindow(); |
| 134 if (!focused_window) | 134 if (!focused_window) |
| 135 return nullptr; | 135 return nullptr; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 AuraView* aura_view, | 203 AuraView* aura_view, |
| 204 std::map<AuraView*, int32_t>& aura_view_to_id_map) { | 204 std::map<AuraView*, int32_t>& aura_view_to_id_map) { |
| 205 int32_t id = GetID(aura_view); | 205 int32_t id = GetID(aura_view); |
| 206 if (id == -1) | 206 if (id == -1) |
| 207 return; | 207 return; |
| 208 aura_view_to_id_map.erase(aura_view); | 208 aura_view_to_id_map.erase(aura_view); |
| 209 Remove(id); | 209 Remove(id); |
| 210 } | 210 } |
| 211 | 211 |
| 212 } // namespace views | 212 } // namespace views |
| OLD | NEW |