Commit 63ad8c63 authored by dougt's avatar dougt Committed by Commit Bot

Forward BrowserAccessibilityWin table APIs to AXPlatformNodeWin.

This CL implements IAccessibleTable, IAccessibleTable2 and
IAccessibleTableCell on AXPlatformNodeWin. It forwards calls on
BrowserAccessibilityWin to this implementation.

BUG=703369

Review-Url: https://codereview.chromium.org/2969113002
Cr-Commit-Position: refs/heads/master@{#485996}
parent 4472abcc
...@@ -54,9 +54,6 @@ class __declspec(uuid("562072fe-3390-43b1-9e2c-dd4118f5ac79")) ...@@ -54,9 +54,6 @@ class __declspec(uuid("562072fe-3390-43b1-9e2c-dd4118f5ac79"))
public IAccessibleHyperlink, public IAccessibleHyperlink,
public IAccessibleHypertext, public IAccessibleHypertext,
public IAccessibleImage, public IAccessibleImage,
public IAccessibleTable,
public IAccessibleTable2,
public IAccessibleTableCell,
public IAccessibleValue, public IAccessibleValue,
public ISimpleDOMDocument, public ISimpleDOMDocument,
public ISimpleDOMNode, public ISimpleDOMNode,
......
...@@ -40,6 +40,9 @@ class AX_EXPORT __declspec(uuid("26f5641a-246d-457b-a96d-07f3fae6acf2")) ...@@ -40,6 +40,9 @@ class AX_EXPORT __declspec(uuid("26f5641a-246d-457b-a96d-07f3fae6acf2"))
&IID_IAccessible2, &IID_IAccessible2,
&LIBID_IAccessible2Lib>, &LIBID_IAccessible2Lib>,
public IAccessibleText, public IAccessibleText,
public IAccessibleTable,
public IAccessibleTable2,
public IAccessibleTableCell,
public IServiceProvider, public IServiceProvider,
public AXPlatformNodeBase { public AXPlatformNodeBase {
public: public:
...@@ -50,6 +53,9 @@ class AX_EXPORT __declspec(uuid("26f5641a-246d-457b-a96d-07f3fae6acf2")) ...@@ -50,6 +53,9 @@ class AX_EXPORT __declspec(uuid("26f5641a-246d-457b-a96d-07f3fae6acf2"))
COM_INTERFACE_ENTRY(IAccessible2) COM_INTERFACE_ENTRY(IAccessible2)
COM_INTERFACE_ENTRY(IAccessible2_2) COM_INTERFACE_ENTRY(IAccessible2_2)
COM_INTERFACE_ENTRY(IAccessibleText) COM_INTERFACE_ENTRY(IAccessibleText)
COM_INTERFACE_ENTRY(IAccessibleTable)
COM_INTERFACE_ENTRY(IAccessibleTable2)
COM_INTERFACE_ENTRY(IAccessibleTableCell)
COM_INTERFACE_ENTRY(IServiceProvider) COM_INTERFACE_ENTRY(IServiceProvider)
END_COM_MAP() END_COM_MAP()
...@@ -227,6 +233,147 @@ class AX_EXPORT __declspec(uuid("26f5641a-246d-457b-a96d-07f3fae6acf2")) ...@@ -227,6 +233,147 @@ class AX_EXPORT __declspec(uuid("26f5641a-246d-457b-a96d-07f3fae6acf2"))
enum IA2CoordinateType coord_type, enum IA2CoordinateType coord_type,
LONG* offset) override; LONG* offset) override;
//
// IAccessibleTable methods.
//
// get_description - also used by IAccessibleImage
STDMETHODIMP get_accessibleAt(long row,
long column,
IUnknown** accessible) override;
STDMETHODIMP get_caption(IUnknown** accessible) override;
STDMETHODIMP get_childIndex(long row_index,
long column_index,
long* cell_index) override;
STDMETHODIMP get_columnDescription(long column, BSTR* description) override;
STDMETHODIMP
get_columnExtentAt(long row, long column, long* n_columns_spanned) override;
STDMETHODIMP
get_columnHeader(IAccessibleTable** accessible_table,
long* starting_row_index) override;
STDMETHODIMP get_columnIndex(long cell_index, long* column_index) override;
STDMETHODIMP get_nColumns(long* column_count) override;
STDMETHODIMP get_nRows(long* row_count) override;
STDMETHODIMP get_nSelectedChildren(long* cell_count) override;
STDMETHODIMP get_nSelectedColumns(long* column_count) override;
STDMETHODIMP get_nSelectedRows(long* row_count) override;
STDMETHODIMP get_rowDescription(long row, BSTR* description) override;
STDMETHODIMP get_rowExtentAt(long row,
long column,
long* n_rows_spanned) override;
STDMETHODIMP
get_rowHeader(IAccessibleTable** accessible_table,
long* starting_column_index) override;
STDMETHODIMP get_rowIndex(long cell_index, long* row_index) override;
STDMETHODIMP get_selectedChildren(long max_children,
long** children,
long* n_children) override;
STDMETHODIMP get_selectedColumns(long max_columns,
long** columns,
long* n_columns) override;
STDMETHODIMP get_selectedRows(long max_rows,
long** rows,
long* n_rows) override;
STDMETHODIMP get_summary(IUnknown** accessible) override;
STDMETHODIMP
get_isColumnSelected(long column, boolean* is_selected) override;
STDMETHODIMP get_isRowSelected(long row, boolean* is_selected) override;
STDMETHODIMP get_isSelected(long row,
long column,
boolean* is_selected) override;
STDMETHODIMP
get_rowColumnExtentsAtIndex(long index,
long* row,
long* column,
long* row_extents,
long* column_extents,
boolean* is_selected) override;
STDMETHODIMP selectRow(long row) override;
STDMETHODIMP selectColumn(long column) override;
STDMETHODIMP unselectRow(long row) override;
STDMETHODIMP unselectColumn(long column) override;
STDMETHODIMP
get_modelChange(IA2TableModelChange* model_change) override;
//
// IAccessibleTable2 methods.
//
// (Most of these are duplicates of IAccessibleTable methods, only the
// unique ones are included here.)
//
STDMETHODIMP get_cellAt(long row, long column, IUnknown** cell) override;
STDMETHODIMP get_nSelectedCells(long* cell_count) override;
STDMETHODIMP
get_selectedCells(IUnknown*** cells, long* n_selected_cells) override;
STDMETHODIMP get_selectedColumns(long** columns, long* n_columns) override;
STDMETHODIMP get_selectedRows(long** rows, long* n_rows) override;
//
// IAccessibleTableCell methods.
//
STDMETHODIMP
get_columnExtent(long* n_columns_spanned) override;
STDMETHODIMP
get_columnHeaderCells(IUnknown*** cell_accessibles,
long* n_column_header_cells) override;
STDMETHODIMP get_columnIndex(long* column_index) override;
STDMETHODIMP get_rowExtent(long* n_rows_spanned) override;
STDMETHODIMP
get_rowHeaderCells(IUnknown*** cell_accessibles,
long* n_row_header_cells) override;
STDMETHODIMP get_rowIndex(long* row_index) override;
STDMETHODIMP get_isSelected(boolean* is_selected) override;
STDMETHODIMP
get_rowColumnExtents(long* row,
long* column,
long* row_extents,
long* column_extents,
boolean* is_selected) override;
STDMETHODIMP get_table(IUnknown** table) override;
// //
// IAccessibleText methods not implemented. // IAccessibleText methods not implemented.
// //
......
...@@ -141,7 +141,28 @@ gfx::NativeViewAccessible TestAXNodeWrapper::GetFocus() { ...@@ -141,7 +141,28 @@ gfx::NativeViewAccessible TestAXNodeWrapper::GetFocus() {
return nullptr; return nullptr;
} }
// Walk the AXTree and ensure that all wrappers are created
void TestAXNodeWrapper::BuildAllWrappers(AXTree* tree, AXNode* node) {
for (int i = 0; i < node->child_count(); i++) {
auto* child = node->children()[i];
TestAXNodeWrapper::GetOrCreate(tree, child);
BuildAllWrappers(tree, child);
}
}
AXPlatformNode* TestAXNodeWrapper::GetFromNodeID(int32_t id) { AXPlatformNode* TestAXNodeWrapper::GetFromNodeID(int32_t id) {
// Force creating all of the wrappers for this tree.
BuildAllWrappers(tree_, node_);
for (auto it = g_node_to_wrapper_map.begin();
it != g_node_to_wrapper_map.end(); ++it) {
AXNode* node = it->first;
if (node->id() == id) {
TestAXNodeWrapper* wrapper = it->second;
return wrapper->ax_platform_node();
}
}
return nullptr; return nullptr;
} }
......
...@@ -28,6 +28,8 @@ class TestAXNodeWrapper : public AXPlatformNodeDelegate { ...@@ -28,6 +28,8 @@ class TestAXNodeWrapper : public AXPlatformNodeDelegate {
AXPlatformNode* ax_platform_node() { return platform_node_; } AXPlatformNode* ax_platform_node() { return platform_node_; }
void BuildAllWrappers(AXTree* tree, AXNode* node);
// AXPlatformNodeDelegate. // AXPlatformNodeDelegate.
const AXNodeData& GetData() const override; const AXNodeData& GetData() const override;
const ui::AXTreeData& GetTreeData() const override; const ui::AXTreeData& GetTreeData() const override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment