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 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
678 if (obj.is_null()) | 678 if (obj.is_null()) |
679 return; | 679 return; |
680 Java_ContentViewCore_showPastePopup(env, obj.obj(), | 680 Java_ContentViewCore_showPastePopup(env, obj.obj(), |
681 static_cast<jint>(x_dip), | 681 static_cast<jint>(x_dip), |
682 static_cast<jint>(y_dip)); | 682 static_cast<jint>(y_dip)); |
683 } | 683 } |
684 | 684 |
685 void ContentViewCoreImpl::GetScaledContentBitmap( | 685 void ContentViewCoreImpl::GetScaledContentBitmap( |
686 float scale, | 686 float scale, |
687 gfx::Size* out_size, | 687 gfx::Size* out_size, |
688 jobject bitmap_config, | |
vivekg
2014/02/11 17:06:46
bitmap_config -> jbitmap_config
sivag
2014/02/13 16:31:52
Done.
| |
688 const base::Callback<void(bool, const SkBitmap&)>& result_callback) { | 689 const base::Callback<void(bool, const SkBitmap&)>& result_callback) { |
689 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); | 690 RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); |
690 if (!view) { | 691 if (!view) { |
691 result_callback.Run(false, SkBitmap()); | 692 result_callback.Run(false, SkBitmap()); |
692 return; | 693 return; |
693 } | 694 } |
694 | 695 JNIEnv* env = AttachCurrentThread(); |
695 view->GetScaledContentBitmap(scale, out_size, result_callback); | 696 SkBitmap::Config bitmap_format = gfx::ToSkiaBitmapConfig(env, bitmap_config); |
vivekg
2014/02/11 17:06:46
bitmap_format -> skbitmap_config for consistency.
sivag
2014/02/13 16:31:52
Done.
| |
697 view->GetScaledContentBitmap(scale, out_size, bitmap_format, result_callback); | |
696 } | 698 } |
697 | 699 |
698 void ContentViewCoreImpl::StartContentIntent(const GURL& content_url) { | 700 void ContentViewCoreImpl::StartContentIntent(const GURL& content_url) { |
699 JNIEnv* env = AttachCurrentThread(); | 701 JNIEnv* env = AttachCurrentThread(); |
700 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); | 702 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); |
701 if (j_obj.is_null()) | 703 if (j_obj.is_null()) |
702 return; | 704 return; |
703 ScopedJavaLocalRef<jstring> jcontent_url = | 705 ScopedJavaLocalRef<jstring> jcontent_url = |
704 ConvertUTF8ToJavaString(env, content_url.spec()); | 706 ConvertUTF8ToJavaString(env, content_url.spec()); |
705 Java_ContentViewCore_startContentIntent(env, | 707 Java_ContentViewCore_startContentIntent(env, |
(...skipping 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1860 reinterpret_cast<ui::ViewAndroid*>(view_android), | 1862 reinterpret_cast<ui::ViewAndroid*>(view_android), |
1861 reinterpret_cast<ui::WindowAndroid*>(window_android)); | 1863 reinterpret_cast<ui::WindowAndroid*>(window_android)); |
1862 return reinterpret_cast<intptr_t>(view); | 1864 return reinterpret_cast<intptr_t>(view); |
1863 } | 1865 } |
1864 | 1866 |
1865 bool RegisterContentViewCore(JNIEnv* env) { | 1867 bool RegisterContentViewCore(JNIEnv* env) { |
1866 return RegisterNativesImpl(env); | 1868 return RegisterNativesImpl(env); |
1867 } | 1869 } |
1868 | 1870 |
1869 } // namespace content | 1871 } // namespace content |
OLD | NEW |