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/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "ui/aura/client/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 return GetOrCreate(focused_view); | 117 return GetOrCreate(focused_view); |
118 return nullptr; | 118 return nullptr; |
119 } | 119 } |
120 | 120 |
121 void AXAuraObjCache::OnFocusedViewChanged() { | 121 void AXAuraObjCache::OnFocusedViewChanged() { |
122 View* view = GetFocusedView(); | 122 View* view = GetFocusedView(); |
123 if (view) | 123 if (view) |
124 view->NotifyAccessibilityEvent(ui::AX_EVENT_FOCUS, true); | 124 view->NotifyAccessibilityEvent(ui::AX_EVENT_FOCUS, true); |
125 } | 125 } |
126 | 126 |
| 127 void AXAuraObjCache::FireEvent(AXAuraObjWrapper* aura_obj, |
| 128 ui::AXEvent event_type) { |
| 129 if (delegate_) |
| 130 delegate_->OnEvent(aura_obj, event_type); |
| 131 } |
| 132 |
127 AXAuraObjCache::AXAuraObjCache() | 133 AXAuraObjCache::AXAuraObjCache() |
128 : current_id_(1), | 134 : current_id_(1), |
129 focus_client_(nullptr), | 135 focus_client_(nullptr), |
130 is_destroying_(false), | 136 is_destroying_(false), |
131 delegate_(nullptr) {} | 137 delegate_(nullptr) {} |
132 | 138 |
133 AXAuraObjCache::~AXAuraObjCache() { | 139 AXAuraObjCache::~AXAuraObjCache() { |
134 is_destroying_ = true; | 140 is_destroying_ = true; |
135 cache_.clear(); | 141 cache_.clear(); |
136 } | 142 } |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 AuraView* aura_view, | 225 AuraView* aura_view, |
220 std::map<AuraView*, int32_t>& aura_view_to_id_map) { | 226 std::map<AuraView*, int32_t>& aura_view_to_id_map) { |
221 int32_t id = GetID(aura_view); | 227 int32_t id = GetID(aura_view); |
222 if (id == -1) | 228 if (id == -1) |
223 return; | 229 return; |
224 aura_view_to_id_map.erase(aura_view); | 230 aura_view_to_id_map.erase(aura_view); |
225 Remove(id); | 231 Remove(id); |
226 } | 232 } |
227 | 233 |
228 } // namespace views | 234 } // namespace views |
OLD | NEW |