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

Issue 2341633006: MacViews/a11y: Allow accessibility clients to update the selected text. (Closed)

Created:
4 years, 3 months ago by Patti Lor
Modified:
4 years, 1 month ago
Reviewers:
tapted, dmazzoni, msw
CC:
chromium-reviews, yusukes+watch_chromium.org, shuchen+watch_chromium.org, aboxhall+watch_chromium.org, tfarina, nektar+watch_chromium.org, yuzo+watch_chromium.org, nona+watch_chromium.org, je_julie, dmazzoni+watch_chromium.org, dtseng+watch_chromium.org, James Su, chrome-apps-syd-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

MacViews/a11y: Allow accessibility clients to update the selected text. Currently, the `selected text` a11y attribute of views::Textfields is reported as unmodifiable, which differs from native NSTextFields on Mac. Add a callback to views::Textfield and OmniboxViewViews to allow accessibility clients to replace the currently selected text, and plumb through for Mac. When no text is selected, new text is inserted at the current cursor position. This also fixes a problem where selection information provided to accessibility clients was incorrect for the Omnibox when it still had selected text, but focus was not on the window the Omnibox was currently attached to. BUG=610591 TEST=With #mac-views-webui-dialogs turned on in chrome:flags, open the XCode Accessibility Inspector and bring up the HTTP Authentication dialog. Type some text into the username Textfield, then select some text in it. Click on the Accessibility Inspector to move focus off the Chrome window and hover over the Omnibox with the mouse. The Accessibility Inspector should report the correct "accessibilitySelectedTextRange" and "accessibilitySelectedText" attributes. Then press Cmd+F7 to lock onto the Textfield, click on "accessibilitySelectedText" and enter a value at the bottom. The selected text in the Textfield should be replaced with the new string with no text selected. Committed: https://crrev.com/0aa1406119dc85097efebbb282895b543e4b0c26 Cr-Commit-Position: refs/heads/master@{#428645}

Patch Set 1 #

Patch Set 2 : Add to TestAXNodeWrapper. #

Patch Set 3 : Add to AuraLinuxApplication. #

Patch Set 4 : Put the cursor back at the end of the newly inserted string. #

Patch Set 5 : Move accessibility notification for text selection being changed to SelectRange() instead. #

Total comments: 26

Patch Set 6 : Review comments. #

Patch Set 7 : Fix other platforms. #

Patch Set 8 : Fix windows. #

Patch Set 9 : Delete unused method declarations and revert redundant a11y notification. #

Total comments: 15

Patch Set 10 : Review comments. #

Patch Set 11 : Rebase, fix OmniboxViewViews::AccessibilitySetValue. #

Total comments: 2

Patch Set 12 : Make set value callbacks not have a const bool |replace| arg. #

Total comments: 8

Patch Set 13 : Review comments. #

Total comments: 8

Patch Set 14 : Review comments (inc. using InsertOrReplaceText() for Omnibox). #

Patch Set 15 : Rebase. #

Total comments: 2

Patch Set 16 : Fix Windows. #

Total comments: 12

Patch Set 17 : Review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+119 lines, -29 lines) Patch
M chrome/browser/ui/views/omnibox/omnibox_view_views.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +5 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/omnibox/omnibox_view_views.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +23 lines, -3 lines 0 comments Download
M ui/accessibility/ax_view_state.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +5 lines, -2 lines 0 comments Download
M ui/accessibility/platform/ax_platform_node_delegate.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +8 lines, -3 lines 0 comments Download
M ui/accessibility/platform/ax_platform_node_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +9 lines, -6 lines 0 comments Download
M ui/accessibility/platform/ax_platform_node_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 0 comments Download
M ui/accessibility/platform/test_ax_node_wrapper.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -1 line 0 comments Download
M ui/accessibility/platform/test_ax_node_wrapper.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -1 line 0 comments Download
M ui/views/accessibility/native_view_accessibility.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -1 line 0 comments Download
M ui/views/accessibility/native_view_accessibility.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -2 lines 0 comments Download
M ui/views/accessibility/native_view_accessibility_auralinux.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -1 line 0 comments Download
M ui/views/controls/textfield/textfield.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +5 lines, -2 lines 0 comments Download
M ui/views/controls/textfield/textfield.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +8 lines, -4 lines 0 comments Download
M ui/views/widget/native_widget_mac_accessibility_unittest.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +44 lines, -0 lines 0 comments Download

