Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(565)

Side by Side Diff: chrome/browser/ui/aura/accessibility/automation_manager_aura.cc

Issue 1705853002: NOT FOR REVIEW. ax tree focus with debugging (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed crash Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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, &params.update)) { 145 if (!current_tree_serializer_->SerializeChanges(aura_obj, &params.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, &params.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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698