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..9247ec025bfc9db3422924c8c42d4516be29e019 100644 |
| --- a/ui/views/accessibility/native_view_accessibility.h |
| +++ b/ui/views/accessibility/native_view_accessibility.h |
| @@ -40,13 +40,17 @@ 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 an instance for |view|, use GetForView() instead. |
| + static std::unique_ptr<NativeViewAccessibility> CreateForView(View* view); |
|
tapted
2017/02/21 06:01:11
Let's move the unique_ptr/Destroy/CreateForView ch
Patti Lor
2017/02/27 05:31:04
Done.
|
| - gfx::NativeViewAccessible GetNativeObject(); |
| + // Retrieves the NativeViewAccessibility instance for the given View. This |
| + // calls CreateForView() if it doesn't yet exist. |
|
tapted
2017/02/21 06:01:11
Can we instead say "Invokes View::GetNativeViewAcc
Patti Lor
2017/02/27 05:31:04
Done.
|
| + static NativeViewAccessibility* GetForView(View* view); |
| + |
| + ~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 +78,6 @@ class VIEWS_EXPORT NativeViewAccessibility |
| protected: |
| NativeViewAccessibility(View* view); |
| - ~NativeViewAccessibility() override; |
| // Weak. Owns this. |
| View* view_; |
| @@ -85,6 +88,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 |