|
|
Chromium Code Reviews|
Created:
3 years, 10 months ago by Patti Lor Modified:
3 years, 8 months ago CC:
chromium-reviews, aboxhall+watch_chromium.org, tfarina, nektar+watch_chromium.org, yuzo+watch_chromium.org, je_julie, dmazzoni+watch_chromium.org, dtseng+watch_chromium.org, mac-reviews_chromium.org, chrome-apps-syd-reviews_chromium.org Target Ref:
refs/heads/master Project:
chromium Visibility:
Public. |
DescriptionViews a11y: Implement AXPlatformNode::FromNativeViewAccessible() for Mac/Linux.
In order to implement the ability to exclude unnecessary accessibility elements
from the accessibility tree cross-platform, a method to retrieve the
NativeViewAccessibility instance for a given View is required. While this is
possible using AXPlatformNode::FromNativeViewAccessible() on Windows, it is not
implemented on any other platform.
This patch implements AXPlatformNode::FromNativeViewAccessible() for Linux and
Mac, which makes it possible to retrieve a NativeViewAccessibility instance for
any given View.
BUG=610589
Review-Url: https://codereview.chromium.org/2715543003
Cr-Commit-Position: refs/heads/master@{#461026}
Committed: https://chromium.googlesource.com/chromium/src/+/54bfa63a7eedc669fc481aa985d1f5979e695a1a
Patch Set 1 #Patch Set 2 : Use PLATFORM_HAS_NATIVE_VIEW_ACCESSIBILITY_IMPL in view.h. #Patch Set 3 : Refactor GetParent(). #Patch Set 4 : Remove void* gfx::NVA for iOS, reorder NVAAuraLinux. #Patch Set 5 : Make GetForView protected. #
Total comments: 2
Patch Set 6 : Move stuff to third CL. #Patch Set 7 : Fix up includes. #Patch Set 8 : Rebase #
Total comments: 15
Patch Set 9 : Rebase #Patch Set 10 : Fix bad rebase. #
Total comments: 2
Patch Set 11 : Rebase on top of PlatformNVA refactor. #Patch Set 12 : Move GetForView stuff to next patch. #Patch Set 13 : Fix Android #Patch Set 14 : Rebase again. #
Total comments: 2
Patch Set 15 : Try removing default impl for FromNativeViewAccessible again. #
Depends on Patchset: Messages
Total messages: 115 (101 generated)
The CQ bit was checked by patricialor@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: cast_shell_linux on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linu...)
The CQ bit was checked by patricialor@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: cast_shell_linux on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linu...)
The CQ bit was checked by patricialor@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: chromeos_daisy_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_daisy_...)
Patchset #2 (id:20001) has been deleted
The CQ bit was checked by patricialor@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Patchset #2 (id:40001) has been deleted
The CQ bit was checked by patricialor@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by patricialor@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by patricialor@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Patchset #3 (id:80001) has been deleted
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by patricialor@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
patricialor@chromium.org changed reviewers: + tapted@chromium.org
Hi Trent, PTAL - let me know if you'd like this split up more. Not sure if there is a better name for this patch, too D:
https://codereview.chromium.org/2715543003/diff/140001/ui/views/accessibility... File ui/views/accessibility/native_view_accessibility.h (right): https://codereview.chromium.org/2715543003/diff/140001/ui/views/accessibility... ui/views/accessibility/native_view_accessibility.h:80: static NativeViewAccessibility* GetForView(View* view); Hm - this is the controversial bit that I was hoping to isolate in the other CL... I don't think the change in views::View to make native_view_accessibility_ a std::unique_ptr relies on GetForView() (and that unique_ptr change is a good change, that I don't think will be controversial at all).
Patchset #6 (id:160001) has been deleted
The CQ bit was checked by patricialor@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Views a11y: Tie the NativeViewAccessibility lifetime to that of its View. Currently, instances of NativeViewAccessibility depend on NativeViewAccessibility::Destroy() being called in order to be released. By converting the Views NativeViewAccessibility member to a unique_ptr, it will be automatically destroyed with its corresponding View. To do this, implement NativeViewAccessibility::CreateForView(), which should only be called by View, and NativeViewAccessibility::GetForView(), which can be called by everything else. Also implement AXPlatformNode::FromNativeViewAccessible() for Linux and Mac, which allows the correct NativeViewAccessibility instance to be retrieved from a gfx::NativeViewAccessible. A follow up CL, https://crrev.com/2119413004, requires the ability to do this in order to exclude unnecessary accessibility elements from the accessibility tree. BUG=610589 ========== to ========== Views a11y: Implement AXPlatformNode::FromNativeViewAccessible on all platforms. In order to implement the ability to exclude unnecessary accessibility elements from the accessibility tree cross-platform, a method to retrieve the NativeViewAccessibility instance for a given View or a gfx::NativeViewAccessible is required. While AXPlatformNode::FromNativeViewAccessible() already does the latter on Windows, it is not implemented on any other platform. This patch implements AXPlatformNode::FromNativeViewAccessible() for Linux and Mac with a fallback for ChromeOS. Then to retrieve a NativeViewAccessibility instance from a View, implement NativeViewAccessibility::GetForView(). BUG=610589 ==========
The CQ bit was checked by patricialor@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Views a11y: Implement AXPlatformNode::FromNativeViewAccessible on all platforms. In order to implement the ability to exclude unnecessary accessibility elements from the accessibility tree cross-platform, a method to retrieve the NativeViewAccessibility instance for a given View or a gfx::NativeViewAccessible is required. While AXPlatformNode::FromNativeViewAccessible() already does the latter on Windows, it is not implemented on any other platform. This patch implements AXPlatformNode::FromNativeViewAccessible() for Linux and Mac with a fallback for ChromeOS. Then to retrieve a NativeViewAccessibility instance from a View, implement NativeViewAccessibility::GetForView(). BUG=610589 ========== to ========== Views a11y: Implement AXPlatformNode::FromNativeViewAccessible on all platforms. In order to implement the ability to exclude unnecessary accessibility elements from the accessibility tree cross-platform, a method to retrieve the NativeViewAccessibility instance for a given View or a gfx::NativeViewAccessible is required. While AXPlatformNode::FromNativeViewAccessible() already does the latter on Windows, it is not implemented on any other platform. This patch implements AXPlatformNode::FromNativeViewAccessible() for Linux and Mac with a fallback for ChromeOS. Then to retrieve a NativeViewAccessibility instance from a View, implement NativeViewAccessibility::GetForView(). BUG=610589 ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by patricialor@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Patchset #7 (id:200001) has been deleted
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by patricialor@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Oops, forgot to send this out. Thanks Trent :) https://codereview.chromium.org/2715543003/diff/140001/ui/views/accessibility... File ui/views/accessibility/native_view_accessibility.h (right): https://codereview.chromium.org/2715543003/diff/140001/ui/views/accessibility... ui/views/accessibility/native_view_accessibility.h:80: static NativeViewAccessibility* GetForView(View* view); On 2017/02/27 05:37:48, tapted wrote: > Hm - this is the controversial bit that I was hoping to isolate in the other > CL... I don't think the change in views::View to make native_view_accessibility_ > a std::unique_ptr relies on GetForView() (and that unique_ptr change is a good > change, that I don't think will be controversial at all). Done.
https://codereview.chromium.org/2715543003/diff/240001/testing/platform_test.h File testing/platform_test.h (right): https://codereview.chromium.org/2715543003/diff/240001/testing/platform_test.... testing/platform_test.h:12: typedef struct objc_object* id; be sure to call out the reason for this in the CL description. i.e. that `void*` used to work when `id` was just a return type, but now we need it as a method argument, and we can't have .cc files and .mm files seeing different types, or they will declare an overload that doesn't exist. https://codereview.chromium.org/2715543003/diff/240001/ui/accessibility/platf... File ui/accessibility/platform/ax_platform_node_auralinux.cc (right): https://codereview.chromium.org/2715543003/diff/240001/ui/accessibility/platf... ui/accessibility/platform/ax_platform_node_auralinux.cc:377: AX_EXPORT AXPlatformNode* AXPlatformNode::FromNativeViewAccessible( AX_EXPORT shouldn't be needed in the .cc files https://codereview.chromium.org/2715543003/diff/240001/ui/accessibility/platf... File ui/accessibility/platform/ax_platform_node_mac.mm (right): https://codereview.chromium.org/2715543003/diff/240001/ui/accessibility/platf... ui/accessibility/platform/ax_platform_node_mac.mm:635: AX_EXPORT AXPlatformNode* AXPlatformNode::FromNativeViewAccessible( remove AX_EXPORT https://codereview.chromium.org/2715543003/diff/240001/ui/views/accessibility... File ui/views/accessibility/native_view_accessibility.cc (right): https://codereview.chromium.org/2715543003/diff/240001/ui/views/accessibility... ui/views/accessibility/native_view_accessibility.cc:125: return view_->parent()->GetNativeViewAccessible(); I think this is where we need GetForView? Except GetParent() here will always return nullptr on ChromeOS. (so what happens if we don't define GetForView on ChromeOS at all?) https://codereview.chromium.org/2715543003/diff/240001/ui/views/accessibility... ui/views/accessibility/native_view_accessibility.cc:256: return view->native_view_accessibility_.get(); The CL description needs to be clear why this is needed too (I think it's related to skipping over parents?) https://codereview.chromium.org/2715543003/diff/240001/ui/views/accessibility... File ui/views/accessibility/native_view_accessibility.h (right): https://codereview.chromium.org/2715543003/diff/240001/ui/views/accessibility... ui/views/accessibility/native_view_accessibility.h:94: static NativeViewAccessibility* Create(View* view); Do we need this? (i.e. Why can't we use the current `Create` that returns a unique_ptr -- it looks like only CreateForView calls it. Note if we don't need a version that returns a raw pointer, we probably don't need to rename Create to CreateForView either)
https://codereview.chromium.org/2715543003/diff/240001/testing/platform_test.h File testing/platform_test.h (right): https://codereview.chromium.org/2715543003/diff/240001/testing/platform_test.... testing/platform_test.h:12: typedef struct objc_object* id; On 2017/03/06 01:43:09, tapted wrote: > be sure to call out the reason for this in the CL description. i.e. that > `void*` used to work when `id` was just a return type, but now we need it as a > method argument, and we can't have .cc files and .mm files seeing different > types, or they will declare an overload that doesn't exist. actually I think we should move this (and the native_widget_types.h change) to a new CL :/ (more splits - sorry!)
The CQ bit was checked by patricialor@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by patricialor@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Patchset #10 (id:280001) has been deleted
Dry run: Try jobs failed on following builders: android_arm64_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_arm6...) android_clang_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_clan...) android_compile_dbg on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_comp...) android_cronet on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_cron...) android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_...) cast_shell_android on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/cast_shell_a...) linux_chromium_tsan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) win_chromium_compile_dbg_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_comp...) win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_arm64_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_arm6...) android_compile_dbg on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_comp...) android_cronet on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_cron...) linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_androi...) cast_shell_linux on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linu...) chromeos_amd64-generic_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_amd64-...) chromeos_daisy_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_daisy_...) chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...) linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_compile_dbg_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
Patchset #9 (id:260001) has been deleted
The CQ bit was checked by patricialor@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by patricialor@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
Patchset #10 (id:320001) has been deleted
The CQ bit was checked by patricialor@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Description was changed from ========== Views a11y: Implement AXPlatformNode::FromNativeViewAccessible on all platforms. In order to implement the ability to exclude unnecessary accessibility elements from the accessibility tree cross-platform, a method to retrieve the NativeViewAccessibility instance for a given View or a gfx::NativeViewAccessible is required. While AXPlatformNode::FromNativeViewAccessible() already does the latter on Windows, it is not implemented on any other platform. This patch implements AXPlatformNode::FromNativeViewAccessible() for Linux and Mac with a fallback for ChromeOS. Then to retrieve a NativeViewAccessibility instance from a View, implement NativeViewAccessibility::GetForView(). BUG=610589 ========== to ========== Views a11y: Implement method to retrieve a NativeViewAccessibility from a View. In order to implement the ability to exclude unnecessary accessibility elements from the accessibility tree cross-platform, a method to retrieve the NativeViewAccessibility instance for a given View is required. While this is possible using AXPlatformNode::FromNativeViewAccessible() on Windows, it is not implemented on any other platform. This patch implements AXPlatformNode::FromNativeViewAccessible() for Linux and Mac, which then allows a NativeViewAccessibility instance to be retrieved for any given View. Since ChromeOS doesn't have a gfx::NativeViewAccessible, this isn't possible, so instead friend NativeViewAccessibility from View in order to access View's NativeViewAccessibility member directly. BUG=610589 ==========
Hey Trent, sorry for the delay :/ Hopefully I didn't miss anything. Thanks! https://codereview.chromium.org/2715543003/diff/240001/testing/platform_test.h File testing/platform_test.h (right): https://codereview.chromium.org/2715543003/diff/240001/testing/platform_test.... testing/platform_test.h:12: typedef struct objc_object* id; On 2017/03/06 01:46:00, tapted wrote: > On 2017/03/06 01:43:09, tapted wrote: > > be sure to call out the reason for this in the CL description. i.e. that > > `void*` used to work when `id` was just a return type, but now we need it as a > > method argument, and we can't have .cc files and .mm files seeing different > > types, or they will declare an overload that doesn't exist. > > actually I think we should move this (and the native_widget_types.h change) to a > new CL :/ (more splits - sorry!) Done with the cl desc explanation in the other CL as well :) https://codereview.chromium.org/2715543003/diff/240001/ui/accessibility/platf... File ui/accessibility/platform/ax_platform_node_auralinux.cc (right): https://codereview.chromium.org/2715543003/diff/240001/ui/accessibility/platf... ui/accessibility/platform/ax_platform_node_auralinux.cc:377: AX_EXPORT AXPlatformNode* AXPlatformNode::FromNativeViewAccessible( On 2017/03/06 01:43:09, tapted wrote: > AX_EXPORT shouldn't be needed in the .cc files Whoops, a remnant from when I was trying to work out why things wouldn't link up - thanks. https://codereview.chromium.org/2715543003/diff/240001/ui/accessibility/platf... File ui/accessibility/platform/ax_platform_node_mac.mm (right): https://codereview.chromium.org/2715543003/diff/240001/ui/accessibility/platf... ui/accessibility/platform/ax_platform_node_mac.mm:635: AX_EXPORT AXPlatformNode* AXPlatformNode::FromNativeViewAccessible( On 2017/03/06 01:43:09, tapted wrote: > remove AX_EXPORT Done. https://codereview.chromium.org/2715543003/diff/240001/ui/views/accessibility... File ui/views/accessibility/native_view_accessibility.cc (right): https://codereview.chromium.org/2715543003/diff/240001/ui/views/accessibility... ui/views/accessibility/native_view_accessibility.cc:125: return view_->parent()->GetNativeViewAccessible(); On 2017/03/06 01:43:09, tapted wrote: > I think this is where we need GetForView? Except GetParent() here will always > return nullptr on ChromeOS. (so what happens if we don't define GetForView on > ChromeOS at all?) Unfortunately I think we need this for GetChildCount() in the next CL (https://crrev.com/2119413004/). The issue is that we need a NVA instance to check if the View is ignored. Alternatively, I think we could check this manually by inlining IsAccessibilityFocusableWhenEnabled() (see next CL again) and also checking view_->GetAccessibleNodeData(), and then I think it would be possible. Or we could leave GetChildCount(), ChildAtIndex(), HitTestSync, and GetParent() unimplemented for CrOS? https://codereview.chromium.org/2715543003/diff/240001/ui/views/accessibility... ui/views/accessibility/native_view_accessibility.cc:256: return view->native_view_accessibility_.get(); On 2017/03/06 01:43:09, tapted wrote: > The CL description needs to be clear why this is needed too (I think it's > related to skipping over parents?) Updated the description with why we need a fallback with friend NativeViewAccessibility for CrOS - let me know if that's not what you meant? https://codereview.chromium.org/2715543003/diff/240001/ui/views/accessibility... File ui/views/accessibility/native_view_accessibility.h (right): https://codereview.chromium.org/2715543003/diff/240001/ui/views/accessibility... ui/views/accessibility/native_view_accessibility.h:94: static NativeViewAccessibility* Create(View* view); On 2017/03/06 01:43:09, tapted wrote: > Do we need this? (i.e. Why can't we use the current `Create` that returns a > unique_ptr -- it looks like only CreateForView calls it. > > Note if we don't need a version that returns a raw pointer, we probably don't > need to rename Create to CreateForView either) You're right, it looks like we don't need this any more :O Previously I had it there to avoid some code duplication, but now CreateForView is short we can get rid of it - thanks! Fixed, leaving it just as Create() now.
https://codereview.chromium.org/2715543003/diff/240001/ui/views/accessibility... File ui/views/accessibility/native_view_accessibility.cc (right): https://codereview.chromium.org/2715543003/diff/240001/ui/views/accessibility... ui/views/accessibility/native_view_accessibility.cc:125: return view_->parent()->GetNativeViewAccessible(); On 2017/03/13 03:03:25, Patti Lor wrote: > On 2017/03/06 01:43:09, tapted wrote: > > I think this is where we need GetForView? Except GetParent() here will always > > return nullptr on ChromeOS. (so what happens if we don't define GetForView on > > ChromeOS at all?) > > Unfortunately I think we need this for GetChildCount() in the next CL > (https://crrev.com/2119413004/). The issue is that we need a NVA instance to > check if the View is ignored. Alternatively, I think we could check this > manually by inlining IsAccessibilityFocusableWhenEnabled() (see next CL again) > and also checking view_->GetAccessibleNodeData(), and then I think it would be > possible. > > Or we could leave GetChildCount(), ChildAtIndex(), HitTestSync, and GetParent() > unimplemented for CrOS? It's possible we need GetChildCount on CrOS.. (but also maybe not: only AXPlatformBase calls it, and none exists on CrOS). But ChildAtIndex(), HitTestSync() and GetParent() must all just return nullptr on CrOS. Essentially... it seems NativeViewAccessibility doesn't need to (and shouldn't) implement ui::AXPlatformNodeDelegate on ChromeOS. Perhaps we want NativeViewAccessibility and PlatformNativeViewAccessibility that inherits form NVA. https://codereview.chromium.org/2715543003/diff/340001/ui/views/accessibility... File ui/views/accessibility/native_view_accessibility_auralinux.h (right): https://codereview.chromium.org/2715543003/diff/340001/ui/views/accessibility... ui/views/accessibility/native_view_accessibility_auralinux.h:1: // Copyright 2015 The Chromium Authors. All rights reserved. The changes to the 6 native_view_accessibility_foo.h/cc classes should be deferred to a separate CL. They are good changes, but they distract from the main/controversial bit of this CL.
The CQ bit was checked by patricialor@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Views a11y: Implement method to retrieve a NativeViewAccessibility from a View. In order to implement the ability to exclude unnecessary accessibility elements from the accessibility tree cross-platform, a method to retrieve the NativeViewAccessibility instance for a given View is required. While this is possible using AXPlatformNode::FromNativeViewAccessible() on Windows, it is not implemented on any other platform. This patch implements AXPlatformNode::FromNativeViewAccessible() for Linux and Mac, which then allows a NativeViewAccessibility instance to be retrieved for any given View. Since ChromeOS doesn't have a gfx::NativeViewAccessible, this isn't possible, so instead friend NativeViewAccessibility from View in order to access View's NativeViewAccessibility member directly. BUG=610589 ========== to ========== Views a11y: Implement AXPlatformNode::FromNativeViewAccessible() for Mac/Linux. In order to implement the ability to exclude unnecessary accessibility elements from the accessibility tree cross-platform, a method to retrieve the NativeViewAccessibility instance for a given View is required. While this is possible using AXPlatformNode::FromNativeViewAccessible() on Windows, it is not implemented on any other platform. This patch implements AXPlatformNode::FromNativeViewAccessible() for Linux and Mac, which makes it possible to retrieve a NativeViewAccessibility instance for any given View. BUG=610589 ==========
The CQ bit was checked by patricialor@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: cast_shell_android on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/cast_shell_a...)
The CQ bit was checked by patricialor@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Patchset #13 (id:400001) has been deleted
Dry run: Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_...)
The CQ bit was checked by patricialor@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Thanks for doing the refactor Trent :) PTAL! https://codereview.chromium.org/2715543003/diff/240001/ui/views/accessibility... File ui/views/accessibility/native_view_accessibility.cc (right): https://codereview.chromium.org/2715543003/diff/240001/ui/views/accessibility... ui/views/accessibility/native_view_accessibility.cc:125: return view_->parent()->GetNativeViewAccessible(); On 2017/03/13 04:07:02, tapted wrote: > On 2017/03/13 03:03:25, Patti Lor wrote: > > On 2017/03/06 01:43:09, tapted wrote: > > > I think this is where we need GetForView? Except GetParent() here will > always > > > return nullptr on ChromeOS. (so what happens if we don't define GetForView > on > > > ChromeOS at all?) > > > > Unfortunately I think we need this for GetChildCount() in the next CL > > (https://crrev.com/2119413004/). The issue is that we need a NVA instance to > > check if the View is ignored. Alternatively, I think we could check this > > manually by inlining IsAccessibilityFocusableWhenEnabled() (see next CL again) > > and also checking view_->GetAccessibleNodeData(), and then I think it would be > > possible. > > > > Or we could leave GetChildCount(), ChildAtIndex(), HitTestSync, and > GetParent() > > unimplemented for CrOS? > > It's possible we need GetChildCount on CrOS.. (but also maybe not: only > AXPlatformBase calls it, and none exists on CrOS). > > But ChildAtIndex(), HitTestSync() and GetParent() must all just return nullptr > on CrOS. > > > > Essentially... it seems NativeViewAccessibility doesn't need to (and shouldn't) > implement ui::AXPlatformNodeDelegate on ChromeOS. > > Perhaps we want NativeViewAccessibility and PlatformNativeViewAccessibility that > inherits form NVA. Thanks for your giant refactor Trent! It took a bit of time to rebase but everything seems to work and seems a lot nicer too :)) https://codereview.chromium.org/2715543003/diff/340001/ui/views/accessibility... File ui/views/accessibility/native_view_accessibility_auralinux.h (right): https://codereview.chromium.org/2715543003/diff/340001/ui/views/accessibility... ui/views/accessibility/native_view_accessibility_auralinux.h:1: // Copyright 2015 The Chromium Authors. All rights reserved. On 2017/03/13 04:07:02, tapted wrote: > The changes to the 6 native_view_accessibility_foo.h/cc classes should be > deferred to a separate CL. They are good changes, but they distract from the > main/controversial bit of this CL. Reverted!
The CQ bit was checked by patricialor@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_TIMED_OUT, build hasn't started yet, builder probably lacks capacity) ios-simulator-xcode-clang on master.tryserver.chromium.mac (JOB_TIMED_OUT, build hasn't started yet, builder probably lacks capacity)
lgtm (although I can't decide whether we want to test this separately to the stuff coming in https://codereview.chromium.org/2119413004 - we'd need some friend declarations) https://codereview.chromium.org/2715543003/diff/440001/ui/accessibility/platf... File ui/accessibility/platform/ax_platform_node.cc (right): https://codereview.chromium.org/2715543003/diff/440001/ui/accessibility/platf... ui/accessibility/platform/ax_platform_node.cc:24: #if defined(OS_ANDROID) I think this #if block can just be removed now (i.e. delete the FromNativeViewAccessible that returns nullptr)
The CQ bit was checked by patricialor@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
patricialor@chromium.org changed reviewers: + dmazzoni@chromium.org
Hi dmazzoni, PTAL! Thanks. https://codereview.chromium.org/2715543003/diff/440001/ui/accessibility/platf... File ui/accessibility/platform/ax_platform_node.cc (right): https://codereview.chromium.org/2715543003/diff/440001/ui/accessibility/platf... ui/accessibility/platform/ax_platform_node.cc:24: #if defined(OS_ANDROID) On 2017/03/23 04:24:32, tapted (OOO until 2017-03-30) wrote: > I think this #if block can just be removed now (i.e. delete the > FromNativeViewAccessible that returns nullptr) Oo, ok. Thanks, done!
On 2017/03/24 04:34:00, Patti Lor wrote: > Hi dmazzoni, PTAL! Thanks. > > https://codereview.chromium.org/2715543003/diff/440001/ui/accessibility/platf... > File ui/accessibility/platform/ax_platform_node.cc (right): > > https://codereview.chromium.org/2715543003/diff/440001/ui/accessibility/platf... > ui/accessibility/platform/ax_platform_node.cc:24: #if defined(OS_ANDROID) > On 2017/03/23 04:24:32, tapted (OOO until 2017-03-30) wrote: > > I think this #if block can just be removed now (i.e. delete the > > FromNativeViewAccessible that returns nullptr) > > Oo, ok. Thanks, done! Ping for dmazzoni@?
lgtm
The CQ bit was checked by patricialor@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from tapted@chromium.org Link to the patchset: https://codereview.chromium.org/2715543003/#ps460001 (title: "Try removing default impl for FromNativeViewAccessible again.")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 460001, "attempt_start_ts": 1490930526149130,
"parent_rev": "1d18c5d69956016f711094666eeb9592b540004e", "commit_rev":
"54bfa63a7eedc669fc481aa985d1f5979e695a1a"}
Message was sent while issue was closed.
Description was changed from ========== Views a11y: Implement AXPlatformNode::FromNativeViewAccessible() for Mac/Linux. In order to implement the ability to exclude unnecessary accessibility elements from the accessibility tree cross-platform, a method to retrieve the NativeViewAccessibility instance for a given View is required. While this is possible using AXPlatformNode::FromNativeViewAccessible() on Windows, it is not implemented on any other platform. This patch implements AXPlatformNode::FromNativeViewAccessible() for Linux and Mac, which makes it possible to retrieve a NativeViewAccessibility instance for any given View. BUG=610589 ========== to ========== Views a11y: Implement AXPlatformNode::FromNativeViewAccessible() for Mac/Linux. In order to implement the ability to exclude unnecessary accessibility elements from the accessibility tree cross-platform, a method to retrieve the NativeViewAccessibility instance for a given View is required. While this is possible using AXPlatformNode::FromNativeViewAccessible() on Windows, it is not implemented on any other platform. This patch implements AXPlatformNode::FromNativeViewAccessible() for Linux and Mac, which makes it possible to retrieve a NativeViewAccessibility instance for any given View. BUG=610589 Review-Url: https://codereview.chromium.org/2715543003 Cr-Commit-Position: refs/heads/master@{#461026} Committed: https://chromium.googlesource.com/chromium/src/+/54bfa63a7eedc669fc481aa985d1... ==========
Message was sent while issue was closed.
Committed patchset #15 (id:460001) as https://chromium.googlesource.com/chromium/src/+/54bfa63a7eedc669fc481aa985d1... |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
