Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(789)

Unified Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 2219823002: Move content offset to ViewAndroid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pass right bounds to snapshot api Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 adf4451262e8977929e0cf626417eb3abdf2aad5..40b3d3f42daa81493305003c2077138e9917fa63 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -2345,8 +2345,13 @@ 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(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());
boliu 2016/12/22 21:14:59 Feels like GrabViewSnapshotAsync should grab the o
boliu 2016/12/22 21:28:54 Oh, I see sievers complained about the translation
Jinsuk Kim 2017/01/03 07:07:48 I take it that you want the change in RWVHA::GetVi
+#else
+ gfx::Rect snapshot_bounds(GetView()->GetViewBounds().size());
+#endif
std::vector<unsigned char> png;
if (ui::GrabViewSnapshot(
« no previous file with comments | « content/browser/android/content_view_core_impl.cc ('k') | content/browser/renderer_host/render_widget_host_view_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698