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

Unified Diff: content/browser/accessibility/browser_accessibility_manager.cc

Issue 2692173003: Implemented SetSelection for the Web content on Windows. (Closed)
Patch Set: Fixed another compilation error on Windows. Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/accessibility/browser_accessibility_manager.cc
diff --git a/content/browser/accessibility/browser_accessibility_manager.cc b/content/browser/accessibility/browser_accessibility_manager.cc
index 15e4bd22f23fab3640189a5a700969005ac26524..ad4e430ae24986c88c711555a394cc8c664da0e8 100644
--- a/content/browser/accessibility/browser_accessibility_manager.cc
+++ b/content/browser/accessibility/browser_accessibility_manager.cc
@@ -688,18 +688,15 @@ void BrowserAccessibilityManager::SetValue(
delegate_->AccessibilityPerformAction(action_data);
}
-void BrowserAccessibilityManager::SetTextSelection(
- const BrowserAccessibility& node,
- int start_offset,
- int end_offset) {
- if (!delegate_)
+void BrowserAccessibilityManager::SetSelection(AXPlatformRange range) {
+ if (!delegate_ || range.IsNull())
return;
ui::AXActionData action_data;
- action_data.anchor_node_id = node.GetId();
- action_data.anchor_offset = start_offset;
- action_data.focus_node_id = node.GetId();
- action_data.focus_offset = end_offset;
+ action_data.anchor_node_id = range.anchor()->anchor_id();
+ action_data.anchor_offset = range.anchor()->text_offset();
+ action_data.focus_node_id = range.focus()->anchor_id();
+ action_data.focus_offset = range.focus()->text_offset();
action_data.action = ui::AX_ACTION_SET_SELECTION;
delegate_->AccessibilityPerformAction(action_data);
}

Powered by Google App Engine
This is Rietveld 408576698