| 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_buffer.h" | 5 #include "ui/events/gesture_detection/motion_event_buffer.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "ui/events/gesture_detection/motion_event.h" | 8 #include "ui/events/gesture_detection/motion_event.h" |
| 9 #include "ui/events/gesture_detection/motion_event_generic.h" | 9 #include "ui/events/gesture_detection/motion_event_generic.h" |
| 10 | 10 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 } else { | 155 } else { |
| 156 event->PushPointer(pointer); | 156 event->PushPointer(pointer); |
| 157 } | 157 } |
| 158 } | 158 } |
| 159 | 159 |
| 160 DCHECK(event); | 160 DCHECK(event); |
| 161 event->set_id(event0.GetId()); | 161 event->set_id(event0.GetId()); |
| 162 event->set_action_index(event0.GetActionIndex()); | 162 event->set_action_index(event0.GetActionIndex()); |
| 163 event->set_button_state(event0.GetButtonState()); | 163 event->set_button_state(event0.GetButtonState()); |
| 164 | 164 |
| 165 return event.PassAs<MotionEvent>(); | 165 return event.Pass(); |
| 166 } | 166 } |
| 167 | 167 |
| 168 // MotionEvent implementation for storing multiple events, with the most | 168 // MotionEvent implementation for storing multiple events, with the most |
| 169 // recent event used as the base event, and prior events used as the history. | 169 // recent event used as the base event, and prior events used as the history. |
| 170 class CompoundMotionEvent : public ui::MotionEvent { | 170 class CompoundMotionEvent : public ui::MotionEvent { |
| 171 public: | 171 public: |
| 172 explicit CompoundMotionEvent(MotionEventVector events) | 172 explicit CompoundMotionEvent(MotionEventVector events) |
| 173 : events_(events.Pass()) { | 173 : events_(events.Pass()) { |
| 174 DCHECK_GE(events_.size(), 1U); | 174 DCHECK_GE(events_.size(), 1U); |
| 175 } | 175 } |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 events.weak_clear(); | 455 events.weak_clear(); |
| 456 client_->ForwardMotionEvent(*event); | 456 client_->ForwardMotionEvent(*event); |
| 457 return; | 457 return; |
| 458 } | 458 } |
| 459 | 459 |
| 460 CompoundMotionEvent compound_event(events.Pass()); | 460 CompoundMotionEvent compound_event(events.Pass()); |
| 461 client_->ForwardMotionEvent(compound_event); | 461 client_->ForwardMotionEvent(compound_event); |
| 462 } | 462 } |
| 463 | 463 |
| 464 } // namespace ui | 464 } // namespace ui |
| OLD | NEW |