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

Unified Diff: ui/views/accessibility/native_view_accessibility.cc

Issue 2341633006: MacViews/a11y: Allow accessibility clients to update the selected text. (Closed)
Patch Set: Move accessibility notification for text selection being changed to SelectRange() instead. Created 4 years, 3 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: ui/views/accessibility/native_view_accessibility.cc
diff --git a/ui/views/accessibility/native_view_accessibility.cc b/ui/views/accessibility/native_view_accessibility.cc
index 7b99429621ffa659c73ed2cb7226127133eb06d3..8b649dd5ecdd3d219a7c89d5fc3b9f90b9ba7dc3 100644
--- a/ui/views/accessibility/native_view_accessibility.cc
+++ b/ui/views/accessibility/native_view_accessibility.cc
@@ -224,6 +224,17 @@ bool NativeViewAccessibility::CanSetStringValue() {
!state.set_value_callback.is_null();
}
+bool NativeViewAccessibility::ReplaceSelectedText(
+ const base::string16& selection_replacement) {
+ if (!CanSetStringValue())
+ return false;
+
+ ui::AXViewState state;
+ view_->GetAccessibleState(&state);
+ state.replace_selection_callback.Run(selection_replacement);
+ return true;
+}
tapted 2016/09/27 07:16:30 the `bool` arg would make it easier to share code
Patti Lor 2016/10/20 04:19:34 Done.
+
void NativeViewAccessibility::OnWidgetDestroying(Widget* widget) {
if (parent_widget_ == widget) {
parent_widget_->RemoveObserver(this);

Powered by Google App Engine
This is Rietveld 408576698