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

Side by Side Diff: ui/events/gesture_detection/gesture_provider.h

Issue 223673006: Support GestureBegin and GestureEnd in ui::GestureProvider (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_EVENTS_GESTURE_DETECTION_GESTURE_PROVIDER_H_ 5 #ifndef UI_EVENTS_GESTURE_DETECTION_GESTURE_PROVIDER_H_
6 #define UI_EVENTS_GESTURE_DETECTION_GESTURE_PROVIDER_H_ 6 #define UI_EVENTS_GESTURE_DETECTION_GESTURE_PROVIDER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "ui/events/gesture_detection/gesture_detection_export.h" 10 #include "ui/events/gesture_detection/gesture_detection_export.h"
(...skipping 15 matching lines...) Expand all
26 // event dispatch. 26 // event dispatch.
27 class GESTURE_DETECTION_EXPORT GestureProvider { 27 class GESTURE_DETECTION_EXPORT GestureProvider {
28 public: 28 public:
29 struct GESTURE_DETECTION_EXPORT Config { 29 struct GESTURE_DETECTION_EXPORT Config {
30 Config(); 30 Config();
31 ~Config(); 31 ~Config();
32 GestureDetector::Config gesture_detector_config; 32 GestureDetector::Config gesture_detector_config;
33 ScaleGestureDetector::Config scale_gesture_detector_config; 33 ScaleGestureDetector::Config scale_gesture_detector_config;
34 SnapScrollController::Config snap_scroll_controller_config; 34 SnapScrollController::Config snap_scroll_controller_config;
35 bool disable_click_delay; 35 bool disable_click_delay;
36 bool send_aura_specific_gestures;
jdduke (slow) 2014/04/03 20:17:16 Until we have more gestures, let's be specific wit
tdresser 2014/04/03 21:14:41 Done.
36 }; 37 };
37 38
38 GestureProvider(const Config& config, GestureProviderClient* client); 39 GestureProvider(const Config& config, GestureProviderClient* client);
39 ~GestureProvider(); 40 ~GestureProvider();
40 41
41 // Handle the incoming MotionEvent, returning false if the event could not 42 // Handle the incoming MotionEvent, returning false if the event could not
42 // be handled. 43 // be handled.
43 bool OnTouchEvent(const MotionEvent& event); 44 bool OnTouchEvent(const MotionEvent& event);
44 45
45 // Resets all gesture detectors; called on DidStartLoading(). 46 // Resets all gesture detectors; called on DidStartLoading().
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 void Fling(base::TimeTicks time, 87 void Fling(base::TimeTicks time,
87 float x, 88 float x,
88 float y, 89 float y,
89 float velocity_x, 90 float velocity_x,
90 float velocity_y); 91 float velocity_y);
91 void Send(const GestureEventData& gesture); 92 void Send(const GestureEventData& gesture);
92 void SendTapCancelIfNecessary(const MotionEvent& event); 93 void SendTapCancelIfNecessary(const MotionEvent& event);
93 bool SendLongTapIfNecessary(const MotionEvent& event); 94 bool SendLongTapIfNecessary(const MotionEvent& event);
94 void EndTouchScrollIfNecessary(base::TimeTicks time, 95 void EndTouchScrollIfNecessary(base::TimeTicks time,
95 bool send_scroll_end_event); 96 bool send_scroll_end_event);
97 void SendGestureBeginOrEndIfNecessary(const MotionEvent& event);
96 98
97 GestureProviderClient* const client_; 99 GestureProviderClient* const client_;
98 100
99 class GestureListenerImpl; 101 class GestureListenerImpl;
100 friend class GestureListenerImpl; 102 friend class GestureListenerImpl;
101 scoped_ptr<GestureListenerImpl> gesture_listener_; 103 scoped_ptr<GestureListenerImpl> gesture_listener_;
102 104
103 class ScaleGestureListenerImpl; 105 class ScaleGestureListenerImpl;
104 friend class ScaleGestureListenerImpl; 106 friend class ScaleGestureListenerImpl;
105 scoped_ptr<ScaleGestureListenerImpl> scale_gesture_listener_; 107 scoped_ptr<ScaleGestureListenerImpl> scale_gesture_listener_;
(...skipping 11 matching lines...) Expand all
117 119
118 // Whether the respective {SCROLL,PINCH}_BEGIN gestures have been terminated 120 // Whether the respective {SCROLL,PINCH}_BEGIN gestures have been terminated
119 // with a {SCROLL,PINCH}_END. 121 // with a {SCROLL,PINCH}_END.
120 bool touch_scroll_in_progress_; 122 bool touch_scroll_in_progress_;
121 bool pinch_in_progress_; 123 bool pinch_in_progress_;
122 124
123 // Keeps track of the current GESTURE_LONG_PRESS event. If a context menu is 125 // Keeps track of the current GESTURE_LONG_PRESS event. If a context menu is
124 // opened after a GESTURE_LONG_PRESS, this is used to insert a 126 // opened after a GESTURE_LONG_PRESS, this is used to insert a
125 // GESTURE_TAP_CANCEL for removing any ::active styling. 127 // GESTURE_TAP_CANCEL for removing any ::active styling.
126 base::TimeTicks current_longpress_time_; 128 base::TimeTicks current_longpress_time_;
129
130 bool send_aura_specific_gestures_;
127 }; 131 };
128 132
129 } // namespace ui 133 } // namespace ui
130 134
131 #endif // UI_EVENTS_GESTURE_DETECTION_GESTURE_PROVIDER_H_ 135 #endif // UI_EVENTS_GESTURE_DETECTION_GESTURE_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698