| 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 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 634 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 635 if (obj.is_null()) | 635 if (obj.is_null()) |
| 636 return; | 636 return; |
| 637 Java_ContentViewCore_showPastePopupWithFeedback( | 637 Java_ContentViewCore_showPastePopupWithFeedback( |
| 638 env, obj.obj(), static_cast<jint>(x_dip * dpi_scale()), | 638 env, obj.obj(), static_cast<jint>(x_dip * dpi_scale()), |
| 639 static_cast<jint>(y_dip * dpi_scale())); | 639 static_cast<jint>(y_dip * dpi_scale())); |
| 640 } | 640 } |
| 641 | 641 |
| 642 void ContentViewCoreImpl::GetScaledContentBitmap( | 642 void ContentViewCoreImpl::GetScaledContentBitmap( |
| 643 float scale, | 643 float scale, |
| 644 SkColorType color_type, | 644 SkColorType preferred_color_type, |
| 645 gfx::Rect src_subrect, | 645 gfx::Rect src_subrect, |
| 646 ReadbackRequestCallback& result_callback) { | 646 ReadbackRequestCallback& result_callback) { |
| 647 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); | 647 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); |
| 648 if (!view || color_type == kUnknown_SkColorType) { | 648 if (!view || preferred_color_type == kUnknown_SkColorType) { |
| 649 result_callback.Run(SkBitmap(), READBACK_FAILED); | 649 result_callback.Run(SkBitmap(), READBACK_FAILED); |
| 650 return; | 650 return; |
| 651 } | 651 } |
| 652 | 652 |
| 653 view->GetScaledContentBitmap(scale, color_type, src_subrect, | 653 view->GetScaledContentBitmap(scale, preferred_color_type, src_subrect, |
| 654 result_callback); | 654 result_callback); |
| 655 } | 655 } |
| 656 | 656 |
| 657 void ContentViewCoreImpl::StartContentIntent(const GURL& content_url) { | 657 void ContentViewCoreImpl::StartContentIntent(const GURL& content_url) { |
| 658 JNIEnv* env = AttachCurrentThread(); | 658 JNIEnv* env = AttachCurrentThread(); |
| 659 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); | 659 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); |
| 660 if (j_obj.is_null()) | 660 if (j_obj.is_null()) |
| 661 return; | 661 return; |
| 662 ScopedJavaLocalRef<jstring> jcontent_url = | 662 ScopedJavaLocalRef<jstring> jcontent_url = |
| 663 ConvertUTF8ToJavaString(env, content_url.spec()); | 663 ConvertUTF8ToJavaString(env, content_url.spec()); |
| 664 Java_ContentViewCore_startContentIntent(env, | 664 Java_ContentViewCore_startContentIntent(env, |
| (...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1454 return NULL; | 1454 return NULL; |
| 1455 | 1455 |
| 1456 return view->GetJavaObject().Release(); | 1456 return view->GetJavaObject().Release(); |
| 1457 } | 1457 } |
| 1458 | 1458 |
| 1459 bool RegisterContentViewCore(JNIEnv* env) { | 1459 bool RegisterContentViewCore(JNIEnv* env) { |
| 1460 return RegisterNativesImpl(env); | 1460 return RegisterNativesImpl(env); |
| 1461 } | 1461 } |
| 1462 | 1462 |
| 1463 } // namespace content | 1463 } // namespace content |
| OLD | NEW |