OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 #include "content/browser/renderer_host/input/synthetic_gesture_target_android.h
" | 5 #include "content/browser/renderer_host/input/synthetic_gesture_target_android.h
" |
6 | 6 |
7 #include "content/browser/android/content_view_core_impl.h" | 7 #include "content/browser/android/content_view_core_impl.h" |
8 #include "content/browser/renderer_host/render_widget_host_impl.h" | 8 #include "content/browser/renderer_host/render_widget_host_impl.h" |
9 #include "jni/MotionEventSynthesizer_jni.h" | 9 #include "jni/MotionEventSynthesizer_jni.h" |
10 #include "third_party/WebKit/public/platform/WebInputEvent.h" | 10 #include "third_party/WebKit/public/platform/WebInputEvent.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 TouchSetPointer(env, i, point->position.x, point->position.y, point->id); | 77 TouchSetPointer(env, i, point->position.x, point->position.y, point->id); |
78 } | 78 } |
79 | 79 |
80 TouchInject(env, action, num_touches, | 80 TouchInject(env, action, num_touches, |
81 static_cast<int64_t>(web_touch.timeStampSeconds() * 1000.0)); | 81 static_cast<int64_t>(web_touch.timeStampSeconds() * 1000.0)); |
82 } | 82 } |
83 | 83 |
84 void SyntheticGestureTargetAndroid::DispatchWebMouseWheelEventToPlatform( | 84 void SyntheticGestureTargetAndroid::DispatchWebMouseWheelEventToPlatform( |
85 const blink::WebMouseWheelEvent& web_wheel, const ui::LatencyInfo&) { | 85 const blink::WebMouseWheelEvent& web_wheel, const ui::LatencyInfo&) { |
86 JNIEnv* env = base::android::AttachCurrentThread(); | 86 JNIEnv* env = base::android::AttachCurrentThread(); |
87 TouchSetScrollDeltas(env, web_wheel.x, web_wheel.y, web_wheel.deltaX, | 87 TouchSetScrollDeltas(env, web_wheel.positionInWidget().x, |
| 88 web_wheel.positionInWidget().y, web_wheel.deltaX, |
88 web_wheel.deltaY); | 89 web_wheel.deltaY); |
89 Java_MotionEventSynthesizer_inject( | 90 Java_MotionEventSynthesizer_inject( |
90 env, touch_event_synthesizer_, | 91 env, touch_event_synthesizer_, |
91 static_cast<int>(SyntheticGestureTargetAndroid::ActionScroll), 1, | 92 static_cast<int>(SyntheticGestureTargetAndroid::ActionScroll), 1, |
92 static_cast<int64_t>(web_wheel.timeStampSeconds() * 1000.0)); | 93 static_cast<int64_t>(web_wheel.timeStampSeconds() * 1000.0)); |
93 } | 94 } |
94 | 95 |
95 void SyntheticGestureTargetAndroid::DispatchWebMouseEventToPlatform( | 96 void SyntheticGestureTargetAndroid::DispatchWebMouseEventToPlatform( |
96 const blink::WebMouseEvent& web_mouse, const ui::LatencyInfo&) { | 97 const blink::WebMouseEvent& web_mouse, const ui::LatencyInfo&) { |
97 CHECK(false); | 98 CHECK(false); |
(...skipping 10 matching lines...) Expand all Loading... |
108 return gfx::ViewConfiguration::GetTouchSlopInDips(); | 109 return gfx::ViewConfiguration::GetTouchSlopInDips(); |
109 } | 110 } |
110 | 111 |
111 float SyntheticGestureTargetAndroid::GetMinScalingSpanInDips() const { | 112 float SyntheticGestureTargetAndroid::GetMinScalingSpanInDips() const { |
112 // TODO(jdduke): Have all targets use the same ui::GestureConfiguration | 113 // TODO(jdduke): Have all targets use the same ui::GestureConfiguration |
113 // codepath. | 114 // codepath. |
114 return gfx::ViewConfiguration::GetMinScalingSpanInDips(); | 115 return gfx::ViewConfiguration::GetMinScalingSpanInDips(); |
115 } | 116 } |
116 | 117 |
117 } // namespace content | 118 } // namespace content |
OLD | NEW |