Chromium Code Reviews| Index: content/browser/android/content_view_core_impl.cc |
| diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc |
| index 182c0a6f336ca2071a3303065f41072bb9fa2e4b..5de8890859b969e53fb1638ba2a092ce4737ca41 100644 |
| --- a/content/browser/android/content_view_core_impl.cc |
| +++ b/content/browser/android/content_view_core_impl.cc |
| @@ -8,6 +8,7 @@ |
| #include "base/android/jni_array.h" |
| #include "base/android/jni_string.h" |
| #include "base/android/scoped_java_ref.h" |
| +#include "base/callback_helpers.h" |
| #include "base/command_line.h" |
| #include "base/json/json_writer.h" |
| #include "base/logging.h" |
| @@ -591,14 +592,27 @@ void ContentViewCoreImpl::ShowPastePopup(int x_dip, int y_dip) { |
| static_cast<jint>(y_dip)); |
| } |
| -unsigned int ContentViewCoreImpl::GetScaledContentTexture( |
| +void ContentViewCoreImpl::OnFinishGetScaledContentBitmap( |
| + const base::Callback<void(bool, const SkBitmap&)>& compositor_callback, |
| + bool success, |
|
no sievers
2014/01/29 21:13:48
Looks like you don't need this method anymore but
powei
2014/01/30 00:54:12
Done.
|
| + const SkBitmap& bitmap) { |
| + compositor_callback.Run(success, bitmap); |
| +} |
| + |
| +void ContentViewCoreImpl::GetScaledContentBitmap( |
| float scale, |
| - gfx::Size* out_size) { |
| + gfx::Size* out_size, |
| + const base::Callback<void(bool, const SkBitmap&)>& compositor_callback) { |
| RenderWidgetHostViewAndroid* view = GetRenderWidgetHostViewAndroid(); |
| - if (!view) |
| - return 0; |
| + if (!view || !view->IsSurfaceAvailableForCopy()) { |
| + compositor_callback.Run(false, SkBitmap()); |
| + return; |
| + } |
| - return view->GetScaledContentTexture(scale, out_size); |
| + base::Callback<void(bool, const SkBitmap&)> callback = |
| + base::Bind(&ContentViewCoreImpl::OnFinishGetScaledContentBitmap, |
| + compositor_callback); |
| + view->GetScaledContentBitmap(scale, out_size, callback); |
| } |
| void ContentViewCoreImpl::StartContentIntent(const GURL& content_url) { |