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 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1340 | 1340 |
1341 void RenderWidgetHostImpl::GetSnapshotFromRenderer( | 1341 void RenderWidgetHostImpl::GetSnapshotFromRenderer( |
1342 const gfx::Rect& src_subrect, | 1342 const gfx::Rect& src_subrect, |
1343 const base::Callback<void(bool, const SkBitmap&)>& callback) { | 1343 const base::Callback<void(bool, const SkBitmap&)>& callback) { |
1344 TRACE_EVENT0("browser", "RenderWidgetHostImpl::GetSnapshotFromRenderer"); | 1344 TRACE_EVENT0("browser", "RenderWidgetHostImpl::GetSnapshotFromRenderer"); |
1345 pending_snapshots_.push(callback); | 1345 pending_snapshots_.push(callback); |
1346 | 1346 |
1347 gfx::Rect copy_rect = src_subrect.IsEmpty() ? | 1347 gfx::Rect copy_rect = src_subrect.IsEmpty() ? |
1348 gfx::Rect(view_->GetViewBounds().size()) : src_subrect; | 1348 gfx::Rect(view_->GetViewBounds().size()) : src_subrect; |
1349 | 1349 |
1350 gfx::Rect copy_rect_in_pixel = ConvertRectToPixel(view_, copy_rect); | 1350 gfx::Rect copy_rect_in_pixel = ConvertViewRectToPixel(view_, copy_rect); |
1351 Send(new ViewMsg_Snapshot(GetRoutingID(), copy_rect_in_pixel)); | 1351 Send(new ViewMsg_Snapshot(GetRoutingID(), copy_rect_in_pixel)); |
1352 } | 1352 } |
1353 | 1353 |
1354 void RenderWidgetHostImpl::OnSnapshot(bool success, | 1354 void RenderWidgetHostImpl::OnSnapshot(bool success, |
1355 const SkBitmap& bitmap) { | 1355 const SkBitmap& bitmap) { |
1356 if (pending_snapshots_.size() == 0) { | 1356 if (pending_snapshots_.size() == 0) { |
1357 LOG(ERROR) << "RenderWidgetHostImpl::OnSnapshot: " | 1357 LOG(ERROR) << "RenderWidgetHostImpl::OnSnapshot: " |
1358 "Received a snapshot that was not requested."; | 1358 "Received a snapshot that was not requested."; |
1359 return; | 1359 return; |
1360 } | 1360 } |
(...skipping 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2482 } | 2482 } |
2483 | 2483 |
2484 void RenderWidgetHostImpl::DetachDelegate() { | 2484 void RenderWidgetHostImpl::DetachDelegate() { |
2485 delegate_ = NULL; | 2485 delegate_ = NULL; |
2486 } | 2486 } |
2487 | 2487 |
2488 void RenderWidgetHostImpl::FrameSwapped(const cc::LatencyInfo& latency_info) { | 2488 void RenderWidgetHostImpl::FrameSwapped(const cc::LatencyInfo& latency_info) { |
2489 } | 2489 } |
2490 | 2490 |
2491 } // namespace content | 2491 } // namespace content |
OLD | NEW |