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

Unified Diff: ui/events/gesture_detection/gesture_event_data_packet.cc

Issue 407563002: Allow any number of gestures to be constructed per touch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/gesture_detection/gesture_event_data_packet.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/gesture_detection/gesture_event_data_packet.cc
diff --git a/ui/events/gesture_detection/gesture_event_data_packet.cc b/ui/events/gesture_detection/gesture_event_data_packet.cc
index f083169868990226c8528bd48c2890334959f48f..09adceca475f680be985d8971be3485b54e06722 100644
--- a/ui/events/gesture_detection/gesture_event_data_packet.cc
+++ b/ui/events/gesture_detection/gesture_event_data_packet.cc
@@ -33,7 +33,7 @@ GestureEventDataPacket::GestureSource ToGestureSource(
} // namespace
GestureEventDataPacket::GestureEventDataPacket()
- : gesture_count_(0), gesture_source_(UNDEFINED) {
+ : gesture_source_(UNDEFINED) {
}
GestureEventDataPacket::GestureEventDataPacket(
@@ -42,7 +42,6 @@ GestureEventDataPacket::GestureEventDataPacket(
const gfx::PointF& touch_location,
const gfx::PointF& raw_touch_location)
: timestamp_(timestamp),
- gesture_count_(0),
touch_location_(touch_location),
raw_touch_location_(raw_touch_location),
gesture_source_(source) {
@@ -52,11 +51,10 @@ GestureEventDataPacket::GestureEventDataPacket(
GestureEventDataPacket::GestureEventDataPacket(
const GestureEventDataPacket& other)
: timestamp_(other.timestamp_),
- gesture_count_(other.gesture_count_),
+ gestures_(other.gestures_),
touch_location_(other.touch_location_),
raw_touch_location_(other.raw_touch_location_),
gesture_source_(other.gesture_source_) {
- std::copy(other.gestures_, other.gestures_ + other.gesture_count_, gestures_);
}
GestureEventDataPacket::~GestureEventDataPacket() {
@@ -65,18 +63,16 @@ GestureEventDataPacket::~GestureEventDataPacket() {
GestureEventDataPacket& GestureEventDataPacket::operator=(
const GestureEventDataPacket& other) {
timestamp_ = other.timestamp_;
- gesture_count_ = other.gesture_count_;
gesture_source_ = other.gesture_source_;
touch_location_ = other.touch_location_;
raw_touch_location_ = other.raw_touch_location_;
- std::copy(other.gestures_, other.gestures_ + other.gesture_count_, gestures_);
+ gestures_ = other.gestures_;
return *this;
}
void GestureEventDataPacket::Push(const GestureEventData& gesture) {
DCHECK_NE(ET_UNKNOWN, gesture.type());
- CHECK_LT(gesture_count_, static_cast<size_t>(kMaxGesturesPerTouch));
- gestures_[gesture_count_++] = gesture;
+ gestures_.push_back(gesture);
}
GestureEventDataPacket GestureEventDataPacket::FromTouch(
« no previous file with comments | « ui/events/gesture_detection/gesture_event_data_packet.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698