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

Unified Diff: ui/events/gesture_event_details.h

Issue 565583005: Clean up GestureEventDetails constructors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Upload to the most recent patch Created 6 years, 3 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
Index: ui/events/gesture_event_details.h
diff --git a/ui/events/gesture_event_details.h b/ui/events/gesture_event_details.h
index 58d28fa7f946ce4c73a3af3ba33f8179b21217ad..da7a60bef2a87217c6c4e0082f3230ee46c2be84 100644
--- a/ui/events/gesture_event_details.h
+++ b/ui/events/gesture_event_details.h
@@ -16,6 +16,7 @@ namespace ui {
struct EVENTS_BASE_EXPORT GestureEventDetails {
public:
GestureEventDetails();
+ explicit GestureEventDetails(EventType type);
GestureEventDetails(EventType type, float delta_x, float delta_y);
EventType type() const { return type_; }
@@ -123,6 +124,12 @@ struct EVENTS_BASE_EXPORT GestureEventDetails {
data.tap_count = tap_count;
}
+ void set_scale(float scale) {
+ DCHECK_GE(scale, 0.0f);
+ DCHECK_EQ(type_, ET_GESTURE_PINCH_UPDATE);
+ data.scale = scale;
+ }
+
private:
EventType type_;
union Details {
« no previous file with comments | « ui/events/gesture_detection/touch_disposition_gesture_filter_unittest.cc ('k') | ui/events/gesture_event_details.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698