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 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 if (j_obj.is_null()) | 647 if (j_obj.is_null()) |
648 return; | 648 return; |
649 ScopedJavaLocalRef<jstring> jcontent_url = | 649 ScopedJavaLocalRef<jstring> jcontent_url = |
650 ConvertUTF8ToJavaString(env, content_url.spec()); | 650 ConvertUTF8ToJavaString(env, content_url.spec()); |
651 Java_ContentViewCore_startContentIntent(env, | 651 Java_ContentViewCore_startContentIntent(env, |
652 j_obj.obj(), | 652 j_obj.obj(), |
653 jcontent_url.obj()); | 653 jcontent_url.obj()); |
654 } | 654 } |
655 | 655 |
656 void ContentViewCoreImpl::ShowDisambiguationPopup( | 656 void ContentViewCoreImpl::ShowDisambiguationPopup( |
657 const gfx::Rect& target_rect, | 657 const gfx::Rect& rect_pixels, |
658 const SkBitmap& zoomed_bitmap) { | 658 const SkBitmap& zoomed_bitmap) { |
659 JNIEnv* env = AttachCurrentThread(); | 659 JNIEnv* env = AttachCurrentThread(); |
660 | 660 |
661 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 661 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
662 if (obj.is_null()) | 662 if (obj.is_null()) |
663 return; | 663 return; |
664 | 664 |
665 ScopedJavaLocalRef<jobject> rect_object(CreateJavaRect(env, target_rect)); | 665 ScopedJavaLocalRef<jobject> rect_object(CreateJavaRect(env, rect_pixels)); |
666 | 666 |
667 ScopedJavaLocalRef<jobject> java_bitmap = | 667 ScopedJavaLocalRef<jobject> java_bitmap = |
668 gfx::ConvertToJavaBitmap(&zoomed_bitmap); | 668 gfx::ConvertToJavaBitmap(&zoomed_bitmap); |
669 DCHECK(!java_bitmap.is_null()); | 669 DCHECK(!java_bitmap.is_null()); |
670 | 670 |
671 Java_ContentViewCore_showDisambiguationPopup(env, | 671 Java_ContentViewCore_showDisambiguationPopup(env, |
672 obj.obj(), | 672 obj.obj(), |
673 rect_object.obj(), | 673 rect_object.obj(), |
674 java_bitmap.obj()); | 674 java_bitmap.obj()); |
675 } | 675 } |
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1338 reinterpret_cast<ui::WindowAndroid*>(window_android), | 1338 reinterpret_cast<ui::WindowAndroid*>(window_android), |
1339 retained_objects_set); | 1339 retained_objects_set); |
1340 return reinterpret_cast<intptr_t>(view); | 1340 return reinterpret_cast<intptr_t>(view); |
1341 } | 1341 } |
1342 | 1342 |
1343 bool RegisterContentViewCore(JNIEnv* env) { | 1343 bool RegisterContentViewCore(JNIEnv* env) { |
1344 return RegisterNativesImpl(env); | 1344 return RegisterNativesImpl(env); |
1345 } | 1345 } |
1346 | 1346 |
1347 } // namespace content | 1347 } // namespace content |
OLD | NEW |