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

Unified Diff: ui/events/gesture_detection/filtered_gesture_provider.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/events.gyp ('k') | ui/events/gesture_detection/filtered_gesture_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/gesture_detection/filtered_gesture_provider.h
diff --git a/ui/events/gesture_detection/filtered_gesture_provider.h b/ui/events/gesture_detection/filtered_gesture_provider.h
index f54b29085f9053279c4074d4e406ec40617e3dc5..a045fe3c97350bf1c1c72871f270b1768ce6b4d5 100644
--- a/ui/events/gesture_detection/filtered_gesture_provider.h
+++ b/ui/events/gesture_detection/filtered_gesture_provider.h
@@ -6,6 +6,7 @@
#define UI_EVENTS_GESTURE_DETECTION_FILTERED_GESTURE_PROVIDER_H_
#include "base/basictypes.h"
+#include "base/compiler_specific.h"
#include "ui/events/gesture_detection/gesture_event_data_packet.h"
#include "ui/events/gesture_detection/gesture_provider.h"
#include "ui/events/gesture_detection/touch_disposition_gesture_filter.h"
@@ -23,10 +24,21 @@ class GESTURE_DETECTION_EXPORT FilteredGestureProvider
FilteredGestureProvider(const GestureProvider::Config& config,
GestureProviderClient* client);
- // Returns true if |event| was both valid and successfully handled by the
- // gesture provider. Otherwise, returns false, in which case the caller
- // should drop |event|, not forwarding it to the renderer.
- bool OnTouchEvent(const MotionEvent& event);
+ struct TouchHandlingResult {
+ TouchHandlingResult();
+
+ // True if |event| was both valid and successfully handled by the
+ // gesture provider. Otherwise, false, in which case the caller should drop
+ // |event| and cease furthe propagation.
+ bool succeeded;
+
+ // Whether |event| produced scrolling motion, either the start of a scroll,
+ // subsequent scroll movement or a fling event.
+ // TODO(jdduke): Figure out a way to guarantee that this bit propagates with
+ // the processed touch event as it moves downstream.
+ bool did_generate_scroll;
+ };
+ TouchHandlingResult OnTouchEvent(const MotionEvent& event) WARN_UNUSED_RESULT;
// To be called upon ack of an event that was forwarded after a successful
// call to |OnTouchEvent()|.
@@ -52,6 +64,7 @@ class GESTURE_DETECTION_EXPORT FilteredGestureProvider
ui::TouchDispositionGestureFilter gesture_filter_;
bool handling_event_;
+ bool last_touch_event_did_generate_scroll_;
ui::GestureEventDataPacket pending_gesture_packet_;
DISALLOW_COPY_AND_ASSIGN(FilteredGestureProvider);
« no previous file with comments | « ui/events/events.gyp ('k') | ui/events/gesture_detection/filtered_gesture_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698