Messages

Total messages: 107 (90 generated)
Patti Lor
Hi Trent, PTAL, thanks!
4 years, 2 months ago (2016-09-27 05:44:16 UTC) #22
tapted
https://codereview.chromium.org/2341633006/diff/80001/chrome/browser/ui/views/omnibox/omnibox_view_views.cc File chrome/browser/ui/views/omnibox/omnibox_view_views.cc (right): https://codereview.chromium.org/2341633006/diff/80001/chrome/browser/ui/views/omnibox/omnibox_view_views.cc#newcode427 chrome/browser/ui/views/omnibox/omnibox_view_views.cc:427: SelectRange(saved_selection_for_focus_change_); I don't think we need to select it ...
4 years, 2 months ago (2016-09-27 07:16:31 UTC) #23
Patti Lor
PTAL, thanks Trent! https://codereview.chromium.org/2341633006/diff/80001/chrome/browser/ui/views/omnibox/omnibox_view_views.cc File chrome/browser/ui/views/omnibox/omnibox_view_views.cc (right): https://codereview.chromium.org/2341633006/diff/80001/chrome/browser/ui/views/omnibox/omnibox_view_views.cc#newcode427 chrome/browser/ui/views/omnibox/omnibox_view_views.cc:427: SelectRange(saved_selection_for_focus_change_); On 2016/09/27 07:16:30, tapted wrote: ...
4 years, 2 months ago (2016-10-20 04:19:34 UTC) #40
tapted
https://codereview.chromium.org/2341633006/diff/80001/ui/views/widget/native_widget_mac_accessibility_unittest.mm File ui/views/widget/native_widget_mac_accessibility_unittest.mm (right): https://codereview.chromium.org/2341633006/diff/80001/ui/views/widget/native_widget_mac_accessibility_unittest.mm#newcode373 ui/views/widget/native_widget_mac_accessibility_unittest.mm:373: } On 2016/10/20 04:19:34, Patti Lor wrote: > On ...
4 years, 2 months ago (2016-10-20 05:54:59 UTC) #41
Patti Lor
PTAL, thanks! https://codereview.chromium.org/2341633006/diff/80001/ui/views/widget/native_widget_mac_accessibility_unittest.mm File ui/views/widget/native_widget_mac_accessibility_unittest.mm (right): https://codereview.chromium.org/2341633006/diff/80001/ui/views/widget/native_widget_mac_accessibility_unittest.mm#newcode373 ui/views/widget/native_widget_mac_accessibility_unittest.mm:373: } On 2016/10/20 05:54:58, tapted wrote: > ...
4 years, 1 month ago (2016-10-24 04:31:48 UTC) #61
tapted
lgtm with `const bool` -> bool https://codereview.chromium.org/2341633006/diff/160001/ui/accessibility/platform/ax_platform_node_mac.mm File ui/accessibility/platform/ax_platform_node_mac.mm (right): https://codereview.chromium.org/2341633006/diff/160001/ui/accessibility/platform/ax_platform_node_mac.mm#newcode398 ui/accessibility/platform/ax_platform_node_mac.mm:398: [value isKindOfClass:[NSString class]]) ...
4 years, 1 month ago (2016-10-24 06:11:57 UTC) #62
Patti Lor
dmazzoni@chromium.org: Please review changes in ui/views/accessibility/ ui/accessibility/ msw@chromium.org: Please review changes in ui/views/controls/textfield/ chrome/browser/ui/views/omnibox/ Thanks ...
4 years, 1 month ago (2016-10-25 04:25:19 UTC) #74
dmazzoni
https://codereview.chromium.org/2341633006/diff/280001/chrome/browser/ui/views/omnibox/omnibox_view_views.cc File chrome/browser/ui/views/omnibox/omnibox_view_views.cc (right): https://codereview.chromium.org/2341633006/diff/280001/chrome/browser/ui/views/omnibox/omnibox_view_views.cc#newcode425 chrome/browser/ui/views/omnibox/omnibox_view_views.cc:425: base::string16 new_string = This definitely looks wrong. You're declaring ...
4 years, 1 month ago (2016-10-25 17:21:49 UTC) #75
Patti Lor
Thanks for the review dmazzoni, PTAL! https://codereview.chromium.org/2341633006/diff/280001/chrome/browser/ui/views/omnibox/omnibox_view_views.cc File chrome/browser/ui/views/omnibox/omnibox_view_views.cc (right): https://codereview.chromium.org/2341633006/diff/280001/chrome/browser/ui/views/omnibox/omnibox_view_views.cc#newcode425 chrome/browser/ui/views/omnibox/omnibox_view_views.cc:425: base::string16 new_string = ...
4 years, 1 month ago (2016-10-26 00:57:15 UTC) #78
dmazzoni
lgtm https://codereview.chromium.org/2341633006/diff/300001/chrome/browser/ui/views/omnibox/omnibox_view_views.cc File chrome/browser/ui/views/omnibox/omnibox_view_views.cc (right): https://codereview.chromium.org/2341633006/diff/300001/chrome/browser/ui/views/omnibox/omnibox_view_views.cc#newcode428 chrome/browser/ui/views/omnibox/omnibox_view_views.cc:428: SetUserText(new_string, true); Could you use InsertOrReplaceText() when clear_first ...
4 years, 1 month ago (2016-10-26 04:26:02 UTC) #81
Patti Lor
Thanks, PTAL. I'm not 100% about whether OmniboxViewViews::AccessibilitySetValue() is correct, but hopefully msw can help ...
4 years, 1 month ago (2016-10-27 00:38:48 UTC) #88
tapted
https://codereview.chromium.org/2341633006/diff/340001/ui/accessibility/platform/ax_platform_node_win.cc File ui/accessibility/platform/ax_platform_node_win.cc (right): https://codereview.chromium.org/2341633006/diff/340001/ui/accessibility/platform/ax_platform_node_win.cc#newcode457 ui/accessibility/platform/ax_platform_node_win.cc:457: if (delegate_->SetStringValue(new_value, false)) should this be 'true' to preserve ...
4 years, 1 month ago (2016-10-27 02:09:56 UTC) #91
msw
lgtm with minor nits/q. https://codereview.chromium.org/2341633006/diff/360001/chrome/browser/ui/views/omnibox/omnibox_view_views.cc File chrome/browser/ui/views/omnibox/omnibox_view_views.cc (right): https://codereview.chromium.org/2341633006/diff/360001/chrome/browser/ui/views/omnibox/omnibox_view_views.cc#newcode422 chrome/browser/ui/views/omnibox/omnibox_view_views.cc:422: SelectRange(saved_selection_for_focus_change_); Should this check if ...
4 years, 1 month ago (2016-10-27 17:55:09 UTC) #96
Patti Lor
Thanks all for the reviews! https://codereview.chromium.org/2341633006/diff/340001/ui/accessibility/platform/ax_platform_node_win.cc File ui/accessibility/platform/ax_platform_node_win.cc (right): https://codereview.chromium.org/2341633006/diff/340001/ui/accessibility/platform/ax_platform_node_win.cc#newcode457 ui/accessibility/platform/ax_platform_node_win.cc:457: if (delegate_->SetStringValue(new_value, false)) On ...
4 years, 1 month ago (2016-10-31 00:35:05 UTC) #101
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2341633006/380001
4 years, 1 month ago (2016-10-31 02:08:42 UTC) #104
commit-bot: I haz the power
Committed patchset #17 (id:380001)
4 years, 1 month ago (2016-10-31 03:15:59 UTC) #105
commit-bot: I haz the power
4 years, 1 month ago (2016-10-31 03:17:52 UTC) #107
Message was sent while issue was closed.
Patchset 17 (id:??) landed as
https://crrev.com/0aa1406119dc85097efebbb282895b543e4b0c26
Cr-Commit-Position: refs/heads/master@{#428645}

Powered by Google App Engine
This is Rietveld 408576698