| Index: content/browser/renderer_host/render_widget_host_impl.cc
|
| diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
|
| index fe6f9fe2078c6b1423990ecb29fad6f85635298c..09357b1b067ef661ec73a093d98db6402a101705 100644
|
| --- a/content/browser/renderer_host/render_widget_host_impl.cc
|
| +++ b/content/browser/renderer_host/render_widget_host_impl.cc
|
| @@ -91,6 +91,10 @@
|
| #include "ui/gfx/skbitmap_operations.h"
|
| #include "ui/snapshot/snapshot.h"
|
|
|
| +#if defined(OS_ANDROID)
|
| +#include "ui/android/view_android.h"
|
| +#endif
|
| +
|
| #if defined(OS_MACOSX)
|
| #include "device/power_save_blocker/power_save_blocker.h"
|
| #include "ui/accelerated_widget_mac/window_resize_helper_mac.h"
|
| @@ -2353,8 +2357,14 @@ void RenderWidgetHostImpl::DidReceiveRendererFrame() {
|
| void RenderWidgetHostImpl::WindowSnapshotReachedScreen(int snapshot_id) {
|
| DCHECK(base::MessageLoopForUI::IsCurrent());
|
|
|
| - gfx::Rect view_bounds = GetView()->GetViewBounds();
|
| - gfx::Rect snapshot_bounds(view_bounds.size());
|
| +#if defined(OS_ANDROID)
|
| + // On Android, call sites should pass in the bounds with correct offset
|
| + // to capture the intended content area.
|
| + gfx::Rect snapshot_bounds(GetView()->GetViewBounds());
|
| + snapshot_bounds.Offset(0, GetView()->GetNativeView()->content_offset().y());
|
| +#else
|
| + gfx::Rect snapshot_bounds(GetView()->GetViewBounds().size());
|
| +#endif
|
|
|
| std::vector<unsigned char> png;
|
| if (ui::GrabViewSnapshot(
|
|
|