| 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 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 ScopedJavaLocalRef<jobject> java_bitmap = | 582 ScopedJavaLocalRef<jobject> java_bitmap = |
| 583 gfx::ConvertToJavaBitmap(&zoomed_bitmap); | 583 gfx::ConvertToJavaBitmap(&zoomed_bitmap); |
| 584 DCHECK(!java_bitmap.is_null()); | 584 DCHECK(!java_bitmap.is_null()); |
| 585 | 585 |
| 586 Java_ContentViewCore_showDisambiguationPopup(env, | 586 Java_ContentViewCore_showDisambiguationPopup(env, |
| 587 obj.obj(), | 587 obj.obj(), |
| 588 rect_object.obj(), | 588 rect_object.obj(), |
| 589 java_bitmap.obj()); | 589 java_bitmap.obj()); |
| 590 } | 590 } |
| 591 | 591 |
| 592 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::CreateSmoothScroller( |
| 593 bool scroll_down, int mouse_event_x, int mouse_event_y) { |
| 594 JNIEnv* env = AttachCurrentThread(); |
| 595 |
| 596 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 597 if (obj.is_null()) |
| 598 return ScopedJavaLocalRef<jobject>(); |
| 599 return Java_ContentViewCore_createSmoothScroller( |
| 600 env, obj.obj(), scroll_down, mouse_event_x, mouse_event_y); |
| 601 } |
| 602 |
| 592 void ContentViewCoreImpl::NotifyExternalSurface( | 603 void ContentViewCoreImpl::NotifyExternalSurface( |
| 593 int player_id, bool is_request, const gfx::RectF& rect) { | 604 int player_id, bool is_request, const gfx::RectF& rect) { |
| 594 JNIEnv* env = AttachCurrentThread(); | 605 JNIEnv* env = AttachCurrentThread(); |
| 595 | 606 |
| 596 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 607 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 597 if (obj.is_null()) | 608 if (obj.is_null()) |
| 598 return; | 609 return; |
| 599 | 610 |
| 600 Java_ContentViewCore_notifyExternalSurface( | 611 Java_ContentViewCore_notifyExternalSurface( |
| 601 env, | 612 env, |
| (...skipping 916 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 |