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 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 616 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
617 if (obj.is_null()) | 617 if (obj.is_null()) |
618 return; | 618 return; |
619 Java_ContentViewCore_showPastePopup(env, obj.obj(), | 619 Java_ContentViewCore_showPastePopup(env, obj.obj(), |
620 static_cast<jint>(x_dip), | 620 static_cast<jint>(x_dip), |
621 static_cast<jint>(y_dip)); | 621 static_cast<jint>(y_dip)); |
622 } | 622 } |
623 | 623 |
624 void ContentViewCoreImpl::GetScaledContentBitmap( | 624 void ContentViewCoreImpl::GetScaledContentBitmap( |
625 float scale, | 625 float scale, |
626 jobject jbitmap_config, | 626 SkColorType color_type, |
627 gfx::Rect src_subrect, | 627 gfx::Rect src_subrect, |
628 const base::Callback<void(bool, const SkBitmap&)>& result_callback) { | 628 const base::Callback<void(bool, const SkBitmap&)>& result_callback) { |
629 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); | 629 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); |
630 if (!view) { | 630 if (!view) { |
631 result_callback.Run(false, SkBitmap()); | 631 result_callback.Run(false, SkBitmap()); |
632 return; | 632 return; |
633 } | 633 } |
634 SkColorType color_type = gfx::ConvertToSkiaColorType(jbitmap_config); | 634 |
635 view->GetScaledContentBitmap(scale, color_type, src_subrect, | 635 view->GetScaledContentBitmap(scale, color_type, src_subrect, |
636 result_callback); | 636 result_callback); |
637 } | 637 } |
638 | 638 |
639 void ContentViewCoreImpl::StartContentIntent(const GURL& content_url) { | 639 void ContentViewCoreImpl::StartContentIntent(const GURL& content_url) { |
640 JNIEnv* env = AttachCurrentThread(); | 640 JNIEnv* env = AttachCurrentThread(); |
641 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); | 641 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); |
642 if (j_obj.is_null()) | 642 if (j_obj.is_null()) |
643 return; | 643 return; |
644 ScopedJavaLocalRef<jstring> jcontent_url = | 644 ScopedJavaLocalRef<jstring> jcontent_url = |
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1606 reinterpret_cast<ui::WindowAndroid*>(window_android), | 1606 reinterpret_cast<ui::WindowAndroid*>(window_android), |
1607 retained_objects_set); | 1607 retained_objects_set); |
1608 return reinterpret_cast<intptr_t>(view); | 1608 return reinterpret_cast<intptr_t>(view); |
1609 } | 1609 } |
1610 | 1610 |
1611 bool RegisterContentViewCore(JNIEnv* env) { | 1611 bool RegisterContentViewCore(JNIEnv* env) { |
1612 return RegisterNativesImpl(env); | 1612 return RegisterNativesImpl(env); |
1613 } | 1613 } |
1614 | 1614 |
1615 } // namespace content | 1615 } // namespace content |
OLD | NEW |