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 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 if (obj.is_null()) | 697 if (obj.is_null()) |
698 return; | 698 return; |
699 Java_ContentViewCore_showPastePopup(env, obj.obj(), | 699 Java_ContentViewCore_showPastePopup(env, obj.obj(), |
700 static_cast<jint>(x_dip), | 700 static_cast<jint>(x_dip), |
701 static_cast<jint>(y_dip)); | 701 static_cast<jint>(y_dip)); |
702 } | 702 } |
703 | 703 |
704 void ContentViewCoreImpl::GetScaledContentBitmap( | 704 void ContentViewCoreImpl::GetScaledContentBitmap( |
705 float scale, | 705 float scale, |
706 gfx::Size* out_size, | 706 gfx::Size* out_size, |
| 707 bool config_565, |
707 const base::Callback<void(bool, const SkBitmap&)>& result_callback) { | 708 const base::Callback<void(bool, const SkBitmap&)>& result_callback) { |
708 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); | 709 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); |
709 if (!view) { | 710 if (!view) { |
710 result_callback.Run(false, SkBitmap()); | 711 result_callback.Run(false, SkBitmap()); |
711 return; | 712 return; |
712 } | 713 } |
713 | 714 view->GetScaledContentBitmap(scale, out_size, config_565, result_callback); |
714 view->GetScaledContentBitmap(scale, out_size, result_callback); | |
715 } | 715 } |
716 | 716 |
717 void ContentViewCoreImpl::StartContentIntent(const GURL& content_url) { | 717 void ContentViewCoreImpl::StartContentIntent(const GURL& content_url) { |
718 JNIEnv* env = AttachCurrentThread(); | 718 JNIEnv* env = AttachCurrentThread(); |
719 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); | 719 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); |
720 if (j_obj.is_null()) | 720 if (j_obj.is_null()) |
721 return; | 721 return; |
722 ScopedJavaLocalRef<jstring> jcontent_url = | 722 ScopedJavaLocalRef<jstring> jcontent_url = |
723 ConvertUTF8ToJavaString(env, content_url.spec()); | 723 ConvertUTF8ToJavaString(env, content_url.spec()); |
724 Java_ContentViewCore_startContentIntent(env, | 724 Java_ContentViewCore_startContentIntent(env, |
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1872 reinterpret_cast<ui::ViewAndroid*>(view_android), | 1872 reinterpret_cast<ui::ViewAndroid*>(view_android), |
1873 reinterpret_cast<ui::WindowAndroid*>(window_android)); | 1873 reinterpret_cast<ui::WindowAndroid*>(window_android)); |
1874 return reinterpret_cast<intptr_t>(view); | 1874 return reinterpret_cast<intptr_t>(view); |
1875 } | 1875 } |
1876 | 1876 |
1877 bool RegisterContentViewCore(JNIEnv* env) { | 1877 bool RegisterContentViewCore(JNIEnv* env) { |
1878 return RegisterNativesImpl(env); | 1878 return RegisterNativesImpl(env); |
1879 } | 1879 } |
1880 | 1880 |
1881 } // namespace content | 1881 } // namespace content |
OLD | NEW |