Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Side by Side Diff: ui/events/gesture_detection/gesture_event_data_packet.cc

Issue 1989623002: Suppressed MEs for gestures from cancelled PEs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/gesture_event_data_packet.h" 5 #include "ui/events/gesture_detection/gesture_event_data_packet.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/events/gesture_detection/motion_event.h" 8 #include "ui/events/gesture_detection/motion_event.h"
9 9
10 namespace ui { 10 namespace ui {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 timestamp_ = other.timestamp_; 75 timestamp_ = other.timestamp_;
76 gesture_source_ = other.gesture_source_; 76 gesture_source_ = other.gesture_source_;
77 touch_location_ = other.touch_location_; 77 touch_location_ = other.touch_location_;
78 raw_touch_location_ = other.raw_touch_location_; 78 raw_touch_location_ = other.raw_touch_location_;
79 gestures_ = other.gestures_; 79 gestures_ = other.gestures_;
80 ack_state_ = other.ack_state_; 80 ack_state_ = other.ack_state_;
81 unique_touch_event_id_ = other.unique_touch_event_id_; 81 unique_touch_event_id_ = other.unique_touch_event_id_;
82 return *this; 82 return *this;
83 } 83 }
84 84
85 void GestureEventDataPacket::Push(const GestureEventData& gesture) { 85 void GestureEventDataPacket::Push(const GestureEventData& original_gesture) {
86 DCHECK_NE(ET_UNKNOWN, gesture.type()); 86 DCHECK_NE(ET_UNKNOWN, original_gesture.type());
87 GestureEventData gesture(original_gesture);
88 gesture.unique_touch_event_id = unique_touch_event_id_;
87 gestures_->push_back(gesture); 89 gestures_->push_back(gesture);
88 } 90 }
89 91
90 GestureEventDataPacket GestureEventDataPacket::FromTouch( 92 GestureEventDataPacket GestureEventDataPacket::FromTouch(
91 const ui::MotionEvent& touch) { 93 const ui::MotionEvent& touch) {
92 return GestureEventDataPacket(touch.GetEventTime(), ToGestureSource(touch), 94 return GestureEventDataPacket(touch.GetEventTime(), ToGestureSource(touch),
93 gfx::PointF(touch.GetX(), touch.GetY()), 95 gfx::PointF(touch.GetX(), touch.GetY()),
94 gfx::PointF(touch.GetRawX(), touch.GetRawY()), 96 gfx::PointF(touch.GetRawX(), touch.GetRawY()),
95 touch.GetUniqueEventId()); 97 touch.GetUniqueEventId());
96 } 98 }
97 99
98 GestureEventDataPacket GestureEventDataPacket::FromTouchTimeout( 100 GestureEventDataPacket GestureEventDataPacket::FromTouchTimeout(
99 const GestureEventData& gesture) { 101 const GestureEventData& gesture) {
100 GestureEventDataPacket packet(gesture.time, TOUCH_TIMEOUT, 102 GestureEventDataPacket packet(gesture.time, TOUCH_TIMEOUT,
101 gfx::PointF(gesture.x, gesture.y), 103 gfx::PointF(gesture.x, gesture.y),
102 gfx::PointF(gesture.raw_x, gesture.raw_y), 0); 104 gfx::PointF(gesture.raw_x, gesture.raw_y),
105 gesture.unique_touch_event_id);
103 packet.Push(gesture); 106 packet.Push(gesture);
104 return packet; 107 return packet;
105 } 108 }
106 109
107 void GestureEventDataPacket::Ack(bool event_consumed) { 110 void GestureEventDataPacket::Ack(bool event_consumed) {
108 DCHECK_EQ(static_cast<int>(ack_state_), static_cast<int>(AckState::PENDING)); 111 DCHECK_EQ(static_cast<int>(ack_state_), static_cast<int>(AckState::PENDING));
109 ack_state_ = event_consumed ? AckState::CONSUMED : AckState::UNCONSUMED; 112 ack_state_ = event_consumed ? AckState::CONSUMED : AckState::UNCONSUMED;
110 } 113 }
111 114
112 } // namespace ui 115 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698