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 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 env, obj.obj(), static_cast<jint>(x_dip * dpi_scale()), | 633 env, obj.obj(), static_cast<jint>(x_dip * dpi_scale()), |
634 static_cast<jint>(y_dip * dpi_scale())); | 634 static_cast<jint>(y_dip * dpi_scale())); |
635 } | 635 } |
636 | 636 |
637 void ContentViewCoreImpl::GetScaledContentBitmap( | 637 void ContentViewCoreImpl::GetScaledContentBitmap( |
638 float scale, | 638 float scale, |
639 SkColorType color_type, | 639 SkColorType color_type, |
640 gfx::Rect src_subrect, | 640 gfx::Rect src_subrect, |
641 ReadbackRequestCallback& result_callback) { | 641 ReadbackRequestCallback& result_callback) { |
642 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); | 642 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); |
643 if (!view) { | 643 if (!view || color_type == kUnknown_SkColorType) { |
644 result_callback.Run(SkBitmap(), READBACK_FAILED); | 644 result_callback.Run(SkBitmap(), READBACK_FAILED); |
645 return; | 645 return; |
646 } | 646 } |
647 | 647 |
648 view->GetScaledContentBitmap(scale, color_type, src_subrect, | 648 view->GetScaledContentBitmap(scale, color_type, src_subrect, |
649 result_callback); | 649 result_callback); |
650 } | 650 } |
651 | 651 |
652 void ContentViewCoreImpl::StartContentIntent(const GURL& content_url) { | 652 void ContentViewCoreImpl::StartContentIntent(const GURL& content_url) { |
653 JNIEnv* env = AttachCurrentThread(); | 653 JNIEnv* env = AttachCurrentThread(); |
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1391 return NULL; | 1391 return NULL; |
1392 | 1392 |
1393 return view->GetJavaObject().Release(); | 1393 return view->GetJavaObject().Release(); |
1394 } | 1394 } |
1395 | 1395 |
1396 bool RegisterContentViewCore(JNIEnv* env) { | 1396 bool RegisterContentViewCore(JNIEnv* env) { |
1397 return RegisterNativesImpl(env); | 1397 return RegisterNativesImpl(env); |
1398 } | 1398 } |
1399 | 1399 |
1400 } // namespace content | 1400 } // namespace content |
OLD | NEW |