summaryrefslogtreecommitdiff
path: root/chromium/ui/events/gesture_event_details.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-06-18 14:10:49 +0200
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-06-18 13:53:24 +0000
commit813fbf95af77a531c57a8c497345ad2c61d475b3 (patch)
tree821b2c8de8365f21b6c9ba17a236fb3006a1d506 /chromium/ui/events/gesture_event_details.cc
parentaf6588f8d723931a298c995fa97259bb7f7deb55 (diff)
downloadqtwebengine-chromium-813fbf95af77a531c57a8c497345ad2c61d475b3.tar.gz
BASELINE: Update chromium to 44.0.2403.47
Change-Id: Ie056fedba95cf5e5c76b30c4b2c80fca4764aa2f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'chromium/ui/events/gesture_event_details.cc')
-rw-r--r--chromium/ui/events/gesture_event_details.cc51
1 files changed, 39 insertions, 12 deletions
diff --git a/chromium/ui/events/gesture_event_details.cc b/chromium/ui/events/gesture_event_details.cc
index 780713118d3..e14fb17302a 100644
--- a/chromium/ui/events/gesture_event_details.cc
+++ b/chromium/ui/events/gesture_event_details.cc
@@ -24,30 +24,30 @@ GestureEventDetails::GestureEventDetails(ui::EventType type,
DCHECK_LE(type, ET_GESTURE_TYPE_END);
switch (type_) {
case ui::ET_GESTURE_SCROLL_BEGIN:
- data.scroll_begin.x_hint = delta_x;
- data.scroll_begin.y_hint = delta_y;
+ data_.scroll_begin.x_hint = delta_x;
+ data_.scroll_begin.y_hint = delta_y;
break;
case ui::ET_GESTURE_SCROLL_UPDATE:
- data.scroll_update.x = delta_x;
- data.scroll_update.y = delta_y;
+ data_.scroll_update.x = delta_x;
+ data_.scroll_update.y = delta_y;
break;
case ui::ET_SCROLL_FLING_START:
- data.fling_velocity.x = delta_x;
- data.fling_velocity.y = delta_y;
+ data_.fling_velocity.x = delta_x;
+ data_.fling_velocity.y = delta_y;
break;
case ui::ET_GESTURE_TWO_FINGER_TAP:
- data.first_finger_enclosing_rectangle.width = delta_x;
- data.first_finger_enclosing_rectangle.height = delta_y;
+ data_.first_finger_enclosing_rectangle.width = delta_x;
+ data_.first_finger_enclosing_rectangle.height = delta_y;
break;
case ui::ET_GESTURE_SWIPE:
- data.swipe.left = delta_x < 0;
- data.swipe.right = delta_x > 0;
- data.swipe.up = delta_y < 0;
- data.swipe.down = delta_y > 0;
+ data_.swipe.left = delta_x < 0;
+ data_.swipe.right = delta_x > 0;
+ data_.swipe.up = delta_y < 0;
+ data_.swipe.down = delta_y > 0;
break;
default:
@@ -55,6 +55,33 @@ GestureEventDetails::GestureEventDetails(ui::EventType type,
}
}
+GestureEventDetails::GestureEventDetails(ui::EventType type,
+ const GestureEventDetails& other)
+ : type_(type),
+ data_(other.data_),
+ touch_points_(other.touch_points_),
+ bounding_box_(other.bounding_box_),
+ oldest_touch_id_(other.oldest_touch_id_) {
+ DCHECK_GE(type, ET_GESTURE_TYPE_START);
+ DCHECK_LE(type, ET_GESTURE_TYPE_END);
+ switch (type) {
+ case ui::ET_GESTURE_SCROLL_BEGIN:
+ // Synthetic creation of SCROLL_BEGIN from PINCH_BEGIN is explicitly
+ // allowed as an exception.
+ if (other.type() == ui::ET_GESTURE_PINCH_BEGIN)
+ break;
+ case ui::ET_GESTURE_SCROLL_UPDATE:
+ case ui::ET_SCROLL_FLING_START:
+ case ui::ET_GESTURE_SWIPE:
+ case ui::ET_GESTURE_PINCH_UPDATE:
+ DCHECK_EQ(type, other.type()) << " - Invalid gesture conversion from "
+ << other.type() << " to " << type;
+ break;
+ default:
+ break;
+ }
+}
+
GestureEventDetails::Details::Details() {
memset(this, 0, sizeof(Details));
}