| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/extensions/api/automation_internal/automation_internal_
api.h" | 5 #include "chrome/browser/extensions/api/automation_internal/automation_internal_
api.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 case api::automation_internal::ACTION_TYPE_GETIMAGEDATA: { | 342 case api::automation_internal::ACTION_TYPE_GETIMAGEDATA: { |
| 343 api::automation_internal::GetImageDataParams get_image_data_params; | 343 api::automation_internal::GetImageDataParams get_image_data_params; |
| 344 EXTENSION_FUNCTION_VALIDATE( | 344 EXTENSION_FUNCTION_VALIDATE( |
| 345 api::automation_internal::GetImageDataParams::Populate( | 345 api::automation_internal::GetImageDataParams::Populate( |
| 346 params->opt_args.additional_properties, &get_image_data_params)); | 346 params->opt_args.additional_properties, &get_image_data_params)); |
| 347 action->action = ui::AX_ACTION_GET_IMAGE_DATA; | 347 action->action = ui::AX_ACTION_GET_IMAGE_DATA; |
| 348 action->target_rect = gfx::Rect(0, 0, get_image_data_params.max_width, | 348 action->target_rect = gfx::Rect(0, 0, get_image_data_params.max_width, |
| 349 get_image_data_params.max_height); | 349 get_image_data_params.max_height); |
| 350 break; | 350 break; |
| 351 } | 351 } |
| 352 case api::automation_internal::ACTION_TYPE_HITTEST: { |
| 353 api::automation_internal::HitTestParams hit_test_params; |
| 354 EXTENSION_FUNCTION_VALIDATE( |
| 355 api::automation_internal::HitTestParams::Populate( |
| 356 params->opt_args.additional_properties, &hit_test_params)); |
| 357 action->action = ui::AX_ACTION_HIT_TEST; |
| 358 action->target_point = gfx::Point(hit_test_params.x, hit_test_params.y); |
| 359 action->hit_test_event_to_fire = |
| 360 ui::ParseAXEvent(hit_test_params.event_to_fire); |
| 361 if (action->hit_test_event_to_fire == ui::AX_EVENT_NONE) |
| 362 return RespondNow(NoArguments()); |
| 363 break; |
| 364 } |
| 352 case api::automation_internal::ACTION_TYPE_MAKEVISIBLE: | 365 case api::automation_internal::ACTION_TYPE_MAKEVISIBLE: |
| 353 action->action = ui::AX_ACTION_SCROLL_TO_MAKE_VISIBLE; | 366 action->action = ui::AX_ACTION_SCROLL_TO_MAKE_VISIBLE; |
| 354 break; | 367 break; |
| 355 case api::automation_internal::ACTION_TYPE_SETSELECTION: { | 368 case api::automation_internal::ACTION_TYPE_SETSELECTION: { |
| 356 api::automation_internal::SetSelectionParams selection_params; | 369 api::automation_internal::SetSelectionParams selection_params; |
| 357 EXTENSION_FUNCTION_VALIDATE( | 370 EXTENSION_FUNCTION_VALIDATE( |
| 358 api::automation_internal::SetSelectionParams::Populate( | 371 api::automation_internal::SetSelectionParams::Populate( |
| 359 params->opt_args.additional_properties, &selection_params)); | 372 params->opt_args.additional_properties, &selection_params)); |
| 360 action->anchor_node_id = params->args.automation_node_id; | 373 action->anchor_node_id = params->args.automation_node_id; |
| 361 action->anchor_offset = selection_params.anchor_offset; | 374 action->anchor_offset = selection_params.anchor_offset; |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 int result_acc_obj_id) { | 522 int result_acc_obj_id) { |
| 510 if (!error.empty()) { | 523 if (!error.empty()) { |
| 511 Respond(Error(error)); | 524 Respond(Error(error)); |
| 512 return; | 525 return; |
| 513 } | 526 } |
| 514 | 527 |
| 515 Respond(OneArgument(base::MakeUnique<base::Value>(result_acc_obj_id))); | 528 Respond(OneArgument(base::MakeUnique<base::Value>(result_acc_obj_id))); |
| 516 } | 529 } |
| 517 | 530 |
| 518 } // namespace extensions | 531 } // namespace extensions |
| OLD | NEW |