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

Unified Diff: ui/events/event.h

Issue 718153002: Indicate whether a touch event will cause scrolling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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/BUILD.gn ('k') | ui/events/event.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/event.h
diff --git a/ui/events/event.h b/ui/events/event.h
index 56fd74c85d53d17d000fa1b9c6c0796104379056..a2f50c26d0b4c7096223fe9ca4d9831705021694 100644
--- a/ui/events/event.h
+++ b/ui/events/event.h
@@ -491,8 +491,8 @@ class EVENTS_EXPORT TouchEvent : public LocatedEvent {
radius_x_(model.radius_x_),
radius_y_(model.radius_y_),
rotation_angle_(model.rotation_angle_),
- force_(model.force_) {
- }
+ force_(model.force_),
+ causes_scrolling_(model.causes_scrolling_) {}
TouchEvent(EventType type,
const gfx::PointF& location,
@@ -517,6 +517,9 @@ class EVENTS_EXPORT TouchEvent : public LocatedEvent {
float rotation_angle() const { return rotation_angle_; }
float force() const { return force_; }
+ void set_causes_scrolling(bool causes) { causes_scrolling_ = causes; }
+ bool causes_scrolling() const { return causes_scrolling_; }
+
// Used for unit tests.
void set_radius_x(const float r) { radius_x_ = r; }
void set_radius_y(const float r) { radius_y_ = r; }
@@ -553,6 +556,12 @@ class EVENTS_EXPORT TouchEvent : public LocatedEvent {
// Force (pressure) of the touch. Normalized to be [0, 1]. Default to be 0.0.
float force_;
+
+ // Whether the (unhandled) touch event will produce a scroll event (i.e., it's
+ // a touchmove and exceeds the platform slop region). Defaults to false.
+ // TODO(jdduke): Expose additional gesture event types that will result if the
+ // touch goes unconsumed.
+ bool causes_scrolling_;
};
// An interface that individual platforms can use to store additional data on
« no previous file with comments | « ui/events/BUILD.gn ('k') | ui/events/event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698