Chromium Code Reviews| Index: ui/accessibility/platform/ax_platform_node_delegate.h |
| diff --git a/ui/accessibility/platform/ax_platform_node_delegate.h b/ui/accessibility/platform/ax_platform_node_delegate.h |
| index 9af5c4d5df48027749872a68803c98a878274432..0bcca3abea397cb0e88e0ac5dc15d84d759f730d 100644 |
| --- a/ui/accessibility/platform/ax_platform_node_delegate.h |
| +++ b/ui/accessibility/platform/ax_platform_node_delegate.h |
| @@ -15,28 +15,69 @@ namespace ui { |
| struct AXNodeData; |
| class AXPlatformNode; |
| +// An object that wants to be accessible should derive from this class. |
| +// AXPlatformNode subclasses use this interface to query all of the information |
| +// about the object in order to implement native accessibility APIs. |
| +// |
| +// Note that AXPlatformNode has support for accessibility trees where some |
| +// of the objects in the tree are not implemented using AXPlatformNode. |
| +// For example, you may have a native window with platform-native widgets |
| +// in it, but in that window you have custom controls that use AXPlatformNode |
| +// to provide accessibility. So when you're implementing |
|
David Tseng
2015/02/13 20:10:11
?
dmazzoni
2015/02/17 22:48:05
Done.
|
| class AX_EXPORT AXPlatformNodeDelegate { |
| public: |
| // Get the accessibility data that should be exposed for this node. |
| - virtual AXNodeData* GetData() = 0; |
| + // Virtually all of the information is obtained from this structure |
| + // (role, state, name, cursor position, etc.) - the rest of this interface |
| + // is mostly to implement support for walking the accessibility tree. |
| + virtual const AXNodeData* GetData() = 0; |
| - // Get the parent of the node unless it's the root, then it returns NULL. |
| + // Get the parent of the node, which may be an AXPlatformNode or it may |
| + // be a native accessible object implemented by another class. |
| virtual gfx::NativeViewAccessible GetParent() = 0; |
| // Get the number of children of this node. |
| virtual int GetChildCount() = 0; |
| - // Get the child of a node from [0...GetChildCount() - 1] |
| + // Get the child of a node given a 0-based index. |
| virtual gfx::NativeViewAccessible ChildAtIndex(int index) = 0; |
| + // Get the 0-based index of this node in its parent. |
| + virtual int GetIndexInParent() = 0; |
| + |
| // Get the offset to convert local coordinates to screen global coordinates. |
| virtual gfx::Vector2d GetGlobalCoordinateOffset() = 0; |
| + // Do a *synchronous* hit test of the given location in global screen |
| + // coordinates, and the node within this node's subtree (inclusive) that's |
| + // hit, if any. |
| + // |
| + // This function is mainly used by accessibility debugging software. |
| + // Platforms with touch accessibility use a different asynchronous interface. |
| + virtual gfx::NativeViewAccessible HitTest(int x, int y) = 0; |
|
David Tseng
2015/02/13 20:10:11
Maybe HitTestSync?
dmazzoni
2015/02/17 22:48:05
Done.
|
| + |
| + // Return the node within this node's subtree (inclusive) that currently |
| + // has focus. |
| + virtual gfx::NativeViewAccessible GetFocus() = 0; |
| + |
| // |
| // Events. |
| // |
| - virtual void NotifyAccessibilityEvent(ui::AXEvent event_type) = 0; |
| + // Return the platform-native GUI object that should be used as a target |
| + // for accessibility events. |
| + virtual gfx::AcceleratedWidget GetTargetForNativeAccessibilityEvent() = 0; |
| + |
| + // |
| + // Actions. |
| + // |
| + |
| + // Perform the default action, e.g. click a button, follow a link, or |
| + // toggle a checkbox. |
| + virtual void DoDefaultAction() = 0; |
| + |
| + // Change the value of a control, such as the text content of a text field. |
| + virtual bool SetStringValue(const base::string16& new_value) = 0; |
| }; |
| } // namespace ui |