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

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

Issue 2715543003: Views a11y: Implement AXPlatformNode::FromNativeViewAccessible on all platforms. (Closed)
Patch Set: Make GetForView protected. Created 3 years, 10 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
« no previous file with comments | « ui/gfx/native_widget_types.h ('k') | ui/views/accessibility/native_view_accessibility.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ui/gfx/native_widget_types.h ('k') | ui/views/accessibility/native_view_accessibility.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698