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 "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 | 580 |
581 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::CreateTouchEventSynthesizer() { | 581 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::CreateTouchEventSynthesizer() { |
582 JNIEnv* env = AttachCurrentThread(); | 582 JNIEnv* env = AttachCurrentThread(); |
583 | 583 |
584 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 584 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
585 if (obj.is_null()) | 585 if (obj.is_null()) |
586 return ScopedJavaLocalRef<jobject>(); | 586 return ScopedJavaLocalRef<jobject>(); |
587 return Java_ContentViewCore_createTouchEventSynthesizer(env, obj.obj()); | 587 return Java_ContentViewCore_createTouchEventSynthesizer(env, obj.obj()); |
588 } | 588 } |
589 | 589 |
590 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::CreateOnePointTouchGesture( | |
591 int32 start_x, int32 start_y, int32 delta_x, int32 delta_y) { | |
592 JNIEnv* env = AttachCurrentThread(); | |
593 | |
594 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | |
595 if (obj.is_null()) | |
596 return ScopedJavaLocalRef<jobject>(); | |
597 return Java_ContentViewCore_createOnePointTouchGesture( | |
598 env, obj.obj(), start_x, start_y, delta_x, delta_y); | |
599 } | |
600 | |
601 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::CreateTwoPointTouchGesture( | |
602 int32 start_x0, int32 start_y0, int32 delta_x0, int32 delta_y0, | |
603 int32 start_x1, int32 start_y1, int32 delta_x1, int32 delta_y1) { | |
604 JNIEnv* env = AttachCurrentThread(); | |
605 | |
606 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | |
607 if (obj.is_null()) | |
608 return ScopedJavaLocalRef<jobject>(); | |
609 return Java_ContentViewCore_createTwoPointTouchGesture( | |
610 env, obj.obj(), start_x0, start_y0, delta_x0, delta_y0, | |
611 start_x1, start_y1, delta_x1, delta_y1); | |
612 } | |
613 | |
614 void ContentViewCoreImpl::NotifyExternalSurface( | 590 void ContentViewCoreImpl::NotifyExternalSurface( |
615 int player_id, bool is_request, const gfx::RectF& rect) { | 591 int player_id, bool is_request, const gfx::RectF& rect) { |
616 JNIEnv* env = AttachCurrentThread(); | 592 JNIEnv* env = AttachCurrentThread(); |
617 | 593 |
618 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 594 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
619 if (obj.is_null()) | 595 if (obj.is_null()) |
620 return; | 596 return; |
621 | 597 |
622 Java_ContentViewCore_notifyExternalSurface( | 598 Java_ContentViewCore_notifyExternalSurface( |
623 env, | 599 env, |
(...skipping 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1660 reinterpret_cast<ui::ViewAndroid*>(view_android), | 1636 reinterpret_cast<ui::ViewAndroid*>(view_android), |
1661 reinterpret_cast<ui::WindowAndroid*>(window_android)); | 1637 reinterpret_cast<ui::WindowAndroid*>(window_android)); |
1662 return reinterpret_cast<jint>(view); | 1638 return reinterpret_cast<jint>(view); |
1663 } | 1639 } |
1664 | 1640 |
1665 bool RegisterContentViewCore(JNIEnv* env) { | 1641 bool RegisterContentViewCore(JNIEnv* env) { |
1666 return RegisterNativesImpl(env); | 1642 return RegisterNativesImpl(env); |
1667 } | 1643 } |
1668 | 1644 |
1669 } // namespace content | 1645 } // namespace content |
OLD | NEW |