| 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 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 data.focus_id = node->GetId(); | 575 data.focus_id = node->GetId(); |
| 576 tree_->UpdateData(data); | 576 tree_->UpdateData(data); |
| 577 } | 577 } |
| 578 | 578 |
| 579 // static | 579 // static |
| 580 void BrowserAccessibilityManager::SetFocusChangeCallbackForTesting( | 580 void BrowserAccessibilityManager::SetFocusChangeCallbackForTesting( |
| 581 const base::Closure& callback) { | 581 const base::Closure& callback) { |
| 582 g_focus_change_callback_for_testing.Get() = callback; | 582 g_focus_change_callback_for_testing.Get() = callback; |
| 583 } | 583 } |
| 584 | 584 |
| 585 void BrowserAccessibilityManager::Decrement( |
| 586 const BrowserAccessibility& node) { |
| 587 if (!delegate_) |
| 588 return; |
| 589 |
| 590 ui::AXActionData action_data; |
| 591 action_data.action = ui::AX_ACTION_DECREMENT; |
| 592 action_data.target_node_id = node.GetId(); |
| 593 delegate_->AccessibilityPerformAction(action_data); |
| 594 } |
| 595 |
| 585 void BrowserAccessibilityManager::DoDefaultAction( | 596 void BrowserAccessibilityManager::DoDefaultAction( |
| 586 const BrowserAccessibility& node) { | 597 const BrowserAccessibility& node) { |
| 587 if (!delegate_) | 598 if (!delegate_) |
| 588 return; | 599 return; |
| 589 | 600 |
| 590 ui::AXActionData action_data; | 601 ui::AXActionData action_data; |
| 591 action_data.action = ui::AX_ACTION_DO_DEFAULT; | 602 action_data.action = ui::AX_ACTION_DO_DEFAULT; |
| 592 action_data.target_node_id = node.GetId(); | 603 action_data.target_node_id = node.GetId(); |
| 593 delegate_->AccessibilityPerformAction(action_data); | 604 delegate_->AccessibilityPerformAction(action_data); |
| 594 } | 605 } |
| 595 | 606 |
| 607 void BrowserAccessibilityManager::Increment( |
| 608 const BrowserAccessibility& node) { |
| 609 if (!delegate_) |
| 610 return; |
| 611 |
| 612 ui::AXActionData action_data; |
| 613 action_data.action = ui::AX_ACTION_INCREMENT; |
| 614 action_data.target_node_id = node.GetId(); |
| 615 delegate_->AccessibilityPerformAction(action_data); |
| 616 } |
| 617 |
| 596 void BrowserAccessibilityManager::ShowContextMenu( | 618 void BrowserAccessibilityManager::ShowContextMenu( |
| 597 const BrowserAccessibility& node) { | 619 const BrowserAccessibility& node) { |
| 598 if (!delegate_) | 620 if (!delegate_) |
| 599 return; | 621 return; |
| 600 | 622 |
| 601 ui::AXActionData action_data; | 623 ui::AXActionData action_data; |
| 602 action_data.action = ui::AX_ACTION_SHOW_CONTEXT_MENU; | 624 action_data.action = ui::AX_ACTION_SHOW_CONTEXT_MENU; |
| 603 action_data.target_node_id = node.GetId(); | 625 action_data.target_node_id = node.GetId(); |
| 604 delegate_->AccessibilityPerformAction(action_data); | 626 delegate_->AccessibilityPerformAction(action_data); |
| 605 } | 627 } |
| (...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1210 hit_test_result = parent; | 1232 hit_test_result = parent; |
| 1211 parent = parent->GetParent(); | 1233 parent = parent->GetParent(); |
| 1212 } | 1234 } |
| 1213 | 1235 |
| 1214 last_hover_ax_tree_id_ = hit_test_result->manager()->ax_tree_id(); | 1236 last_hover_ax_tree_id_ = hit_test_result->manager()->ax_tree_id(); |
| 1215 last_hover_node_id_ = hit_test_result->GetId(); | 1237 last_hover_node_id_ = hit_test_result->GetId(); |
| 1216 last_hover_bounds_ = hit_test_result->GetScreenBoundsRect(); | 1238 last_hover_bounds_ = hit_test_result->GetScreenBoundsRect(); |
| 1217 } | 1239 } |
| 1218 | 1240 |
| 1219 } // namespace content | 1241 } // namespace content |
| OLD | NEW |