Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Side by Side Diff: content/browser/accessibility/browser_accessibility_manager.cc

Issue 2748463003: Generalize the HIT_TEST accessibility action so that it can send any event. (Closed)
Patch Set: Use ParseAXEvent Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 find_in_page_info_.start_offset = start_offset; 451 find_in_page_info_.start_offset = start_offset;
452 find_in_page_info_.end_id = end_id; 452 find_in_page_info_.end_id = end_id;
453 find_in_page_info_.end_offset = end_offset; 453 find_in_page_info_.end_offset = end_offset;
454 454
455 if (find_in_page_info_.active_request_id == request_id) 455 if (find_in_page_info_.active_request_id == request_id)
456 ActivateFindInPageResult(request_id); 456 ActivateFindInPageResult(request_id);
457 } 457 }
458 458
459 void BrowserAccessibilityManager::OnChildFrameHitTestResult( 459 void BrowserAccessibilityManager::OnChildFrameHitTestResult(
460 const gfx::Point& point, 460 const gfx::Point& point,
461 int hit_obj_id) { 461 int hit_obj_id,
462 ui::AXEvent event_to_fire) {
462 BrowserAccessibility* obj = GetFromID(hit_obj_id); 463 BrowserAccessibility* obj = GetFromID(hit_obj_id);
463 if (!obj || !obj->HasIntAttribute(ui::AX_ATTR_CHILD_TREE_ID)) 464 if (!obj || !obj->HasIntAttribute(ui::AX_ATTR_CHILD_TREE_ID))
464 return; 465 return;
465 466
466 BrowserAccessibilityManager* child_manager = 467 BrowserAccessibilityManager* child_manager =
467 BrowserAccessibilityManager::FromID( 468 BrowserAccessibilityManager::FromID(
468 obj->GetIntAttribute(ui::AX_ATTR_CHILD_TREE_ID)); 469 obj->GetIntAttribute(ui::AX_ATTR_CHILD_TREE_ID));
469 if (!child_manager || !child_manager->delegate()) 470 if (!child_manager || !child_manager->delegate())
470 return; 471 return;
471 472
472 ui::AXActionData action_data; 473 ui::AXActionData action_data;
473 action_data.target_point = point; 474 action_data.target_point = point;
474 action_data.action = ui::AX_ACTION_HIT_TEST; 475 action_data.action = ui::AX_ACTION_HIT_TEST;
476 action_data.hit_test_event_to_fire = event_to_fire;
475 return child_manager->delegate()->AccessibilityPerformAction(action_data); 477 return child_manager->delegate()->AccessibilityPerformAction(action_data);
476 } 478 }
477 479
478 void BrowserAccessibilityManager::ActivateFindInPageResult( 480 void BrowserAccessibilityManager::ActivateFindInPageResult(
479 int request_id) { 481 int request_id) {
480 find_in_page_info_.active_request_id = request_id; 482 find_in_page_info_.active_request_id = request_id;
481 if (find_in_page_info_.request_id != request_id) 483 if (find_in_page_info_.request_id != request_id)
482 return; 484 return;
483 485
484 BrowserAccessibility* node = GetFromID(find_in_page_info_.start_id); 486 BrowserAccessibility* node = GetFromID(find_in_page_info_.start_id);
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 delegate_->AccessibilityPerformAction(action_data); 724 delegate_->AccessibilityPerformAction(action_data);
723 } 725 }
724 726
725 void BrowserAccessibilityManager::HitTest(const gfx::Point& point) { 727 void BrowserAccessibilityManager::HitTest(const gfx::Point& point) {
726 if (!delegate_) 728 if (!delegate_)
727 return; 729 return;
728 730
729 ui::AXActionData action_data; 731 ui::AXActionData action_data;
730 action_data.action = ui::AX_ACTION_HIT_TEST; 732 action_data.action = ui::AX_ACTION_HIT_TEST;
731 action_data.target_point = point; 733 action_data.target_point = point;
734 action_data.hit_test_event_to_fire = ui::AX_EVENT_HOVER;
732 delegate_->AccessibilityPerformAction(action_data); 735 delegate_->AccessibilityPerformAction(action_data);
733 } 736 }
734 737
735 gfx::Rect BrowserAccessibilityManager::GetViewBounds() { 738 gfx::Rect BrowserAccessibilityManager::GetViewBounds() {
736 BrowserAccessibilityDelegate* delegate = GetDelegateFromRootManager(); 739 BrowserAccessibilityDelegate* delegate = GetDelegateFromRootManager();
737 if (delegate) 740 if (delegate)
738 return delegate->AccessibilityGetViewBounds(); 741 return delegate->AccessibilityGetViewBounds();
739 return gfx::Rect(); 742 return gfx::Rect();
740 } 743 }
741 744
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
1258 hit_test_result = parent; 1261 hit_test_result = parent;
1259 parent = parent->GetParent(); 1262 parent = parent->GetParent();
1260 } 1263 }
1261 1264
1262 last_hover_ax_tree_id_ = hit_test_result->manager()->ax_tree_id(); 1265 last_hover_ax_tree_id_ = hit_test_result->manager()->ax_tree_id();
1263 last_hover_node_id_ = hit_test_result->GetId(); 1266 last_hover_node_id_ = hit_test_result->GetId();
1264 last_hover_bounds_ = hit_test_result->GetScreenBoundsRect(); 1267 last_hover_bounds_ = hit_test_result->GetScreenBoundsRect();
1265 } 1268 }
1266 1269
1267 } // namespace content 1270 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698