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.h" | 5 #include "content/renderer/accessibility/renderer_accessibility.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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 // If it's ignored, find the first ancestor that's not ignored. | 228 // If it's ignored, find the first ancestor that's not ignored. |
229 while (!obj.isDetached() && obj.accessibilityIsIgnored()) | 229 while (!obj.isDetached() && obj.accessibilityIsIgnored()) |
230 obj = obj.parentObject(); | 230 obj = obj.parentObject(); |
231 | 231 |
232 // Make sure it's a descendant of our root node - exceptions include the | 232 // Make sure it's a descendant of our root node - exceptions include the |
233 // scroll area that's the parent of the main document (we ignore it), and | 233 // scroll area that's the parent of the main document (we ignore it), and |
234 // possibly nodes attached to a different document. | 234 // possibly nodes attached to a different document. |
235 if (!tree_source_.IsInTree(obj)) | 235 if (!tree_source_.IsInTree(obj)) |
236 continue; | 236 continue; |
237 | 237 |
238 // When we get a "selected children changed" event, Blink | |
239 // doesn't also send us events for each child that changed | |
240 // selection state, so make sure we re-send that whole subtree. | |
241 if (event.event_type == ui::AX_EVENT_SELECTED_CHILDREN_CHANGED) { | |
242 serializer_.DeleteClientSubtree(obj); | |
243 } | |
244 | |
245 AccessibilityHostMsg_EventParams event_msg; | 238 AccessibilityHostMsg_EventParams event_msg; |
246 tree_source_.CollectChildFrameIdMapping( | 239 tree_source_.CollectChildFrameIdMapping( |
247 &event_msg.node_to_frame_routing_id_map, | 240 &event_msg.node_to_frame_routing_id_map, |
248 &event_msg.node_to_browser_plugin_instance_id_map); | 241 &event_msg.node_to_browser_plugin_instance_id_map); |
249 event_msg.event_type = event.event_type; | 242 event_msg.event_type = event.event_type; |
250 event_msg.id = event.id; | 243 event_msg.id = event.id; |
251 serializer_.SerializeChanges(obj, &event_msg.update); | 244 serializer_.SerializeChanges(obj, &event_msg.update); |
252 event_msgs.push_back(event_msg); | 245 event_msgs.push_back(event_msg); |
253 | 246 |
254 // For each node in the update, set the location in our map from | 247 // For each node in the update, set the location in our map from |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 LOG(WARNING) << "SetTextSelection on invalid object id " << acc_obj_id; | 479 LOG(WARNING) << "SetTextSelection on invalid object id " << acc_obj_id; |
487 #endif | 480 #endif |
488 return; | 481 return; |
489 } | 482 } |
490 | 483 |
491 obj.setValue(value); | 484 obj.setValue(value); |
492 HandleAXEvent(obj, ui::AX_EVENT_VALUE_CHANGED); | 485 HandleAXEvent(obj, ui::AX_EVENT_VALUE_CHANGED); |
493 } | 486 } |
494 | 487 |
495 } // namespace content | 488 } // namespace content |
OLD | NEW |