Commit 1c9cce4c authored by David Tseng's avatar David Tseng Committed by Commit Bot

Expose autoComplete and className in automation

Bug: 
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I96565fa693ae9598636927c953abfd68c57359d4
Reviewed-on: https://chromium-review.googlesource.com/801777Reviewed-by: default avatarMichael Giuffrida <michaelpg@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: default avatarYuki Awano <yawano@chromium.org>
Commit-Queue: David Tseng <dtseng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521484}
parent 4e931006
...@@ -191,8 +191,11 @@ void PopulateAXRole(arc::mojom::AccessibilityNodeInfoData* node, ...@@ -191,8 +191,11 @@ void PopulateAXRole(arc::mojom::AccessibilityNodeInfoData* node,
} }
std::string class_name; std::string class_name;
GetStringProperty(node, arc::mojom::AccessibilityStringProperty::CLASS_NAME, if (GetStringProperty(node,
&class_name); arc::mojom::AccessibilityStringProperty::CLASS_NAME,
&class_name)) {
out_data->AddStringAttribute(ui::AX_ATTR_CLASS_NAME, class_name);
}
#define MAP_ROLE(android_class_name, chrome_role) \ #define MAP_ROLE(android_class_name, chrome_role) \
if (class_name == android_class_name) { \ if (class_name == android_class_name) { \
......
...@@ -643,6 +643,12 @@ ...@@ -643,6 +643,12 @@
// Miscellaneous attributes. // Miscellaneous attributes.
// //
// Aria auto complete.
DOMString? autoComplete;
// The name of the programmatic backing object.
DOMString? className;
// A map containing all HTML attributes and their values // A map containing all HTML attributes and their values
// <jsexterns>@type {Object<string>}</jsexterns> // <jsexterns>@type {Object<string>}</jsexterns>
object? htmlAttributes; object? htmlAttributes;
......
...@@ -819,6 +819,8 @@ AutomationNodeImpl.prototype = { ...@@ -819,6 +819,8 @@ AutomationNodeImpl.prototype = {
var stringAttributes = [ var stringAttributes = [
'accessKey', 'accessKey',
'ariaInvalidValue', 'ariaInvalidValue',
'autoComplete',
'className',
'containerLiveRelevant', 'containerLiveRelevant',
'containerLiveStatus', 'containerLiveStatus',
'description', 'description',
......
...@@ -431,8 +431,7 @@ chrome.automation.AutomationNode.prototype.location; ...@@ -431,8 +431,7 @@ chrome.automation.AutomationNode.prototype.location;
chrome.automation.AutomationNode.prototype.boundsForRange = function(startIndex, endIndex) {}; chrome.automation.AutomationNode.prototype.boundsForRange = function(startIndex, endIndex) {};
/** /**
* The location (as a bounding box) of this node in global screen coordinates. * The location (as a bounding box) of this node in global screen coordinates without applying any clipping from ancestors.
* This is the same as location but not clipped by ancestors.
* @type {(!chrome.automation.Rect|undefined)} * @type {(!chrome.automation.Rect|undefined)}
* @see https://developer.chrome.com/extensions/automation#type-unclippedLocation * @see https://developer.chrome.com/extensions/automation#type-unclippedLocation
*/ */
...@@ -894,6 +893,20 @@ chrome.automation.AutomationNode.prototype.containerLiveAtomic; ...@@ -894,6 +893,20 @@ chrome.automation.AutomationNode.prototype.containerLiveAtomic;
*/ */
chrome.automation.AutomationNode.prototype.containerLiveBusy; chrome.automation.AutomationNode.prototype.containerLiveBusy;
/**
* Aria auto complete.
* @type {(string|undefined)}
* @see https://developer.chrome.com/extensions/automation#type-autoComplete
*/
chrome.automation.AutomationNode.prototype.autoComplete;
/**
* The name of the programmatic backing object.
* @type {(string|undefined)}
* @see https://developer.chrome.com/extensions/automation#type-className
*/
chrome.automation.AutomationNode.prototype.className;
/** /**
* A map containing all HTML attributes and their values * A map containing all HTML attributes and their values
* @type {Object<string>} * @type {Object<string>}
......
...@@ -340,6 +340,7 @@ ...@@ -340,6 +340,7 @@
aria_invalid_value, aria_invalid_value,
auto_complete, auto_complete,
chrome_channel, // Automation only. chrome_channel, // Automation only.
class_name, // views and Android
container_live_relevant, container_live_relevant,
container_live_status, container_live_status,
description, description,
......
...@@ -831,6 +831,9 @@ std::string AXNodeData::ToString() const { ...@@ -831,6 +831,9 @@ std::string AXNodeData::ToString() const {
case AX_ATTR_CHROME_CHANNEL: case AX_ATTR_CHROME_CHANNEL:
result += " chrome_channel=" + value; result += " chrome_channel=" + value;
break; break;
case AX_ATTR_CLASS_NAME:
result += " class_name=" + value;
break;
case AX_ATTR_DESCRIPTION: case AX_ATTR_DESCRIPTION:
result += " description=" + value; result += " description=" + value;
break; break;
......
...@@ -62,6 +62,9 @@ void AXViewObjWrapper::Serialize(ui::AXNodeData* out_node_data) { ...@@ -62,6 +62,9 @@ void AXViewObjWrapper::Serialize(ui::AXNodeData* out_node_data) {
base::UTF16ToUTF8(description)); base::UTF16ToUTF8(description));
} }
out_node_data->AddStringAttribute(ui::AX_ATTR_CLASS_NAME,
view_->GetClassName());
out_node_data->location = gfx::RectF(view_->GetBoundsInScreen()); out_node_data->location = gfx::RectF(view_->GetBoundsInScreen());
} }
......
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