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 "chrome/browser/ui/aura/accessibility/automation_manager_aura.h" | 5 #include "chrome/browser/ui/aura/accessibility/automation_manager_aura.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 pending_events_.push_back(std::make_pair(aura_obj, event_type)); | 139 pending_events_.push_back(std::make_pair(aura_obj, event_type)); |
140 return; | 140 return; |
141 } | 141 } |
142 processing_events_ = true; | 142 processing_events_ = true; |
143 | 143 |
144 ExtensionMsg_AccessibilityEventParams params; | 144 ExtensionMsg_AccessibilityEventParams params; |
145 if (!current_tree_serializer_->SerializeChanges(aura_obj, ¶ms.update)) { | 145 if (!current_tree_serializer_->SerializeChanges(aura_obj, ¶ms.update)) { |
146 LOG(ERROR) << "Unable to serialize one accessibility event."; | 146 LOG(ERROR) << "Unable to serialize one accessibility event."; |
147 return; | 147 return; |
148 } | 148 } |
| 149 |
| 150 // Make sure the focused node is serialized. |
| 151 views::AXAuraObjWrapper* focus = |
| 152 views::AXAuraObjCache::GetInstance()->GetFocus(); |
| 153 if (focus) |
| 154 current_tree_serializer_->SerializeChanges(focus, ¶ms.update); |
| 155 |
149 params.tree_id = 0; | 156 params.tree_id = 0; |
150 params.id = aura_obj->GetID(); | 157 params.id = aura_obj->GetID(); |
151 params.event_type = event_type; | 158 params.event_type = event_type; |
152 AutomationEventRouter* router = AutomationEventRouter::GetInstance(); | 159 AutomationEventRouter* router = AutomationEventRouter::GetInstance(); |
153 router->DispatchAccessibilityEvent(params); | 160 router->DispatchAccessibilityEvent(params); |
154 | 161 |
155 processing_events_ = false; | 162 processing_events_ = false; |
156 auto pending_events_copy = pending_events_; | 163 auto pending_events_copy = pending_events_; |
157 pending_events_.clear(); | 164 pending_events_.clear(); |
158 for (size_t i = 0; i < pending_events_copy.size(); ++i) { | 165 for (size_t i = 0; i < pending_events_copy.size(); ++i) { |
159 SendEvent(context, | 166 SendEvent(context, |
160 pending_events_copy[i].first, | 167 pending_events_copy[i].first, |
161 pending_events_copy[i].second); | 168 pending_events_copy[i].second); |
162 } | 169 } |
163 } | 170 } |
OLD | NEW |