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

Side by Side Diff: content/browser/renderer_host/touchpad_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, 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 (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_TOUCHPAD_TAP_SUPPRESSION_CONTROLLER_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_TOUCHPAD_TAP_SUPPRESSION_CONTROLLER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_TOUCHPAD_TAP_SUPPRESSION_CONTROLLER_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_TOUCHPAD_TAP_SUPPRESSION_CONTROLLER_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "cc/debug/latency_info.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 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
11 12
12 namespace content { 13 namespace content {
13 14
14 class RenderWidgetHostImpl; 15 class RenderWidgetHostImpl;
15 class TapSuppressionController; 16 class TapSuppressionController;
16 17
17 // Controls the suppression of touchpad taps immediately following the dispatch 18 // Controls the suppression of touchpad taps immediately following the dispatch
18 // of a GestureFlingCancel event. 19 // of a GestureFlingCancel event.
19 class TouchpadTapSuppressionController : public TapSuppressionControllerClient { 20 class TouchpadTapSuppressionController : public TapSuppressionControllerClient {
20 public: 21 public:
21 explicit TouchpadTapSuppressionController(RenderWidgetHostImpl* rwhv); 22 explicit TouchpadTapSuppressionController(RenderWidgetHostImpl* rwhv);
22 virtual ~TouchpadTapSuppressionController(); 23 virtual ~TouchpadTapSuppressionController();
23 24
24 // Should be called on arrival of GestureFlingCancel events. 25 // Should be called on arrival of GestureFlingCancel events.
25 void GestureFlingCancel(); 26 void GestureFlingCancel();
26 27
27 // Should be called on arrival of ACK for a GestureFlingCancel event. 28 // Should be called on arrival of ACK for a GestureFlingCancel event.
28 // |processed| is true if the GestureFlingCancel successfully stopped a fling. 29 // |processed| is true if the GestureFlingCancel successfully stopped a fling.
29 void GestureFlingCancelAck(bool processed); 30 void GestureFlingCancelAck(bool processed);
30 31
31 // Should be called on arrival of MouseDown events. Returns true if the caller 32 // Should be called on arrival of MouseDown events. Returns true if the caller
32 // should stop normal handling of the MouseDown. In this case, the caller is 33 // should stop normal handling of the MouseDown. In this case, the caller is
33 // responsible for saving the event for later use, if needed. 34 // responsible for saving the event for later use, if needed.
34 bool ShouldDeferMouseDown(const WebKit::WebMouseEvent& event); 35 bool ShouldDeferMouseDown(const WebKit::WebMouseEvent& event,
36 const cc::LatencyInfo& latency_info);
35 37
36 // Should be called on arrival of MouseUp events. Returns true if the caller 38 // Should be called on arrival of MouseUp events. Returns true if the caller
37 // should stop normal handling of the MouseUp. 39 // should stop normal handling of the MouseUp.
38 bool ShouldSuppressMouseUp(); 40 bool ShouldSuppressMouseUp();
39 41
40 private: 42 private:
41 friend class MockRenderWidgetHost; 43 friend class MockRenderWidgetHost;
42 44
43 // TapSuppressionControllerClient implementation. 45 // TapSuppressionControllerClient implementation.
44 virtual int MaxCancelToDownTimeInMs() OVERRIDE; 46 virtual int MaxCancelToDownTimeInMs() OVERRIDE;
45 virtual int MaxTapGapTimeInMs() OVERRIDE; 47 virtual int MaxTapGapTimeInMs() OVERRIDE;
46 virtual void DropStashedTapDown() OVERRIDE; 48 virtual void DropStashedTapDown() OVERRIDE;
47 virtual void ForwardStashedTapDownForDeferral() OVERRIDE; 49 virtual void ForwardStashedTapDownForDeferral() OVERRIDE;
48 virtual void ForwardStashedTapDownSkipDeferral() OVERRIDE; 50 virtual void ForwardStashedTapDownSkipDeferral() OVERRIDE;
49 51
50 RenderWidgetHostImpl* render_widget_host_; 52 RenderWidgetHostImpl* render_widget_host_;
51 WebKit::WebMouseEvent stashed_mouse_down_; 53 WebKit::WebMouseEvent stashed_mouse_down_;
54 cc::LatencyInfo stashed_latency_info_;
52 55
53 // The core controller of tap suppression. 56 // The core controller of tap suppression.
54 scoped_ptr<TapSuppressionController> controller_; 57 scoped_ptr<TapSuppressionController> controller_;
55 58
56 DISALLOW_COPY_AND_ASSIGN(TouchpadTapSuppressionController); 59 DISALLOW_COPY_AND_ASSIGN(TouchpadTapSuppressionController);
57 }; 60 };
58 61
59 } // namespace content 62 } // namespace content
60 63
61 #endif // CONTENT_BROWSER_RENDERER_HOST_TOUCHPAD_TAP_SUPPRESSION_CONTROLLER_H_ 64 #endif // CONTENT_BROWSER_RENDERER_HOST_TOUCHPAD_TAP_SUPPRESSION_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698