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_ANDROID_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_TARGET_ANDROID_H_
8 #include "base/android/jni_android.h"
9 #include "base/time/time.h"
10 #include "content/browser/renderer_host/input/synthetic_gesture_target_base.h"
14 class ContentViewCoreImpl
;
16 class SyntheticGestureTargetAndroid
: public SyntheticGestureTargetBase
{
18 SyntheticGestureTargetAndroid(
19 RenderWidgetHostImpl
* host
,
20 base::android::ScopedJavaLocalRef
<jobject
> touch_event_synthesizer
);
21 ~SyntheticGestureTargetAndroid() override
;
23 static bool RegisterMotionEventSynthesizer(JNIEnv
* env
);
25 // SyntheticGestureTargetBase:
26 void DispatchWebTouchEventToPlatform(
27 const blink::WebTouchEvent
& web_touch
,
28 const ui::LatencyInfo
& latency_info
) override
;
29 void DispatchWebMouseWheelEventToPlatform(
30 const blink::WebMouseWheelEvent
& web_wheel
,
31 const ui::LatencyInfo
& latency_info
) override
;
32 void DispatchWebMouseEventToPlatform(
33 const blink::WebMouseEvent
& web_mouse
,
34 const ui::LatencyInfo
& latency_info
) override
;
36 // SyntheticGestureTarget:
37 SyntheticGestureParams::GestureSourceType
38 GetDefaultSyntheticGestureSourceType() const override
;
40 float GetTouchSlopInDips() const override
;
42 float GetMinScalingSpanInDips() const override
;
45 // Enum values below need to be kept in sync with MotionEventSynthesizer.java.
55 void TouchSetPointer(JNIEnv
* env
, int index
, int x
, int y
, int id
);
56 void TouchSetScrollDeltas(JNIEnv
* env
, int x
, int y
, int dx
, int dy
);
57 void TouchInject(JNIEnv
* env
,
62 base::android::ScopedJavaGlobalRef
<jobject
> touch_event_synthesizer_
;
64 DISALLOW_COPY_AND_ASSIGN(SyntheticGestureTargetAndroid
);
67 } // namespace content
69 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_TARGET_ANDROID_H_