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 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 if (!delegate_) | 681 if (!delegate_) |
682 return; | 682 return; |
683 | 683 |
684 ui::AXActionData action_data; | 684 ui::AXActionData action_data; |
685 action_data.target_node_id = node.GetId(); | 685 action_data.target_node_id = node.GetId(); |
686 action_data.action = ui::AX_ACTION_SET_VALUE; | 686 action_data.action = ui::AX_ACTION_SET_VALUE; |
687 action_data.value = value; | 687 action_data.value = value; |
688 delegate_->AccessibilityPerformAction(action_data); | 688 delegate_->AccessibilityPerformAction(action_data); |
689 } | 689 } |
690 | 690 |
691 void BrowserAccessibilityManager::SetTextSelection( | 691 void BrowserAccessibilityManager::SetSelection(AXPlatformRange range) { |
692 const BrowserAccessibility& node, | 692 if (!delegate_ || range.IsNull()) |
693 int start_offset, | |
694 int end_offset) { | |
695 if (!delegate_) | |
696 return; | 693 return; |
697 | 694 |
698 ui::AXActionData action_data; | 695 ui::AXActionData action_data; |
699 action_data.anchor_node_id = node.GetId(); | 696 action_data.anchor_node_id = range.anchor()->anchor_id(); |
700 action_data.anchor_offset = start_offset; | 697 action_data.anchor_offset = range.anchor()->text_offset(); |
701 action_data.focus_node_id = node.GetId(); | 698 action_data.focus_node_id = range.focus()->anchor_id(); |
702 action_data.focus_offset = end_offset; | 699 action_data.focus_offset = range.focus()->text_offset(); |
703 action_data.action = ui::AX_ACTION_SET_SELECTION; | 700 action_data.action = ui::AX_ACTION_SET_SELECTION; |
704 delegate_->AccessibilityPerformAction(action_data); | 701 delegate_->AccessibilityPerformAction(action_data); |
705 } | 702 } |
706 | 703 |
707 void BrowserAccessibilityManager::SetAccessibilityFocus( | 704 void BrowserAccessibilityManager::SetAccessibilityFocus( |
708 const BrowserAccessibility& node) { | 705 const BrowserAccessibility& node) { |
709 if (!delegate_) | 706 if (!delegate_) |
710 return; | 707 return; |
711 | 708 |
712 ui::AXActionData action_data; | 709 ui::AXActionData action_data; |
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1245 hit_test_result = parent; | 1242 hit_test_result = parent; |
1246 parent = parent->GetParent(); | 1243 parent = parent->GetParent(); |
1247 } | 1244 } |
1248 | 1245 |
1249 last_hover_ax_tree_id_ = hit_test_result->manager()->ax_tree_id(); | 1246 last_hover_ax_tree_id_ = hit_test_result->manager()->ax_tree_id(); |
1250 last_hover_node_id_ = hit_test_result->GetId(); | 1247 last_hover_node_id_ = hit_test_result->GetId(); |
1251 last_hover_bounds_ = hit_test_result->GetScreenBoundsRect(); | 1248 last_hover_bounds_ = hit_test_result->GetScreenBoundsRect(); |
1252 } | 1249 } |
1253 | 1250 |
1254 } // namespace content | 1251 } // namespace content |
OLD | NEW |