OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 JNIEnv* env = AttachCurrentThread(); | 592 JNIEnv* env = AttachCurrentThread(); |
593 | 593 |
594 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 594 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
595 if (obj.is_null()) | 595 if (obj.is_null()) |
596 return; | 596 return; |
597 | 597 |
598 Java_ContentViewCore_requestExternalVideoSurface( | 598 Java_ContentViewCore_requestExternalVideoSurface( |
599 env, obj.obj(), static_cast<jint>(player_id)); | 599 env, obj.obj(), static_cast<jint>(player_id)); |
600 } | 600 } |
601 | 601 |
| 602 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::CreateSmoothScroller( |
| 603 bool scroll_down, int mouse_event_x, int mouse_event_y) { |
| 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_createSmoothScroller( |
| 610 env, obj.obj(), scroll_down, mouse_event_x, mouse_event_y); |
| 611 } |
| 612 |
602 void ContentViewCoreImpl::NotifyGeometryChange(int player_id, | 613 void ContentViewCoreImpl::NotifyGeometryChange(int player_id, |
603 const gfx::RectF& rect) { | 614 const gfx::RectF& rect) { |
604 JNIEnv* env = AttachCurrentThread(); | 615 JNIEnv* env = AttachCurrentThread(); |
605 | 616 |
606 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 617 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
607 if (obj.is_null()) | 618 if (obj.is_null()) |
608 return; | 619 return; |
609 | 620 |
610 Java_ContentViewCore_notifyGeometryChange(env, | 621 Java_ContentViewCore_notifyGeometryChange(env, |
611 obj.obj(), | 622 obj.obj(), |
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1518 reinterpret_cast<ui::ViewAndroid*>(view_android), | 1529 reinterpret_cast<ui::ViewAndroid*>(view_android), |
1519 reinterpret_cast<ui::WindowAndroid*>(window_android)); | 1530 reinterpret_cast<ui::WindowAndroid*>(window_android)); |
1520 return reinterpret_cast<jint>(view); | 1531 return reinterpret_cast<jint>(view); |
1521 } | 1532 } |
1522 | 1533 |
1523 bool RegisterContentViewCore(JNIEnv* env) { | 1534 bool RegisterContentViewCore(JNIEnv* env) { |
1524 return RegisterNativesImpl(env); | 1535 return RegisterNativesImpl(env); |
1525 } | 1536 } |
1526 | 1537 |
1527 } // namespace content | 1538 } // namespace content |
OLD | NEW |