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

Unified Diff: chrome/browser/extensions/api/automation_internal/automation_internal_api.cc

Issue 2748463003: Generalize the HIT_TEST accessibility action so that it can send any event. (Closed)
Patch Set: Add automation API binding and test Created 3 years, 9 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: chrome/browser/extensions/api/automation_internal/automation_internal_api.cc
diff --git a/chrome/browser/extensions/api/automation_internal/automation_internal_api.cc b/chrome/browser/extensions/api/automation_internal/automation_internal_api.cc
index 108c09d772ae6a35b034acce3189def6b28366f6..2e40cb24bdd64e785517611f19b4b83f964ef7bc 100644
--- a/chrome/browser/extensions/api/automation_internal/automation_internal_api.cc
+++ b/chrome/browser/extensions/api/automation_internal/automation_internal_api.cc
@@ -349,6 +349,23 @@ AutomationInternalPerformActionFunction::ConvertToAXActionData(
get_image_data_params.max_height);
break;
}
+ case api::automation_internal::ACTION_TYPE_HITTEST: {
+ api::automation_internal::HitTestParams hit_test_params;
+ EXTENSION_FUNCTION_VALIDATE(
+ api::automation_internal::HitTestParams::Populate(
+ params->opt_args.additional_properties, &hit_test_params));
+ action->action = ui::AX_ACTION_HIT_TEST;
+ action->target_point = gfx::Point(hit_test_params.x, hit_test_params.y);
+ for (int event_index = ui::AX_EVENT_NONE + 1;
+ event_index <= ui::AX_EVENT_LAST; ++event_index) {
+ ui::AXEvent event = static_cast<ui::AXEvent>(event_index);
+ if (ui::ToString(event) == hit_test_params.event_to_fire)
David Tseng 2017/03/22 15:40:28 Pretty sure you can do ParseEvent here.
dmazzoni 2017/03/23 16:29:30 Done.
+ action->hit_test_event_to_fire = event;
+ }
+ if (action->hit_test_event_to_fire == ui::AX_EVENT_NONE)
+ return RespondNow(NoArguments());
+ break;
+ }
case api::automation_internal::ACTION_TYPE_MAKEVISIBLE:
action->action = ui::AX_ACTION_SCROLL_TO_MAKE_VISIBLE;
break;
« no previous file with comments | « chrome/browser/extensions/api/automation/automation_apitest.cc ('k') | chrome/common/extensions/api/automation.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698