Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 "content/common/input/synthetic_pointer_action_params.h" | 5 #include "content/common/input/synthetic_pointer_action_params.h" |
| 6 | 6 |
| 7 namespace content { | 7 namespace content { |
| 8 | 8 |
| 9 SyntheticPointerActionParams::SyntheticPointerActionParams() | 9 SyntheticPointerActionParams::SyntheticPointerActionParams() |
| 10 : pointer_action_type_(PointerActionType::NOT_INITIALIZED), index_(-1) {} | 10 : pointer_action_type_(PointerActionType::NOT_INITIALIZED), index_(0) {} |
| 11 | 11 |
| 12 SyntheticPointerActionParams::SyntheticPointerActionParams( | 12 SyntheticPointerActionParams::SyntheticPointerActionParams( |
| 13 PointerActionType type) | 13 PointerActionType type) |
| 14 : pointer_action_type_(type), index_(-1) {} | 14 : pointer_action_type_(type), index_(0) {} |
|
tdresser
2016/07/26 12:27:41
Do we ever end up with -1 in the index_map_ now? I
lanwei
2016/07/28 04:47:23
In the constructor, the sourcetype is unknown. How
tdresser
2016/07/28 12:29:55
I'm not clear on what your proposal is here. If yo
| |
| 15 | 15 |
| 16 SyntheticPointerActionParams::SyntheticPointerActionParams( | 16 SyntheticPointerActionParams::SyntheticPointerActionParams( |
| 17 const SyntheticPointerActionParams& other) | 17 const SyntheticPointerActionParams& other) |
| 18 : SyntheticGestureParams(other), | 18 : SyntheticGestureParams(other), |
| 19 pointer_action_type_(other.pointer_action_type()) { | 19 pointer_action_type_(other.pointer_action_type()) { |
| 20 switch (other.pointer_action_type()) { | 20 switch (other.pointer_action_type()) { |
| 21 case PointerActionType::PRESS: | 21 case PointerActionType::PRESS: |
| 22 case PointerActionType::MOVE: | 22 case PointerActionType::MOVE: |
| 23 index_ = other.index(); | 23 index_ = other.index(); |
| 24 position_ = other.position(); | 24 position_ = other.position(); |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 39 } | 39 } |
| 40 | 40 |
| 41 const SyntheticPointerActionParams* SyntheticPointerActionParams::Cast( | 41 const SyntheticPointerActionParams* SyntheticPointerActionParams::Cast( |
| 42 const SyntheticGestureParams* gesture_params) { | 42 const SyntheticGestureParams* gesture_params) { |
| 43 DCHECK(gesture_params); | 43 DCHECK(gesture_params); |
| 44 DCHECK_EQ(POINTER_ACTION, gesture_params->GetGestureType()); | 44 DCHECK_EQ(POINTER_ACTION, gesture_params->GetGestureType()); |
| 45 return static_cast<const SyntheticPointerActionParams*>(gesture_params); | 45 return static_cast<const SyntheticPointerActionParams*>(gesture_params); |
| 46 } | 46 } |
| 47 | 47 |
| 48 } // namespace content | 48 } // namespace content |
| OLD | NEW |