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

Side by Side Diff: content/browser/renderer_host/input/touchscreen_tap_suppression_controller.h

Issue 260923003: Revert of Consolidate all touch/gesture related constants in content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCHSCREEN_TAP_SUPPRESSION_CONTROLL ER_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCHSCREEN_TAP_SUPPRESSION_CONTROLL ER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCHSCREEN_TAP_SUPPRESSION_CONTROLL ER_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCHSCREEN_TAP_SUPPRESSION_CONTROLL ER_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "content/browser/renderer_host/input/tap_suppression_controller.h" 9 #include "content/browser/renderer_host/input/gesture_event_queue.h"
10 #include "content/browser/renderer_host/input/tap_suppression_controller_client. h" 10 #include "content/browser/renderer_host/input/tap_suppression_controller_client. h"
11 #include "content/port/browser/event_with_latency_info.h"
12 11
13 namespace content { 12 namespace content {
14 13
15 class GestureEventQueue; 14 class GestureEventQueue;
15 class TapSuppressionController;
16 16
17 // Controls the suppression of touchscreen taps immediately following the 17 // Controls the suppression of touchscreen taps immediately following the
18 // dispatch of a GestureFlingCancel event. 18 // dispatch of a GestureFlingCancel event.
19 class TouchscreenTapSuppressionController 19 class TouchscreenTapSuppressionController
20 : public TapSuppressionControllerClient { 20 : public TapSuppressionControllerClient {
21 public: 21 public:
22 TouchscreenTapSuppressionController( 22 explicit TouchscreenTapSuppressionController(GestureEventQueue* geq);
23 GestureEventQueue* geq,
24 const TapSuppressionController::Config& config);
25 virtual ~TouchscreenTapSuppressionController(); 23 virtual ~TouchscreenTapSuppressionController();
26 24
27 // Should be called on arrival of GestureFlingCancel events. 25 // Should be called on arrival of GestureFlingCancel events.
28 void GestureFlingCancel(); 26 void GestureFlingCancel();
29 27
30 // Should be called on arrival of ACK for a GestureFlingCancel event. 28 // Should be called on arrival of ACK for a GestureFlingCancel event.
31 // |processed| is true if the GestureFlingCancel successfully stopped a fling. 29 // |processed| is true if the GestureFlingCancel successfully stopped a fling.
32 void GestureFlingCancelAck(bool processed); 30 void GestureFlingCancelAck(bool processed);
33 31
34 // Should be called on arrival of any tap-related events. Returns true if the 32 // Should be called on arrival of any tap-related events. Returns true if the
35 // caller should stop normal handling of the gesture. 33 // caller should stop normal handling of the gesture.
36 bool FilterTapEvent(const GestureEventWithLatencyInfo& event); 34 bool FilterTapEvent(const GestureEventWithLatencyInfo& event);
37 35
38 private: 36 private:
39 // TapSuppressionControllerClient implementation. 37 // TapSuppressionControllerClient implementation.
38 virtual int MaxCancelToDownTimeInMs() OVERRIDE;
39 virtual int MaxTapGapTimeInMs() OVERRIDE;
40 virtual void DropStashedTapDown() OVERRIDE; 40 virtual void DropStashedTapDown() OVERRIDE;
41 virtual void ForwardStashedTapDown() OVERRIDE; 41 virtual void ForwardStashedTapDown() OVERRIDE;
42 42
43 GestureEventQueue* gesture_event_queue_; 43 GestureEventQueue* gesture_event_queue_;
44 44
45 typedef scoped_ptr<GestureEventWithLatencyInfo> ScopedGestureEvent; 45 typedef scoped_ptr<GestureEventWithLatencyInfo> ScopedGestureEvent;
46 ScopedGestureEvent stashed_tap_down_; 46 ScopedGestureEvent stashed_tap_down_;
47 ScopedGestureEvent stashed_show_press_; 47 ScopedGestureEvent stashed_show_press_;
48 48
49 // The core controller of tap suppression. 49 // The core controller of tap suppression.
50 TapSuppressionController controller_; 50 scoped_ptr<TapSuppressionController> controller_;
51 51
52 DISALLOW_COPY_AND_ASSIGN(TouchscreenTapSuppressionController); 52 DISALLOW_COPY_AND_ASSIGN(TouchscreenTapSuppressionController);
53 }; 53 };
54 54
55 } // namespace content 55 } // namespace content
56 56
57 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCHSCREEN_TAP_SUPPRESSION_CONTR OLLER_H_ 57 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCHSCREEN_TAP_SUPPRESSION_CONTR OLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698