| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 views::AXAuraObjWrapper* aura_obj, | 136 views::AXAuraObjWrapper* aura_obj, |
| 137 ui::AXEvent event_type) { | 137 ui::AXEvent event_type) { |
| 138 if (processing_events_) { | 138 if (processing_events_) { |
| 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 current_tree_serializer_->SerializeChanges(aura_obj, ¶ms.update); | 145 current_tree_serializer_->SerializeChanges(aura_obj, ¶ms.update); |
| 146 |
| 147 // Make sure the focused node is serialized. |
| 148 views::AXAuraObjWrapper* focus = |
| 149 views::AXAuraObjCache::GetInstance()->GetFocus(); |
| 150 if (focus) |
| 151 current_tree_serializer_->SerializeChanges(focus, ¶ms.update); |
| 152 |
| 146 params.tree_id = 0; | 153 params.tree_id = 0; |
| 147 params.id = aura_obj->GetID(); | 154 params.id = aura_obj->GetID(); |
| 148 params.event_type = event_type; | 155 params.event_type = event_type; |
| 149 AutomationEventRouter* router = AutomationEventRouter::GetInstance(); | 156 AutomationEventRouter* router = AutomationEventRouter::GetInstance(); |
| 150 router->DispatchAccessibilityEvent(params); | 157 router->DispatchAccessibilityEvent(params); |
| 151 | 158 |
| 152 processing_events_ = false; | 159 processing_events_ = false; |
| 153 auto pending_events_copy = pending_events_; | 160 auto pending_events_copy = pending_events_; |
| 154 pending_events_.clear(); | 161 pending_events_.clear(); |
| 155 for (size_t i = 0; i < pending_events_copy.size(); ++i) { | 162 for (size_t i = 0; i < pending_events_copy.size(); ++i) { |
| 156 SendEvent(context, | 163 SendEvent(context, |
| 157 pending_events_copy[i].first, | 164 pending_events_copy[i].first, |
| 158 pending_events_copy[i].second); | 165 pending_events_copy[i].second); |
| 159 } | 166 } |
| 160 } | 167 } |
| OLD | NEW |