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

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

Issue 12087140: Suppress touchscreen tap immediately after a GestureFlingCancel (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Allowed GFC Ack in NOTHING state + Resolved a link error on win Created 7 years, 9 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_TOUCHSCREEN_TAP_SUPPRESSION_CONTROLLER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_TOUCHSCREEN_TAP_SUPPRESSION_CONTROLLER_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "content/browser/renderer_host/tap_suppression_controller_client.h"
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
11
12 namespace content {
13
14 class GestureEventFilter;
15 class TapSuppressionController;
16
17 // Controls the suppression of touchscreen taps immediately following the
18 // dispatch of a GestureFlingCancel event.
19 class TouchscreenTapSuppressionController
20 : public TapSuppressionControllerClient {
21 public:
22 explicit TouchscreenTapSuppressionController(GestureEventFilter* gef);
23 virtual ~TouchscreenTapSuppressionController();
24
25 // Should be called on arrival of GestureFlingCancel events.
26 void GestureFlingCancel();
27
28 // Should be called on arrival of ACK for a GestureFlingCancel event.
29 // |processed| is true if the GestureFlingCancel successfully stopped a fling.
30 void GestureFlingCancelAck(bool processed);
31
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
34 // caller is responsible for saving the event for later use, if needed.
35 bool ShouldDeferGestureTapDown(const WebKit::WebGestureEvent& event);
36
37 // Should be called on arrival of GestureTap events. Returns true if the
38 // caller should stop normal handling of the GestureTap.
39 bool ShouldSuppressGestureTap();
40
41 // Should be called on arrival of GestureTapCancel events. Returns true if the
42 // caller should stop normal handling of the GestureTapCancel.
43 bool ShouldSuppressGestureTapCancel();
44
45 private:
46 // TapSuppressionControllerClient implementation.
47 virtual int MaxCancelToDownTimeInMs() OVERRIDE;
48 virtual int MaxTapGapTimeInMs() OVERRIDE;
49 virtual void DropStashedTapDown() OVERRIDE;
50 virtual void ForwardStashedTapDownForDeferral() OVERRIDE;
51 virtual void ForwardStashedTapDownSkipDeferral() OVERRIDE;
52
53 GestureEventFilter* gesture_event_filter_;
54 WebKit::WebGestureEvent stashed_tap_down_;
55
56 // The core controller of tap suppression.
57 scoped_ptr<TapSuppressionController> controller_;
58
59 DISALLOW_COPY_AND_ASSIGN(TouchscreenTapSuppressionController);
60 };
61
62 } // namespace content
63
64 #endif // CONTENT_BROWSER_RENDERER_HOST_TOUCHSCREEN_TAP_SUPPRESSION_CONTROLLER_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698