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> |
| 8 #include <stdint.h> |
| 9 |
7 #include <queue> | 10 #include <queue> |
8 | 11 |
9 #include "base/bind.h" | 12 #include "base/bind.h" |
10 #include "base/location.h" | 13 #include "base/location.h" |
11 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
12 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
13 #include "base/thread_task_runner_handle.h" | 16 #include "base/thread_task_runner_handle.h" |
| 17 #include "build/build_config.h" |
14 #include "content/common/accessibility_messages.h" | 18 #include "content/common/accessibility_messages.h" |
15 #include "content/renderer/accessibility/blink_ax_enum_conversion.h" | 19 #include "content/renderer/accessibility/blink_ax_enum_conversion.h" |
16 #include "content/renderer/render_frame_impl.h" | 20 #include "content/renderer/render_frame_impl.h" |
17 #include "content/renderer/render_view_impl.h" | 21 #include "content/renderer/render_view_impl.h" |
18 #include "third_party/WebKit/public/web/WebAXObject.h" | 22 #include "third_party/WebKit/public/web/WebAXObject.h" |
19 #include "third_party/WebKit/public/web/WebDocument.h" | 23 #include "third_party/WebKit/public/web/WebDocument.h" |
20 #include "third_party/WebKit/public/web/WebInputElement.h" | 24 #include "third_party/WebKit/public/web/WebInputElement.h" |
21 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 25 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
22 #include "third_party/WebKit/public/web/WebSettings.h" | 26 #include "third_party/WebKit/public/web/WebSettings.h" |
23 #include "third_party/WebKit/public/web/WebView.h" | 27 #include "third_party/WebKit/public/web/WebView.h" |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 ui::AX_EVENT_LAYOUT_COMPLETE); | 189 ui::AX_EVENT_LAYOUT_COMPLETE); |
186 } | 190 } |
187 } | 191 } |
188 | 192 |
189 // Add the accessibility object to our cache and ensure it's valid. | 193 // Add the accessibility object to our cache and ensure it's valid. |
190 AccessibilityHostMsg_EventParams acc_event; | 194 AccessibilityHostMsg_EventParams acc_event; |
191 acc_event.id = obj.axID(); | 195 acc_event.id = obj.axID(); |
192 acc_event.event_type = event; | 196 acc_event.event_type = event; |
193 | 197 |
194 // Discard duplicate accessibility events. | 198 // Discard duplicate accessibility events. |
195 for (uint32 i = 0; i < pending_events_.size(); ++i) { | 199 for (uint32_t i = 0; i < pending_events_.size(); ++i) { |
196 if (pending_events_[i].id == acc_event.id && | 200 if (pending_events_[i].id == acc_event.id && |
197 pending_events_[i].event_type == acc_event.event_type) { | 201 pending_events_[i].event_type == acc_event.event_type) { |
198 return; | 202 return; |
199 } | 203 } |
200 } | 204 } |
201 pending_events_.push_back(acc_event); | 205 pending_events_.push_back(acc_event); |
202 | 206 |
203 if (!ack_pending_ && !weak_factory_.HasWeakPtrs()) { | 207 if (!ack_pending_ && !weak_factory_.HasWeakPtrs()) { |
204 // When no accessibility events are in-flight post a task to send | 208 // When no accessibility events are in-flight post a task to send |
205 // the events to the browser. We use PostTask so that we can queue | 209 // the events to the browser. We use PostTask so that we can queue |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 #ifndef NDEBUG | 564 #ifndef NDEBUG |
561 LOG(WARNING) << "ShowContextMenu on invalid object id " << acc_obj_id; | 565 LOG(WARNING) << "ShowContextMenu on invalid object id " << acc_obj_id; |
562 #endif | 566 #endif |
563 return; | 567 return; |
564 } | 568 } |
565 | 569 |
566 obj.showContextMenu(); | 570 obj.showContextMenu(); |
567 } | 571 } |
568 | 572 |
569 } // namespace content | 573 } // namespace content |
OLD | NEW |