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

Unified Diff: content/browser/accessibility/browser_accessibility_com_win.cc

Issue 2863703003: A11y: Rename AXSupportedAction to AXDefaultActionVerb. (Closed)
Patch Set: Rebase. Created 3 years, 7 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: content/browser/accessibility/browser_accessibility_com_win.cc
diff --git a/content/browser/accessibility/browser_accessibility_com_win.cc b/content/browser/accessibility/browser_accessibility_com_win.cc
index 17ff9a29529348f65f1bd3406c917805b88e060d..8123f10421f5af4d7f0213791594e4df3705d6ef 100644
--- a/content/browser/accessibility/browser_accessibility_com_win.cc
+++ b/content/browser/accessibility/browser_accessibility_com_win.cc
@@ -438,8 +438,9 @@ HRESULT BrowserAccessibilityComWin::accDoDefaultAction(VARIANT var_id) {
if (!target)
return E_INVALIDARG;
- // Return an error if it's not clickable.
- if (!target->owner()->HasIntAttribute(ui::AX_ATTR_ACTION))
+ // Return an error if it hasn't got a custom action verb to describe what
+ // happens on click.
+ if (!target->owner()->HasIntAttribute(ui::AX_ATTR_DEFAULT_ACTION_VERB))
return DISP_E_MEMBERNOTFOUND;
manager->DoDefaultAction(*target->owner());
@@ -2759,7 +2760,8 @@ STDMETHODIMP BrowserAccessibilityComWin::nActions(long* n_actions) {
// |IsHyperlink| is required for |IAccessibleHyperlink::anchor/anchorTarget|
// to work properly because the |IAccessibleHyperlink| interface inherits from
// |IAccessibleAction|.
- if (IsHyperlink() || owner()->HasIntAttribute(ui::AX_ATTR_ACTION)) {
+ if (IsHyperlink() ||
+ owner()->HasIntAttribute(ui::AX_ATTR_DEFAULT_ACTION_VERB)) {
*n_actions = 1;
} else {
*n_actions = 0;
@@ -2774,7 +2776,8 @@ STDMETHODIMP BrowserAccessibilityComWin::doAction(long action_index) {
if (!owner())
return E_FAIL;
- if (!owner()->HasIntAttribute(ui::AX_ATTR_ACTION) || action_index != 0)
+ if (!owner()->HasIntAttribute(ui::AX_ATTR_DEFAULT_ACTION_VERB) ||
+ action_index != 0)
return E_INVALIDARG;
Manager()->DoDefaultAction(*owner());
@@ -2809,14 +2812,14 @@ STDMETHODIMP BrowserAccessibilityComWin::get_name(long action_index,
return E_INVALIDARG;
int action;
- if (!owner()->GetIntAttribute(ui::AX_ATTR_ACTION, &action) ||
+ if (!owner()->GetIntAttribute(ui::AX_ATTR_DEFAULT_ACTION_VERB, &action) ||
action_index != 0) {
*name = nullptr;
return E_INVALIDARG;
}
- base::string16 action_verb =
- ui::ActionToUnlocalizedString(static_cast<ui::AXSupportedAction>(action));
+ base::string16 action_verb = ui::ActionVerbToUnlocalizedString(
+ static_cast<ui::AXDefaultActionVerb>(action));
if (action_verb.empty() || action_verb == L"none") {
*name = nullptr;
return S_FALSE;
@@ -2839,14 +2842,14 @@ BrowserAccessibilityComWin::get_localizedName(long action_index,
return E_INVALIDARG;
int action;
- if (!owner()->GetIntAttribute(ui::AX_ATTR_ACTION, &action) ||
+ if (!owner()->GetIntAttribute(ui::AX_ATTR_DEFAULT_ACTION_VERB, &action) ||
action_index != 0) {
*localized_name = nullptr;
return E_INVALIDARG;
}
- base::string16 action_verb =
- ui::ActionToString(static_cast<ui::AXSupportedAction>(action));
+ base::string16 action_verb = ui::ActionVerbToLocalizedString(
+ static_cast<ui::AXDefaultActionVerb>(action));
if (action_verb.empty()) {
*localized_name = nullptr;
return S_FALSE;

Powered by Google App Engine
This is Rietveld 408576698