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 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 void ContentViewCoreImpl::GetScaledContentBitmap( | 631 void ContentViewCoreImpl::GetScaledContentBitmap( |
632 float scale, | 632 float scale, |
633 jobject jbitmap_config, | 633 jobject jbitmap_config, |
634 gfx::Rect src_subrect, | 634 gfx::Rect src_subrect, |
635 const base::Callback<void(bool, const SkBitmap&)>& result_callback) { | 635 const base::Callback<void(bool, const SkBitmap&)>& result_callback) { |
636 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); | 636 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); |
637 if (!view) { | 637 if (!view) { |
638 result_callback.Run(false, SkBitmap()); | 638 result_callback.Run(false, SkBitmap()); |
639 return; | 639 return; |
640 } | 640 } |
641 SkBitmap::Config skbitmap_format = gfx::ConvertToSkiaConfig(jbitmap_config); | 641 SkColorType color_type = gfx::ConvertToSkiaColorType(jbitmap_config); |
642 view->GetScaledContentBitmap(scale, skbitmap_format, src_subrect, | 642 view->GetScaledContentBitmap(scale, color_type, src_subrect, |
643 result_callback); | 643 result_callback); |
644 } | 644 } |
645 | 645 |
646 void ContentViewCoreImpl::StartContentIntent(const GURL& content_url) { | 646 void ContentViewCoreImpl::StartContentIntent(const GURL& content_url) { |
647 JNIEnv* env = AttachCurrentThread(); | 647 JNIEnv* env = AttachCurrentThread(); |
648 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); | 648 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); |
649 if (j_obj.is_null()) | 649 if (j_obj.is_null()) |
650 return; | 650 return; |
651 ScopedJavaLocalRef<jstring> jcontent_url = | 651 ScopedJavaLocalRef<jstring> jcontent_url = |
652 ConvertUTF8ToJavaString(env, content_url.spec()); | 652 ConvertUTF8ToJavaString(env, content_url.spec()); |
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1699 reinterpret_cast<ui::WindowAndroid*>(window_android), | 1699 reinterpret_cast<ui::WindowAndroid*>(window_android), |
1700 retained_objects_set); | 1700 retained_objects_set); |
1701 return reinterpret_cast<intptr_t>(view); | 1701 return reinterpret_cast<intptr_t>(view); |
1702 } | 1702 } |
1703 | 1703 |
1704 bool RegisterContentViewCore(JNIEnv* env) { | 1704 bool RegisterContentViewCore(JNIEnv* env) { |
1705 return RegisterNativesImpl(env); | 1705 return RegisterNativesImpl(env); |
1706 } | 1706 } |
1707 | 1707 |
1708 } // namespace content | 1708 } // namespace content |
OLD | NEW |