Chromium Code Reviews| Index: ui/events/gesture_detection/motion_event_generic.cc |
| diff --git a/ui/events/gesture_detection/motion_event_generic.cc b/ui/events/gesture_detection/motion_event_generic.cc |
| index 475e9c5bc808eb3d40f042fd5a8aff751a4858c5..59f4c2b498b23346606f5c3c5c9e1e308fdaa079 100644 |
| --- a/ui/events/gesture_detection/motion_event_generic.cc |
| +++ b/ui/events/gesture_detection/motion_event_generic.cc |
| @@ -5,6 +5,7 @@ |
| #include "ui/events/gesture_detection/motion_event_generic.h" |
| #include "base/logging.h" |
| +#include "ui/events/base_event_utils.h" |
| namespace ui { |
| @@ -46,7 +47,7 @@ MotionEventGeneric::MotionEventGeneric(Action action, |
| const PointerProperties& pointer) |
| : action_(action), |
| event_time_(event_time), |
| - id_(0), |
| + unique_event_id_(ui::GetNextTouchEventId()), |
| action_index_(0), |
| button_state_(0), |
| flags_(0) { |
| @@ -56,7 +57,7 @@ MotionEventGeneric::MotionEventGeneric(Action action, |
| MotionEventGeneric::MotionEventGeneric(const MotionEventGeneric& other) |
| : action_(other.action_), |
| event_time_(other.event_time_), |
| - id_(other.id_), |
| + unique_event_id_(other.unique_event_id_), |
| action_index_(other.action_index_), |
| button_state_(other.button_state_), |
| flags_(other.flags_), |
| @@ -69,8 +70,8 @@ MotionEventGeneric::MotionEventGeneric(const MotionEventGeneric& other) |
| MotionEventGeneric::~MotionEventGeneric() { |
| } |
| -int MotionEventGeneric::GetId() const { |
| - return id_; |
| +uint64 MotionEventGeneric::GetUniqueEventId() const { |
| + return unique_event_id_; |
| } |
| MotionEvent::Action MotionEventGeneric::GetAction() const { |
| @@ -219,14 +220,17 @@ void MotionEventGeneric::PushHistoricalEvent(scoped_ptr<MotionEvent> event) { |
| } |
| MotionEventGeneric::MotionEventGeneric() |
| - : action_(ACTION_CANCEL), id_(0), action_index_(0), button_state_(0) { |
| + : action_(ACTION_CANCEL), |
| + unique_event_id_(ui::GetNextTouchEventId()), |
|
jdduke (slow)
2015/04/21 22:40:16
I can't say I love using globals, but this is prob
tdresser
2015/04/22 12:59:00
I agree, but I think that ensuring that these ids
lanwei
2015/04/22 20:51:31
I also agree, in many cases such as for different
|
| + action_index_(0), |
| + button_state_(0) { |
| } |
| MotionEventGeneric::MotionEventGeneric(const MotionEvent& event, |
| bool with_history) |
| : action_(event.GetAction()), |
| event_time_(event.GetEventTime()), |
| - id_(event.GetId()), |
| + unique_event_id_(event.GetUniqueEventId()), |
| action_index_( |
| (action_ == ACTION_POINTER_UP || action_ == ACTION_POINTER_DOWN) |
| ? event.GetActionIndex() |
| @@ -259,7 +263,7 @@ MotionEventGeneric& MotionEventGeneric::operator=( |
| const MotionEventGeneric& other) { |
| action_ = other.action_; |
| event_time_ = other.event_time_; |
| - id_ = other.id_; |
| + unique_event_id_ = other.unique_event_id_; |
| action_index_ = other.action_index_; |
| button_state_ = other.button_state_; |
| flags_ = other.flags_; |