| 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/render_accessibility_impl.h" | 5 #include "content/renderer/accessibility/render_accessibility_impl.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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 event_msgs.push_back(event_msg); | 420 event_msgs.push_back(event_msg); |
| 421 | 421 |
| 422 // For each node in the update, set the location in our map from | 422 // For each node in the update, set the location in our map from |
| 423 // ids to locations. | 423 // ids to locations. |
| 424 for (size_t i = 0; i < event_msg.update.nodes.size(); ++i) { | 424 for (size_t i = 0; i < event_msg.update.nodes.size(); ++i) { |
| 425 ui::AXNodeData& src = event_msg.update.nodes[i]; | 425 ui::AXNodeData& src = event_msg.update.nodes[i]; |
| 426 ui::AXRelativeBounds& dst = locations_[event_msg.update.nodes[i].id]; | 426 ui::AXRelativeBounds& dst = locations_[event_msg.update.nodes[i].id]; |
| 427 dst.offset_container_id = src.offset_container_id; | 427 dst.offset_container_id = src.offset_container_id; |
| 428 dst.bounds = src.location; | 428 dst.bounds = src.location; |
| 429 dst.transform.reset(nullptr); | 429 dst.transform.reset(nullptr); |
| 430 dst.is_fixed_positioned = src.is_fixed_positioned; |
| 430 if (src.transform) | 431 if (src.transform) |
| 431 dst.transform.reset(new gfx::Transform(*src.transform)); | 432 dst.transform.reset(new gfx::Transform(*src.transform)); |
| 432 } | 433 } |
| 433 | 434 |
| 434 VLOG(1) << "Accessibility event: " << ui::ToString(event.event_type) | 435 VLOG(1) << "Accessibility event: " << ui::ToString(event.event_type) |
| 435 << " on node id " << event_msg.id | 436 << " on node id " << event_msg.id |
| 436 << "\n" << event_msg.update.ToString(); | 437 << "\n" << event_msg.update.ToString(); |
| 437 } | 438 } |
| 438 | 439 |
| 439 Send(new AccessibilityHostMsg_Events(routing_id(), event_msgs, reset_token_, | 440 Send(new AccessibilityHostMsg_Events(routing_id(), event_msgs, reset_token_, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 467 // be new, so don't continue to explore this branch. | 468 // be new, so don't continue to explore this branch. |
| 468 int id = obj.AxID(); | 469 int id = obj.AxID(); |
| 469 auto iter = locations_.find(id); | 470 auto iter = locations_.find(id); |
| 470 if (iter == locations_.end()) | 471 if (iter == locations_.end()) |
| 471 continue; | 472 continue; |
| 472 | 473 |
| 473 // If the location has changed, append it to the IPC message. | 474 // If the location has changed, append it to the IPC message. |
| 474 WebAXObject offset_container; | 475 WebAXObject offset_container; |
| 475 WebFloatRect bounds_in_container; | 476 WebFloatRect bounds_in_container; |
| 476 SkMatrix44 container_transform; | 477 SkMatrix44 container_transform; |
| 478 bool is_fixed_positioned; |
| 477 obj.GetRelativeBounds(offset_container, bounds_in_container, | 479 obj.GetRelativeBounds(offset_container, bounds_in_container, |
| 478 container_transform); | 480 container_transform, is_fixed_positioned); |
| 479 ui::AXRelativeBounds new_location; | 481 ui::AXRelativeBounds new_location; |
| 480 new_location.offset_container_id = offset_container.AxID(); | 482 new_location.offset_container_id = offset_container.AxID(); |
| 481 new_location.bounds = bounds_in_container; | 483 new_location.bounds = bounds_in_container; |
| 484 new_location.is_fixed_positioned = is_fixed_positioned; |
| 482 if (!container_transform.isIdentity()) | 485 if (!container_transform.isIdentity()) |
| 483 new_location.transform = base::WrapUnique( | 486 new_location.transform = base::WrapUnique( |
| 484 new gfx::Transform(container_transform)); | 487 new gfx::Transform(container_transform)); |
| 485 if (iter->second != new_location) { | 488 if (iter->second != new_location) { |
| 486 AccessibilityHostMsg_LocationChangeParams message; | 489 AccessibilityHostMsg_LocationChangeParams message; |
| 487 message.id = id; | 490 message.id = id; |
| 488 message.new_location = new_location; | 491 message.new_location = new_location; |
| 489 messages.push_back(message); | 492 messages.push_back(message); |
| 490 } | 493 } |
| 491 | 494 |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 | 733 |
| 731 const WebDocument& document = GetMainDocument(); | 734 const WebDocument& document = GetMainDocument(); |
| 732 if (document.IsNull()) | 735 if (document.IsNull()) |
| 733 return; | 736 return; |
| 734 | 737 |
| 735 WebAXObject::FromWebDocument(document).ScrollToMakeVisibleWithSubFocus( | 738 WebAXObject::FromWebDocument(document).ScrollToMakeVisibleWithSubFocus( |
| 736 WebRect(bounds.x(), bounds.y(), bounds.width(), bounds.height())); | 739 WebRect(bounds.x(), bounds.y(), bounds.width(), bounds.height())); |
| 737 } | 740 } |
| 738 | 741 |
| 739 } // namespace content | 742 } // namespace content |
| OLD | NEW |