OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/android/content_view_core_impl.h" | 5 #include "content/browser/android/content_view_core_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
148 return GESTURE_EVENT_TYPE_LONG_TAP; | 148 return GESTURE_EVENT_TYPE_LONG_TAP; |
149 case WebInputEvent::GesturePinchBegin: | 149 case WebInputEvent::GesturePinchBegin: |
150 return GESTURE_EVENT_TYPE_PINCH_BEGIN; | 150 return GESTURE_EVENT_TYPE_PINCH_BEGIN; |
151 case WebInputEvent::GesturePinchEnd: | 151 case WebInputEvent::GesturePinchEnd: |
152 return GESTURE_EVENT_TYPE_PINCH_END; | 152 return GESTURE_EVENT_TYPE_PINCH_END; |
153 case WebInputEvent::GesturePinchUpdate: | 153 case WebInputEvent::GesturePinchUpdate: |
154 return GESTURE_EVENT_TYPE_PINCH_BY; | 154 return GESTURE_EVENT_TYPE_PINCH_BY; |
155 case WebInputEvent::GestureTwoFingerTap: | 155 case WebInputEvent::GestureTwoFingerTap: |
156 default: | 156 default: |
157 NOTREACHED() << "Invalid source gesture type: " | 157 NOTREACHED() << "Invalid source gesture type: " |
158 << ui::WebInputEventTraits::GetName(type); | 158 << WebInputEvent::GetName(type); |
159 return -1; | 159 return -1; |
160 } | 160 } |
161 } | 161 } |
162 | 162 |
163 } // namespace | 163 } // namespace |
164 | 164 |
165 // Enables a callback when the underlying WebContents is destroyed, to enable | 165 // Enables a callback when the underlying WebContents is destroyed, to enable |
166 // nulling the back-pointer. | 166 // nulling the back-pointer. |
167 class ContentViewCoreImpl::ContentViewUserData | 167 class ContentViewCoreImpl::ContentViewUserData |
168 : public base::SupportsUserData::Data { | 168 : public base::SupportsUserData::Data { |
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
981 jlong time_ms, | 981 jlong time_ms, |
982 jfloat x, | 982 jfloat x, |
983 jfloat y, | 983 jfloat y, |
984 jint tool_type) { | 984 jint tool_type) { |
985 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); | 985 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); |
986 if (!rwhv) | 986 if (!rwhv) |
987 return false; | 987 return false; |
988 | 988 |
989 blink::WebMouseEvent event = WebMouseEventBuilder::Build( | 989 blink::WebMouseEvent event = WebMouseEventBuilder::Build( |
990 WebInputEvent::MouseMove, | 990 WebInputEvent::MouseMove, |
991 blink::WebMouseEvent::ButtonNone, | 991 blink::WebMouseEvent::ButtonNone, |
mustaq
2016/08/23 20:13:22
Looks like you will need to rebase again with the
| |
992 time_ms / 1000.0, x / dpi_scale(), y / dpi_scale(), 0, 1, | 992 time_ms / 1000.0, x / dpi_scale(), y / dpi_scale(), 0, 1, |
993 ui::ToWebPointerType(static_cast<ui::MotionEvent::ToolType>(tool_type))); | 993 ui::ToWebPointerType(static_cast<ui::MotionEvent::ToolType>(tool_type))); |
994 | 994 |
995 rwhv->SendMouseEvent(event); | 995 rwhv->SendMouseEvent(event); |
996 return true; | 996 return true; |
997 } | 997 } |
998 | 998 |
999 jboolean ContentViewCoreImpl::SendMouseWheelEvent( | 999 jboolean ContentViewCoreImpl::SendMouseWheelEvent( |
1000 JNIEnv* env, | 1000 JNIEnv* env, |
1001 const JavaParamRef<jobject>& obj, | 1001 const JavaParamRef<jobject>& obj, |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1603 return ScopedJavaLocalRef<jobject>(); | 1603 return ScopedJavaLocalRef<jobject>(); |
1604 | 1604 |
1605 return view->GetJavaObject(); | 1605 return view->GetJavaObject(); |
1606 } | 1606 } |
1607 | 1607 |
1608 bool RegisterContentViewCore(JNIEnv* env) { | 1608 bool RegisterContentViewCore(JNIEnv* env) { |
1609 return RegisterNativesImpl(env); | 1609 return RegisterNativesImpl(env); |
1610 } | 1610 } |
1611 | 1611 |
1612 } // namespace content | 1612 } // namespace content |
OLD | NEW |