| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <queue> | 10 #include <queue> |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 // will update it. | 192 // will update it. |
| 193 // TODO(dmazzoni): remove this as soon as | 193 // TODO(dmazzoni): remove this as soon as |
| 194 // https://bugs.webkit.org/show_bug.cgi?id=73460 is fixed. | 194 // https://bugs.webkit.org/show_bug.cgi?id=73460 is fixed. |
| 195 last_scroll_offset_ = scroll_offset; | 195 last_scroll_offset_ = scroll_offset; |
| 196 if (!obj.equals(document.accessibilityObject())) { | 196 if (!obj.equals(document.accessibilityObject())) { |
| 197 HandleAXEvent(document.accessibilityObject(), | 197 HandleAXEvent(document.accessibilityObject(), |
| 198 ui::AX_EVENT_LAYOUT_COMPLETE); | 198 ui::AX_EVENT_LAYOUT_COMPLETE); |
| 199 } | 199 } |
| 200 } | 200 } |
| 201 | 201 |
| 202 #if defined(OS_ANDROID) |
| 203 // Force the newly focused node to be re-serialized so we include its |
| 204 // inline text boxes. |
| 205 if (event == ui::AX_EVENT_FOCUS) |
| 206 serializer_.DeleteClientSubtree(obj); |
| 207 #endif |
| 208 |
| 202 // Add the accessibility object to our cache and ensure it's valid. | 209 // Add the accessibility object to our cache and ensure it's valid. |
| 203 AccessibilityHostMsg_EventParams acc_event; | 210 AccessibilityHostMsg_EventParams acc_event; |
| 204 acc_event.id = obj.axID(); | 211 acc_event.id = obj.axID(); |
| 205 acc_event.event_type = event; | 212 acc_event.event_type = event; |
| 206 | 213 |
| 207 // Discard duplicate accessibility events. | 214 // Discard duplicate accessibility events. |
| 208 for (uint32_t i = 0; i < pending_events_.size(); ++i) { | 215 for (uint32_t i = 0; i < pending_events_.size(); ++i) { |
| 209 if (pending_events_[i].id == acc_event.id && | 216 if (pending_events_[i].id == acc_event.id && |
| 210 pending_events_[i].event_type == acc_event.event_type) { | 217 pending_events_[i].event_type == acc_event.event_type) { |
| 211 return; | 218 return; |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 #ifndef NDEBUG | 602 #ifndef NDEBUG |
| 596 LOG(WARNING) << "ShowContextMenu on invalid object id " << acc_obj_id; | 603 LOG(WARNING) << "ShowContextMenu on invalid object id " << acc_obj_id; |
| 597 #endif | 604 #endif |
| 598 return; | 605 return; |
| 599 } | 606 } |
| 600 | 607 |
| 601 obj.showContextMenu(); | 608 obj.showContextMenu(); |
| 602 } | 609 } |
| 603 | 610 |
| 604 } // namespace content | 611 } // namespace content |
| OLD | NEW |