| Index: chrome/renderer/extensions/automation_internal_custom_bindings.cc
|
| diff --git a/chrome/renderer/extensions/automation_internal_custom_bindings.cc b/chrome/renderer/extensions/automation_internal_custom_bindings.cc
|
| index 89a19c6ad1a9dfdf49704029ccbc007b7d4b76c6..5d7098c36655316f05c33cc5347d57bd58c206bb 100644
|
| --- a/chrome/renderer/extensions/automation_internal_custom_bindings.cc
|
| +++ b/chrome/renderer/extensions/automation_internal_custom_bindings.cc
|
| @@ -742,6 +742,38 @@ AutomationInternalCustomBindings::AutomationInternalCustomBindings(
|
| std::string name_from_str = ui::ToString(name_from);
|
| result.Set(v8::String::NewFromUtf8(isolate, name_from_str.c_str()));
|
| });
|
| + RouteNodeIDFunction("GetCustomActions", [](v8::Isolate* isolate,
|
| + v8::ReturnValue<v8::Value> result,
|
| + TreeCache* cache,
|
| + ui::AXNode* node) {
|
| + const std::vector<int32_t>& custom_action_ids =
|
| + node->data().GetIntListAttribute(ui::AX_ATTR_CUSTOM_ACTION_IDS);
|
| + if (custom_action_ids.empty()) {
|
| + result.SetUndefined();
|
| + return;
|
| + }
|
| +
|
| + const std::vector<std::string>& custom_action_descriptions =
|
| + node->data().GetStringListAttribute(
|
| + ui::AX_ATTR_CUSTOM_ACTION_DESCRIPTIONS);
|
| + if (custom_action_ids.size() != custom_action_descriptions.size()) {
|
| + NOTREACHED();
|
| + return;
|
| + }
|
| +
|
| + v8::Local<v8::Array> custom_actions(
|
| + v8::Array::New(isolate, custom_action_ids.size()));
|
| + for (size_t i = 0; i < custom_action_ids.size(); i++) {
|
| + v8::Local<v8::Object> custom_action(v8::Object::New(isolate));
|
| + SafeSetV8Property(isolate, custom_action, "id",
|
| + v8::Integer::New(isolate, custom_action_ids[i]));
|
| + SafeSetV8Property(isolate, custom_action, "description",
|
| + v8::String::NewFromUtf8(
|
| + isolate, custom_action_descriptions[i].c_str()));
|
| + custom_actions->Set(static_cast<uint32_t>(i), custom_action);
|
| + }
|
| + result.Set(custom_actions);
|
| + });
|
| RouteNodeIDFunction("GetChecked", [](v8::Isolate* isolate,
|
| v8::ReturnValue<v8::Value> result,
|
| TreeCache* cache, ui::AXNode* node) {
|
|
|