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

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

Issue 13931009: Add latency info to input events sent to RenderWidget. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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_TOUCHSCREEN_TAP_SUPPRESSION_CONTROLLER_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_TOUCHSCREEN_TAP_SUPPRESSION_CONTROLLER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_TOUCHSCREEN_TAP_SUPPRESSION_CONTROLLER_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_TOUCHSCREEN_TAP_SUPPRESSION_CONTROLLER_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "content/browser/renderer_host/gesture_event_filter.h"
9 #include "content/browser/renderer_host/tap_suppression_controller_client.h" 10 #include "content/browser/renderer_host/tap_suppression_controller_client.h"
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
11 11
12 namespace content { 12 namespace content {
13 13
14 class GestureEventFilter; 14 class GestureEventFilter;
15 class TapSuppressionController; 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 explicit TouchscreenTapSuppressionController(GestureEventFilter* gef); 22 explicit TouchscreenTapSuppressionController(GestureEventFilter* gef);
23 virtual ~TouchscreenTapSuppressionController(); 23 virtual ~TouchscreenTapSuppressionController();
24 24
25 // Should be called on arrival of GestureFlingCancel events. 25 // Should be called on arrival of GestureFlingCancel events.
26 void GestureFlingCancel(); 26 void GestureFlingCancel();
27 27
28 // Should be called on arrival of ACK for a GestureFlingCancel event. 28 // Should be called on arrival of ACK for a GestureFlingCancel event.
29 // |processed| is true if the GestureFlingCancel successfully stopped a fling. 29 // |processed| is true if the GestureFlingCancel successfully stopped a fling.
30 void GestureFlingCancelAck(bool processed); 30 void GestureFlingCancelAck(bool processed);
31 31
32 // Should be called on arrival of GestureTapDown events. Returns true if the 32 // Should be called on arrival of GestureTapDown events. Returns true if the
33 // caller should stop normal handling of the GestureTapDown. In this case, the 33 // caller should stop normal handling of the GestureTapDown. In this case, the
34 // caller is responsible for saving the event for later use, if needed. 34 // caller is responsible for saving the event for later use, if needed.
35 bool ShouldDeferGestureTapDown(const WebKit::WebGestureEvent& event); 35 bool ShouldDeferGestureTapDown(const GestureEventWithLatencyInfo& event);
36 36
37 // Should be called on arrival of GestureTap events. Returns true if the 37 // Should be called on arrival of GestureTap events. Returns true if the
38 // caller should stop normal handling of the GestureTap. 38 // caller should stop normal handling of the GestureTap.
39 bool ShouldSuppressGestureTap(); 39 bool ShouldSuppressGestureTap();
40 40
41 // Should be called on arrival of GestureTapCancel events. Returns true if the 41 // Should be called on arrival of GestureTapCancel events. Returns true if the
42 // caller should stop normal handling of the GestureTapCancel. 42 // caller should stop normal handling of the GestureTapCancel.
43 bool ShouldSuppressGestureTapCancel(); 43 bool ShouldSuppressGestureTapCancel();
44 44
45 private: 45 private:
46 // TapSuppressionControllerClient implementation. 46 // TapSuppressionControllerClient implementation.
47 virtual int MaxCancelToDownTimeInMs() OVERRIDE; 47 virtual int MaxCancelToDownTimeInMs() OVERRIDE;
48 virtual int MaxTapGapTimeInMs() OVERRIDE; 48 virtual int MaxTapGapTimeInMs() OVERRIDE;
49 virtual void DropStashedTapDown() OVERRIDE; 49 virtual void DropStashedTapDown() OVERRIDE;
50 virtual void ForwardStashedTapDownForDeferral() OVERRIDE; 50 virtual void ForwardStashedTapDownForDeferral() OVERRIDE;
51 virtual void ForwardStashedTapDownSkipDeferral() OVERRIDE; 51 virtual void ForwardStashedTapDownSkipDeferral() OVERRIDE;
52 52
53 GestureEventFilter* gesture_event_filter_; 53 GestureEventFilter* gesture_event_filter_;
54 WebKit::WebGestureEvent stashed_tap_down_; 54 GestureEventWithLatencyInfo stashed_tap_down_;
55 55
56 // The core controller of tap suppression. 56 // The core controller of tap suppression.
57 scoped_ptr<TapSuppressionController> controller_; 57 scoped_ptr<TapSuppressionController> controller_;
58 58
59 DISALLOW_COPY_AND_ASSIGN(TouchscreenTapSuppressionController); 59 DISALLOW_COPY_AND_ASSIGN(TouchscreenTapSuppressionController);
60 }; 60 };
61 61
62 } // namespace content 62 } // namespace content
63 63
64 #endif // CONTENT_BROWSER_RENDERER_HOST_TOUCHSCREEN_TAP_SUPPRESSION_CONTROLLER_ H_ 64 #endif // CONTENT_BROWSER_RENDERER_HOST_TOUCHSCREEN_TAP_SUPPRESSION_CONTROLLER_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698