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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_TARGET_BASE_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_TARGET_BASE_H_
8 #include "base/time/time.h"
9 #include "content/browser/renderer_host/input/synthetic_gesture_target.h"
18 class WebMouseWheelEvent
;
23 class RenderWidgetHostImpl
;
25 class SyntheticGestureTargetBase
: public SyntheticGestureTarget
{
27 explicit SyntheticGestureTargetBase(RenderWidgetHostImpl
* host
);
28 virtual ~SyntheticGestureTargetBase();
30 virtual void DispatchWebTouchEventToPlatform(
31 const blink::WebTouchEvent
& web_touch
,
32 const ui::LatencyInfo
& latency_info
);
34 virtual void DispatchWebMouseWheelEventToPlatform(
35 const blink::WebMouseWheelEvent
& web_wheel
,
36 const ui::LatencyInfo
& latency_info
);
38 virtual void DispatchWebMouseEventToPlatform(
39 const blink::WebMouseEvent
& web_mouse
,
40 const ui::LatencyInfo
& latency_info
);
42 // SyntheticGestureTarget:
43 virtual void DispatchInputEventToPlatform(
44 const blink::WebInputEvent
& event
) OVERRIDE
;
46 virtual void SetNeedsFlush() OVERRIDE
;
48 virtual SyntheticGestureParams::GestureSourceType
49 GetDefaultSyntheticGestureSourceType() const OVERRIDE
;
51 virtual base::TimeDelta
PointerAssumedStoppedTime() const OVERRIDE
;
53 virtual int GetTouchSlopInDips() const OVERRIDE
;
56 RenderWidgetHostImpl
* render_widget_host() const { return host_
; }
59 bool PointIsWithinContents(int x
, int y
) const;
61 RenderWidgetHostImpl
* host_
;
63 DISALLOW_COPY_AND_ASSIGN(SyntheticGestureTargetBase
);
66 } // namespace content
68 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_TARGET_BASE_H_