| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/events/gesture_detection/motion_event_generic.h" | 5 #include "ui/events/gesture_detection/motion_event_generic.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ui/events/base_event_utils.h" | 8 #include "ui/events/base_event_utils.h" |
| 9 | 9 |
| 10 namespace ui { | 10 namespace ui { |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 pointers_->erase(pointers_->begin() + index); | 210 pointers_->erase(pointers_->begin() + index); |
| 211 } | 211 } |
| 212 | 212 |
| 213 void MotionEventGeneric::PushHistoricalEvent(scoped_ptr<MotionEvent> event) { | 213 void MotionEventGeneric::PushHistoricalEvent(scoped_ptr<MotionEvent> event) { |
| 214 DCHECK(event); | 214 DCHECK(event); |
| 215 DCHECK_EQ(event->GetAction(), ACTION_MOVE); | 215 DCHECK_EQ(event->GetAction(), ACTION_MOVE); |
| 216 DCHECK_EQ(event->GetPointerCount(), GetPointerCount()); | 216 DCHECK_EQ(event->GetPointerCount(), GetPointerCount()); |
| 217 DCHECK_EQ(event->GetAction(), GetAction()); | 217 DCHECK_EQ(event->GetAction(), GetAction()); |
| 218 DCHECK_LE(event->GetEventTime().ToInternalValue(), | 218 DCHECK_LE(event->GetEventTime().ToInternalValue(), |
| 219 GetEventTime().ToInternalValue()); | 219 GetEventTime().ToInternalValue()); |
| 220 historical_events_.push_back(event.release()); | 220 historical_events_.push_back(event.Pass()); |
| 221 } | 221 } |
| 222 | 222 |
| 223 MotionEventGeneric::MotionEventGeneric() | 223 MotionEventGeneric::MotionEventGeneric() |
| 224 : action_(ACTION_CANCEL), | 224 : action_(ACTION_CANCEL), |
| 225 unique_event_id_(ui::GetNextTouchEventId()), | 225 unique_event_id_(ui::GetNextTouchEventId()), |
| 226 action_index_(0), | 226 action_index_(0), |
| 227 button_state_(0) { | 227 button_state_(0) { |
| 228 } | 228 } |
| 229 | 229 |
| 230 MotionEventGeneric::MotionEventGeneric(const MotionEvent& event, | 230 MotionEventGeneric::MotionEventGeneric(const MotionEvent& event, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 PushHistoricalEvent(other.historical_events_[h]->Clone()); | 274 PushHistoricalEvent(other.historical_events_[h]->Clone()); |
| 275 return *this; | 275 return *this; |
| 276 } | 276 } |
| 277 | 277 |
| 278 void MotionEventGeneric::PopPointer() { | 278 void MotionEventGeneric::PopPointer() { |
| 279 DCHECK_GT(pointers_->size(), 0U); | 279 DCHECK_GT(pointers_->size(), 0U); |
| 280 pointers_->pop_back(); | 280 pointers_->pop_back(); |
| 281 } | 281 } |
| 282 | 282 |
| 283 } // namespace ui | 283 } // namespace ui |
| OLD | NEW |