Chromium Code Reviews| Index: ui/views/accessibility/native_view_accessibility.h |
| diff --git a/ui/views/accessibility/native_view_accessibility.h b/ui/views/accessibility/native_view_accessibility.h |
| index df9880e44b331627cf5fb4aa470591fcef6c7c53..85891fd0b43dcbb14cf3025ffc536b61c3248c4e 100644 |
| --- a/ui/views/accessibility/native_view_accessibility.h |
| +++ b/ui/views/accessibility/native_view_accessibility.h |
| @@ -40,13 +40,13 @@ class VIEWS_EXPORT NativeViewAccessibility |
| : public ui::AXPlatformNodeDelegate, |
| public WidgetObserver { |
| public: |
| - static NativeViewAccessibility* Create(View* view); |
| + // A method for View to create a new NativeViewAccessibility instance for the |
| + // given View. To retrieve the instance for |view|, use GetForView() instead. |
| + static std::unique_ptr<NativeViewAccessibility> CreateForView(View* view); |
| - gfx::NativeViewAccessible GetNativeObject(); |
| + ~NativeViewAccessibility() override; |
| - // Call Destroy rather than deleting this, because the subclass may |
| - // use reference counting. |
| - virtual void Destroy(); |
| + gfx::NativeViewAccessible GetNativeObject(); |
| void NotifyAccessibilityEvent(ui::AXEvent event_type); |
| @@ -74,7 +74,13 @@ class VIEWS_EXPORT NativeViewAccessibility |
| protected: |
| NativeViewAccessibility(View* view); |
| - ~NativeViewAccessibility() override; |
| + |
| + // Retrieves the NativeViewAccessibility instance for the given View. This |
| + // invokes View::GetNativeViewAccessible() to ensure it exists. |
| + static NativeViewAccessibility* GetForView(View* view); |
|
tapted
2017/02/27 05:37:48
Hm - this is the controversial bit that I was hopi
Patti Lor
2017/03/03 02:55:54
Done.
|
| + |
| + // Retrieves the gfx::NativeViewAccessibility for |view_|'s Widget/Rootview. |
| + virtual gfx::NativeViewAccessible GetNativeViewAccessibleForWidget(); |
| // Weak. Owns this. |
| View* view_; |
| @@ -85,6 +91,9 @@ class VIEWS_EXPORT NativeViewAccessibility |
| Widget* parent_widget_; |
| private: |
| + // Creates new platform-specific NativeViewAccessibility subclass instances. |
| + static NativeViewAccessibility* Create(View* view); |
| + |
| void PopulateChildWidgetVector(std::vector<Widget*>* result_child_widgets); |
| // We own this, but it is reference-counted on some platforms so we can't use |