OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/accessibility/renderer_accessibility_complete.h" | 5 #include "content/renderer/accessibility/renderer_accessibility_complete.h" |
6 | 6 |
7 #include <queue> | 7 #include <queue> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 // of read-only queries at once. | 200 // of read-only queries at once. |
201 obj.startCachingComputedObjectAttributesUntilTreeMutates(); | 201 obj.startCachingComputedObjectAttributesUntilTreeMutates(); |
202 | 202 |
203 AccessibilityHostMsg_EventParams event_msg; | 203 AccessibilityHostMsg_EventParams event_msg; |
204 event_msg.event_type = event.event_type; | 204 event_msg.event_type = event.event_type; |
205 event_msg.id = event.id; | 205 event_msg.id = event.id; |
206 serializer_.SerializeChanges(obj, &event_msg.update); | 206 serializer_.SerializeChanges(obj, &event_msg.update); |
207 event_msgs.push_back(event_msg); | 207 event_msgs.push_back(event_msg); |
208 | 208 |
209 #ifndef NDEBUG | 209 #ifndef NDEBUG |
210 ui::AXTree tree; | |
211 tree.Unserialize(event_msg.update); | |
212 VLOG(0) << "Accessibility update: \n" | 210 VLOG(0) << "Accessibility update: \n" |
213 << "routing id=" << routing_id() | 211 << "routing id=" << routing_id() |
214 << " event=" | 212 << " event=" |
215 << AccessibilityEventToString(event.event_type) | 213 << AccessibilityEventToString(event.event_type) |
216 << "\n" << tree.ToString(); | 214 << "\n" << event_msg.update.ToString(); |
217 #endif | 215 #endif |
218 } | 216 } |
219 | 217 |
220 Send(new AccessibilityHostMsg_Events(routing_id(), event_msgs)); | 218 Send(new AccessibilityHostMsg_Events(routing_id(), event_msgs)); |
221 | 219 |
222 SendLocationChanges(); | 220 SendLocationChanges(); |
223 } | 221 } |
224 | 222 |
225 void RendererAccessibilityComplete::SendLocationChanges() { | 223 void RendererAccessibilityComplete::SendLocationChanges() { |
226 std::vector<AccessibilityHostMsg_LocationChangeParams> messages; | 224 std::vector<AccessibilityHostMsg_LocationChangeParams> messages; |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 render_view()->GetWebView()->clearFocusedElement(); | 380 render_view()->GetWebView()->clearFocusedElement(); |
383 else | 381 else |
384 obj.setFocused(true); | 382 obj.setFocused(true); |
385 } | 383 } |
386 | 384 |
387 void RendererAccessibilityComplete::OnFatalError() { | 385 void RendererAccessibilityComplete::OnFatalError() { |
388 CHECK(false) << "Invalid accessibility tree."; | 386 CHECK(false) << "Invalid accessibility tree."; |
389 } | 387 } |
390 | 388 |
391 } // namespace content | 389 } // namespace content |
OLD | NEW |