OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/common/input/synthetic_pointer_action_params.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 |
| 9 namespace content { |
| 10 |
| 11 SyntheticPointerActionParams::SyntheticPointerActionParams() {} |
| 12 |
| 13 SyntheticPointerActionParams::SyntheticPointerActionParams( |
| 14 PointerActionType type) |
| 15 : pointer_action_type(type) {} |
| 16 |
| 17 SyntheticPointerActionParams::SyntheticPointerActionParams( |
| 18 const SyntheticPointerActionParams& other) |
| 19 : SyntheticGestureParams(other), |
| 20 pointer_action_type(other.pointer_action_type) { |
| 21 if (other.pointer_action_type != |
| 22 SyntheticGestureParams::PointerActionType::PROCESS) |
| 23 index_ = other.index(); |
| 24 if (other.pointer_action_type == |
| 25 SyntheticGestureParams::PointerActionType::PRESS || |
| 26 other.pointer_action_type == |
| 27 SyntheticGestureParams::PointerActionType::MOVE) |
| 28 position_ = other.position(); |
| 29 } |
| 30 |
| 31 SyntheticPointerActionParams::~SyntheticPointerActionParams() {} |
| 32 |
| 33 SyntheticGestureParams::GestureType |
| 34 SyntheticPointerActionParams::GetGestureType() const { |
| 35 return POINTER_ACTION; |
| 36 } |
| 37 |
| 38 const SyntheticPointerActionParams* SyntheticPointerActionParams::Cast( |
| 39 const SyntheticGestureParams* gesture_params) { |
| 40 DCHECK(gesture_params); |
| 41 DCHECK_EQ(POINTER_ACTION, gesture_params->GetGestureType()); |
| 42 return static_cast<const SyntheticPointerActionParams*>(gesture_params); |
| 43 } |
| 44 |
| 45 } // namespace content |
OLD | NEW |