Chromium Code Reviews| Index: content/common/input/synthetic_pointer_action_params.cc |
| diff --git a/content/common/input/synthetic_pointer_action_params.cc b/content/common/input/synthetic_pointer_action_params.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d197c58d0f0cfd134f871bef473e20f297945ecf |
| --- /dev/null |
| +++ b/content/common/input/synthetic_pointer_action_params.cc |
| @@ -0,0 +1,44 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "content/common/input/synthetic_pointer_action_params.h" |
| + |
| +namespace content { |
| + |
| +SyntheticPointerActionParams::SyntheticPointerActionParams() {} |
|
tdresser
2016/03/17 18:25:29
We should make sure to give the members of this cl
|
| + |
| +SyntheticPointerActionParams::SyntheticPointerActionParams( |
| + PointerActionType type) { |
| + pointer_action_type_arg = type; |
|
tdresser
2016/03/17 18:25:29
And here.
|
| +} |
| + |
| +SyntheticPointerActionParams::SyntheticPointerActionParams( |
| + const SyntheticPointerActionParams& other) |
| + : SyntheticGestureParams(other) { |
| + pointer_action_type_arg = other.pointer_action_type(); |
| + if (other.pointer_action_type() != |
|
tdresser
2016/03/17 18:25:29
This might be clearer as a switch statement.
lanwei
2016/03/22 00:33:43
Done.
|
| + SyntheticGestureParams::PointerActionType::PROCESS) |
| + index_arg = other.index(); |
| + if (other.pointer_action_type() == |
| + SyntheticGestureParams::PointerActionType::PRESS || |
| + other.pointer_action_type() == |
| + SyntheticGestureParams::PointerActionType::MOVE) |
| + position_arg = other.position(); |
| +} |
| + |
| +SyntheticPointerActionParams::~SyntheticPointerActionParams() {} |
| + |
| +SyntheticGestureParams::GestureType |
| +SyntheticPointerActionParams::GetGestureType() const { |
| + return POINTER_ACTION; |
| +} |
| + |
| +const SyntheticPointerActionParams* SyntheticPointerActionParams::Cast( |
| + const SyntheticGestureParams* gesture_params) { |
| + DCHECK(gesture_params); |
| + DCHECK_EQ(POINTER_ACTION, gesture_params->GetGestureType()); |
| + return static_cast<const SyntheticPointerActionParams*>(gesture_params); |
| +} |
| + |
| +} // namespace content |