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/browser/accessibility/browser_accessibility_manager.h" | 5 #include "content/browser/accessibility/browser_accessibility_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 find_in_page_info_.start_offset = start_offset; | 443 find_in_page_info_.start_offset = start_offset; |
444 find_in_page_info_.end_id = end_id; | 444 find_in_page_info_.end_id = end_id; |
445 find_in_page_info_.end_offset = end_offset; | 445 find_in_page_info_.end_offset = end_offset; |
446 | 446 |
447 if (find_in_page_info_.active_request_id == request_id) | 447 if (find_in_page_info_.active_request_id == request_id) |
448 ActivateFindInPageResult(request_id); | 448 ActivateFindInPageResult(request_id); |
449 } | 449 } |
450 | 450 |
451 void BrowserAccessibilityManager::OnChildFrameHitTestResult( | 451 void BrowserAccessibilityManager::OnChildFrameHitTestResult( |
452 const gfx::Point& point, | 452 const gfx::Point& point, |
453 int hit_obj_id) { | 453 int hit_obj_id, |
| 454 ui::AXEvent event_to_fire) { |
454 BrowserAccessibility* obj = GetFromID(hit_obj_id); | 455 BrowserAccessibility* obj = GetFromID(hit_obj_id); |
455 if (!obj || !obj->HasIntAttribute(ui::AX_ATTR_CHILD_TREE_ID)) | 456 if (!obj || !obj->HasIntAttribute(ui::AX_ATTR_CHILD_TREE_ID)) |
456 return; | 457 return; |
457 | 458 |
458 BrowserAccessibilityManager* child_manager = | 459 BrowserAccessibilityManager* child_manager = |
459 BrowserAccessibilityManager::FromID( | 460 BrowserAccessibilityManager::FromID( |
460 obj->GetIntAttribute(ui::AX_ATTR_CHILD_TREE_ID)); | 461 obj->GetIntAttribute(ui::AX_ATTR_CHILD_TREE_ID)); |
461 if (!child_manager || !child_manager->delegate()) | 462 if (!child_manager || !child_manager->delegate()) |
462 return; | 463 return; |
463 | 464 |
464 ui::AXActionData action_data; | 465 ui::AXActionData action_data; |
465 action_data.target_point = point; | 466 action_data.target_point = point; |
466 action_data.action = ui::AX_ACTION_HIT_TEST; | 467 action_data.action = ui::AX_ACTION_HIT_TEST; |
| 468 action_data.hit_test_event_to_fire = event_to_fire; |
467 return child_manager->delegate()->AccessibilityPerformAction(action_data); | 469 return child_manager->delegate()->AccessibilityPerformAction(action_data); |
468 } | 470 } |
469 | 471 |
470 void BrowserAccessibilityManager::ActivateFindInPageResult( | 472 void BrowserAccessibilityManager::ActivateFindInPageResult( |
471 int request_id) { | 473 int request_id) { |
472 find_in_page_info_.active_request_id = request_id; | 474 find_in_page_info_.active_request_id = request_id; |
473 if (find_in_page_info_.request_id != request_id) | 475 if (find_in_page_info_.request_id != request_id) |
474 return; | 476 return; |
475 | 477 |
476 BrowserAccessibility* node = GetFromID(find_in_page_info_.start_id); | 478 BrowserAccessibility* node = GetFromID(find_in_page_info_.start_id); |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 delegate_->AccessibilityPerformAction(action_data); | 716 delegate_->AccessibilityPerformAction(action_data); |
715 } | 717 } |
716 | 718 |
717 void BrowserAccessibilityManager::HitTest(const gfx::Point& point) { | 719 void BrowserAccessibilityManager::HitTest(const gfx::Point& point) { |
718 if (!delegate_) | 720 if (!delegate_) |
719 return; | 721 return; |
720 | 722 |
721 ui::AXActionData action_data; | 723 ui::AXActionData action_data; |
722 action_data.action = ui::AX_ACTION_HIT_TEST; | 724 action_data.action = ui::AX_ACTION_HIT_TEST; |
723 action_data.target_point = point; | 725 action_data.target_point = point; |
| 726 action_data.hit_test_event_to_fire = ui::AX_EVENT_HOVER; |
724 delegate_->AccessibilityPerformAction(action_data); | 727 delegate_->AccessibilityPerformAction(action_data); |
725 } | 728 } |
726 | 729 |
727 gfx::Rect BrowserAccessibilityManager::GetViewBounds() { | 730 gfx::Rect BrowserAccessibilityManager::GetViewBounds() { |
728 BrowserAccessibilityDelegate* delegate = GetDelegateFromRootManager(); | 731 BrowserAccessibilityDelegate* delegate = GetDelegateFromRootManager(); |
729 if (delegate) | 732 if (delegate) |
730 return delegate->AccessibilityGetViewBounds(); | 733 return delegate->AccessibilityGetViewBounds(); |
731 return gfx::Rect(); | 734 return gfx::Rect(); |
732 } | 735 } |
733 | 736 |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1244 hit_test_result = parent; | 1247 hit_test_result = parent; |
1245 parent = parent->GetParent(); | 1248 parent = parent->GetParent(); |
1246 } | 1249 } |
1247 | 1250 |
1248 last_hover_ax_tree_id_ = hit_test_result->manager()->ax_tree_id(); | 1251 last_hover_ax_tree_id_ = hit_test_result->manager()->ax_tree_id(); |
1249 last_hover_node_id_ = hit_test_result->GetId(); | 1252 last_hover_node_id_ = hit_test_result->GetId(); |
1250 last_hover_bounds_ = hit_test_result->GetScreenBoundsRect(); | 1253 last_hover_bounds_ = hit_test_result->GetScreenBoundsRect(); |
1251 } | 1254 } |
1252 | 1255 |
1253 } // namespace content | 1256 } // namespace content |
OLD | NEW |