| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 uint32 MotionEventGeneric::GetUniqueEventId() const { | 73 uint32 MotionEventGeneric::GetUniqueEventId() const { |
| 74 return unique_event_id_; | 74 return unique_event_id_; |
| 75 } | 75 } |
| 76 | 76 |
| 77 MotionEvent::Action MotionEventGeneric::GetAction() const { | 77 MotionEvent::Action MotionEventGeneric::GetAction() const { |
| 78 return action_; | 78 return action_; |
| 79 } | 79 } |
| 80 | 80 |
| 81 int MotionEventGeneric::GetActionIndex() const { | 81 int MotionEventGeneric::GetActionIndex() const { |
| 82 DCHECK(action_ == ACTION_POINTER_DOWN || action_ == ACTION_POINTER_UP); | 82 DCHECK(action_ != ACTION_DOWN && action_ != ACTION_UP); |
| 83 DCHECK_GE(action_index_, 0); | 83 DCHECK_GE(action_index_, 0); |
| 84 DCHECK_LT(action_index_, static_cast<int>(pointers_->size())); | 84 DCHECK_LT(action_index_, static_cast<int>(pointers_->size())); |
| 85 return action_index_; | 85 return action_index_; |
| 86 } | 86 } |
| 87 | 87 |
| 88 size_t MotionEventGeneric::GetPointerCount() const { | 88 size_t MotionEventGeneric::GetPointerCount() const { |
| 89 return pointers_->size(); | 89 return pointers_->size(); |
| 90 } | 90 } |
| 91 | 91 |
| 92 int MotionEventGeneric::GetPointerId(size_t pointer_index) const { | 92 int MotionEventGeneric::GetPointerId(size_t pointer_index) const { |
| (...skipping 181 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 |