#ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCHSCREEN_TAP_SUPPRESSION_CONTROLLER_H_
#define CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCHSCREEN_TAP_SUPPRESSION_CONTROLLER_H_
#include "base/memory/scoped_ptr.h"
#include "content/browser/renderer_host/input/gesture_event_queue.h"
#include "content/browser/renderer_host/input/tap_suppression_controller_client.h"
namespace content {
class GestureEventQueue;
class TapSuppressionController;
class TouchscreenTapSuppressionController
: public TapSuppressionControllerClient {
public:
explicit TouchscreenTapSuppressionController(GestureEventQueue* geq);
virtual ~TouchscreenTapSuppressionController();
void GestureFlingCancel();
void GestureFlingCancelAck(bool processed);
bool ShouldDeferGestureTapDown(const GestureEventWithLatencyInfo& event);
bool ShouldDeferGestureShowPress(const GestureEventWithLatencyInfo& event);
bool ShouldSuppressGestureTapEnd();
private:
virtual int MaxCancelToDownTimeInMs() OVERRIDE;
virtual int MaxTapGapTimeInMs() OVERRIDE;
virtual void DropStashedTapDown() OVERRIDE;
virtual void ForwardStashedTapDown() OVERRIDE;
GestureEventQueue* gesture_event_queue_;
typedef scoped_ptr<GestureEventWithLatencyInfo> ScopedGestureEvent;
ScopedGestureEvent stashed_tap_down_;
ScopedGestureEvent stashed_show_press_;
scoped_ptr<TapSuppressionController> controller_;
DISALLOW_COPY_AND_ASSIGN(TouchscreenTapSuppressionController);
};
}
#endif