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

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

Issue 2518183002: Moved action verbs out of Blink. (Closed)
Patch Set: Created 4 years, 1 month 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 da6501c40c18216ab89742728ac4aabd3839c819..ffdc6430baa87099300b2569868f3a7346db12dc 100644
--- a/ui/accessibility/platform/ax_platform_node_win.cc
+++ b/ui/accessibility/platform/ax_platform_node_win.cc
@@ -373,7 +373,22 @@ STDMETHODIMP AXPlatformNodeWin::get_accChildCount(LONG* child_count) {
STDMETHODIMP AXPlatformNodeWin::get_accDefaultAction(
VARIANT var_id, BSTR* def_action) {
COM_OBJECT_VALIDATE_VAR_ID_1_ARG(var_id, def_action);
- return GetStringAttributeAsBstr(ui::AX_ATTR_ACTION, def_action);
+ int action;
+ if (!GetIntAttribute(AX_ATTR_ACTION, &action)) {
+ *def_action = nullptr;
+ return S_FALSE;
+ }
+
+ base::string16 action_verb =
+ ActionToString(static_cast<AXSupportedAction>(action));
+ if (action_verb.empty()) {
+ *def_action = nullptr;
+ return S_FALSE;
+ }
+
+ *def_action = SysAllocString(action_verb.c_str());
+ DCHECK(def_action);
+ return S_OK;
}
STDMETHODIMP AXPlatformNodeWin::get_accDescription(

Powered by Google App Engine
This is Rietveld 408576698