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

Unified Diff: ui/accessibility/platform/ax_platform_node_win.cc

Issue 2964313002: Converts accNavigate over to the AXPlatformNode code. (Closed)
Patch Set: are -> is Created 3 years, 5 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
Index: ui/accessibility/platform/ax_platform_node_win.cc
diff --git a/ui/accessibility/platform/ax_platform_node_win.cc b/ui/accessibility/platform/ax_platform_node_win.cc
index 295a404af706d24c7b75645fc0b09881e2db1a4b..b29c62fb1ac84bcfb55b1b1465207950c7581f15 100644
--- a/ui/accessibility/platform/ax_platform_node_win.cc
+++ b/ui/accessibility/platform/ax_platform_node_win.cc
@@ -20,6 +20,7 @@
#include "third_party/skia/include/core/SkColor.h"
#include "ui/accessibility/ax_action_data.h"
#include "ui/accessibility/ax_node_data.h"
+#include "ui/accessibility/ax_role_properties.h"
#include "ui/accessibility/ax_text_utils.h"
#include "ui/accessibility/ax_tree_data.h"
#include "ui/accessibility/platform/ax_platform_node_delegate.h"
@@ -361,12 +362,6 @@ STDMETHODIMP AXPlatformNodeWin::accNavigate(
IAccessible* result = nullptr;
switch (nav_dir) {
- case NAVDIR_DOWN:
- case NAVDIR_UP:
- case NAVDIR_LEFT:
- case NAVDIR_RIGHT:
- // These directions are not implemented except in tables.
- return E_NOTIMPL;
case NAVDIR_FIRSTCHILD:
if (delegate_->GetChildCount() > 0)
@@ -391,6 +386,67 @@ STDMETHODIMP AXPlatformNodeWin::accNavigate(
result = previous->GetNativeViewAccessible();
break;
}
+
+ case NAVDIR_DOWN: {
+ // This direction is not implemented except in tables.
+ if (!ui::IsTableLikeRole(GetData().role) &&
+ !ui::IsCellOrTableHeaderRole(GetData().role))
+ return E_NOTIMPL;
+
+ AXPlatformNodeBase* next = target->GetTableCell(
+ GetTableRow() + GetTableRowSpan(), GetTableColumn());
+ if (!next)
+ return S_OK;
+
+ result = next->GetNativeViewAccessible();
+ break;
+ }
+
+ case NAVDIR_UP: {
+ // This direction is not implemented except in tables.
+ if (!ui::IsTableLikeRole(GetData().role) &&
+ !ui::IsCellOrTableHeaderRole(GetData().role))
+ return E_NOTIMPL;
+
+ AXPlatformNodeBase* next =
+ target->GetTableCell(GetTableRow() - 1, GetTableColumn());
+ if (!next)
+ return S_OK;
+
+ result = next->GetNativeViewAccessible();
+ break;
+ }
+
+ case NAVDIR_LEFT: {
+ // This direction is not implemented except in tables.
+ if (!ui::IsTableLikeRole(GetData().role) &&
+ !ui::IsCellOrTableHeaderRole(GetData().role))
+ return E_NOTIMPL;
+
+ AXPlatformNodeBase* next =
+ target->GetTableCell(GetTableRow(), GetTableColumn() - 1);
+ if (!next)
+ return S_OK;
+
+ result = next->GetNativeViewAccessible();
+ break;
+ }
+
+ case NAVDIR_RIGHT: {
+ // This direction is not implemented except in tables.
+
+ if (!ui::IsTableLikeRole(GetData().role) &&
+ !ui::IsCellOrTableHeaderRole(GetData().role))
+ return E_NOTIMPL;
+
+ AXPlatformNodeBase* next = target->GetTableCell(
+ GetTableRow(), GetTableColumn() + GetTableColumnSpan());
+ if (!next)
+ return S_OK;
+
+ result = next->GetNativeViewAccessible();
+ break;
+ }
}
if (!result)
« no previous file with comments | « ui/accessibility/platform/ax_platform_node_delegate.h ('k') | ui/accessibility/platform/ax_system_caret_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698