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

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

Issue 2518183002: Moved action verbs out of Blink. (Closed)
Patch Set: Added missing braces. Created 4 years 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/accessibility/ax_tree_combiner.cc ('k') | ui/strings/ui_strings.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 17439d99dc5a384932ffe14c5a0ea314e1cfc41c..5028f2da5bf7526ba6e212b92696f5ae60536f52 100644
--- a/ui/accessibility/platform/ax_platform_node_win.cc
+++ b/ui/accessibility/platform/ax_platform_node_win.cc
@@ -374,7 +374,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(
« no previous file with comments | « ui/accessibility/ax_tree_combiner.cc ('k') | ui/strings/ui_strings.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698