Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/renderer_host/render_widget_host_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <tuple> | 10 #include <tuple> |
| (...skipping 2327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2338 is_running_navigation_hint_task); | 2338 is_running_navigation_hint_task); |
| 2339 } | 2339 } |
| 2340 | 2340 |
| 2341 void RenderWidgetHostImpl::DidReceiveRendererFrame() { | 2341 void RenderWidgetHostImpl::DidReceiveRendererFrame() { |
| 2342 view_->DidReceiveRendererFrame(); | 2342 view_->DidReceiveRendererFrame(); |
| 2343 } | 2343 } |
| 2344 | 2344 |
| 2345 void RenderWidgetHostImpl::WindowSnapshotReachedScreen(int snapshot_id) { | 2345 void RenderWidgetHostImpl::WindowSnapshotReachedScreen(int snapshot_id) { |
| 2346 DCHECK(base::MessageLoopForUI::IsCurrent()); | 2346 DCHECK(base::MessageLoopForUI::IsCurrent()); |
| 2347 | 2347 |
| 2348 gfx::Rect view_bounds = GetView()->GetViewBounds(); | 2348 #if defined(ANDROID) |
| 2349 gfx::Rect snapshot_bounds(view_bounds.size()); | 2349 // On Android, call sites should pass in the bounds with correct offset |
| 2350 // to capture the intended content area. | |
| 2351 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
| |
| 2352 #else | |
| 2353 gfx::Rect snapshot_bounds(GetView()->GetViewBounds().size()); | |
| 2354 #endif | |
| 2350 | 2355 |
| 2351 std::vector<unsigned char> png; | 2356 std::vector<unsigned char> png; |
| 2352 if (ui::GrabViewSnapshot( | 2357 if (ui::GrabViewSnapshot( |
| 2353 GetView()->GetNativeView(), &png, snapshot_bounds)) { | 2358 GetView()->GetNativeView(), &png, snapshot_bounds)) { |
| 2354 OnSnapshotDataReceived(snapshot_id, &png.front(), png.size()); | 2359 OnSnapshotDataReceived(snapshot_id, &png.front(), png.size()); |
| 2355 return; | 2360 return; |
| 2356 } | 2361 } |
| 2357 | 2362 |
| 2358 ui::GrabViewSnapshotAsync( | 2363 ui::GrabViewSnapshotAsync( |
| 2359 GetView()->GetNativeView(), | 2364 GetView()->GetNativeView(), |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2506 // different from the receiver's. | 2511 // different from the receiver's. |
| 2507 file_system_file.url = | 2512 file_system_file.url = |
| 2508 GURL(storage::GetIsolatedFileSystemRootURIString( | 2513 GURL(storage::GetIsolatedFileSystemRootURIString( |
| 2509 file_system_url.origin(), filesystem_id, std::string()) | 2514 file_system_url.origin(), filesystem_id, std::string()) |
| 2510 .append(register_name)); | 2515 .append(register_name)); |
| 2511 file_system_file.filesystem_id = filesystem_id; | 2516 file_system_file.filesystem_id = filesystem_id; |
| 2512 } | 2517 } |
| 2513 } | 2518 } |
| 2514 | 2519 |
| 2515 } // namespace content | 2520 } // namespace content |
| OLD | NEW |