| 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 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1051 type, time_ms / 1000.0, x / dpi_scale(), y / dpi_scale()); | 1051 type, time_ms / 1000.0, x / dpi_scale(), y / dpi_scale()); |
| 1052 } | 1052 } |
| 1053 | 1053 |
| 1054 void ContentViewCoreImpl::SendGestureEvent( | 1054 void ContentViewCoreImpl::SendGestureEvent( |
| 1055 const blink::WebGestureEvent& event) { | 1055 const blink::WebGestureEvent& event) { |
| 1056 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); | 1056 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); |
| 1057 if (rwhv) | 1057 if (rwhv) |
| 1058 rwhv->SendGestureEvent(event); | 1058 rwhv->SendGestureEvent(event); |
| 1059 } | 1059 } |
| 1060 | 1060 |
| 1061 void ContentViewCoreImpl::SimulateClick(JNIEnv* env, |
| 1062 const JavaParamRef<jobject>& obj) { |
| 1063 RenderFrameHost* focused_frame = web_contents_->GetFocusedFrame(); |
| 1064 if (!focused_frame) |
| 1065 return; |
| 1066 focused_frame->Send( |
| 1067 new FrameMsg_ClickOnFocusedElement(focused_frame->GetRoutingID())); |
| 1068 } |
| 1069 |
| 1061 void ContentViewCoreImpl::ScrollBegin(JNIEnv* env, | 1070 void ContentViewCoreImpl::ScrollBegin(JNIEnv* env, |
| 1062 const JavaParamRef<jobject>& obj, | 1071 const JavaParamRef<jobject>& obj, |
| 1063 jlong time_ms, | 1072 jlong time_ms, |
| 1064 jfloat x, | 1073 jfloat x, |
| 1065 jfloat y, | 1074 jfloat y, |
| 1066 jfloat hintx, | 1075 jfloat hintx, |
| 1067 jfloat hinty, | 1076 jfloat hinty, |
| 1068 jboolean target_viewport) { | 1077 jboolean target_viewport) { |
| 1069 WebGestureEvent event = MakeGestureEvent( | 1078 WebGestureEvent event = MakeGestureEvent( |
| 1070 WebInputEvent::GestureScrollBegin, time_ms, x, y); | 1079 WebInputEvent::GestureScrollBegin, time_ms, x, y); |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1569 return ScopedJavaLocalRef<jobject>(); | 1578 return ScopedJavaLocalRef<jobject>(); |
| 1570 | 1579 |
| 1571 return view->GetJavaObject(); | 1580 return view->GetJavaObject(); |
| 1572 } | 1581 } |
| 1573 | 1582 |
| 1574 bool RegisterContentViewCore(JNIEnv* env) { | 1583 bool RegisterContentViewCore(JNIEnv* env) { |
| 1575 return RegisterNativesImpl(env); | 1584 return RegisterNativesImpl(env); |
| 1576 } | 1585 } |
| 1577 | 1586 |
| 1578 } // namespace content | 1587 } // namespace content |
| OLD | NEW |