Chromium Code Reviews| Index: content/renderer/gpu/actions_parser.cc |
| diff --git a/content/renderer/gpu/actions_parser.cc b/content/renderer/gpu/actions_parser.cc |
| index 534c0d1d00794d4b4370b292c43b2a4f476c7e3f..7bac91b2bd78882066467c725842f18d526def04 100644 |
| --- a/content/renderer/gpu/actions_parser.cc |
| +++ b/content/renderer/gpu/actions_parser.cc |
| @@ -190,13 +190,29 @@ bool ActionsParser::ParseAction( |
| return false; |
| } |
| + int button = 1; |
| + if (action.HasKey("button") && !action.GetInteger("button", &button)) { |
| + error_message_ = base::StringPrintf( |
| + "actions[%d].actions.button is not a number", action_index_); |
| + return false; |
| + } |
| + |
| SyntheticPointerActionParams action_param(pointer_action_type); |
| action_param.set_index(action_index_); |
| - if (pointer_action_type == |
| - SyntheticPointerActionParams::PointerActionType::PRESS || |
| - pointer_action_type == |
| - SyntheticPointerActionParams::PointerActionType::MOVE) { |
| - action_param.set_position(gfx::PointF(position_x, position_y)); |
| + switch (pointer_action_type) { |
| + case SyntheticPointerActionParams::PointerActionType::PRESS: |
| + action_param.set_position(gfx::PointF(position_x, position_y)); |
| + action_param.set_button(button); |
| + break; |
| + case SyntheticPointerActionParams::PointerActionType::MOVE: |
| + action_param.set_position(gfx::PointF(position_x, position_y)); |
| + break; |
| + case SyntheticPointerActionParams::PointerActionType::RELEASE: |
| + action_param.set_button(button); |
|
Navid Zolghadr
2017/01/12 18:23:46
Is there any reason we don't set the x/y here simi
lanwei
2017/01/13 17:29:30
For SyntheticTouchDriver::Release and SyntheticMou
|
| + break; |
| + case SyntheticPointerActionParams::PointerActionType::IDLE: |
| + case SyntheticPointerActionParams::PointerActionType::NOT_INITIALIZED: |
| + break; |
| } |
| param_list.push_back(action_param); |
| return true; |