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

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

Issue 259523008: Remove RenderWidgetHost::GetSnapshotFromRenderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: getsnapshotfromrenderer: rm Created 6 years, 8 months 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
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.h ('k') | content/common/view_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 72d4654dab8ce6f02217d28962ae57f7983c0299..2f6e180436ca3e56578ce52802e916d035139dc4 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -485,7 +485,6 @@ bool RenderWidgetHostImpl::OnMessageReceived(const IPC::Message &msg) {
IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionChanged, OnSelectionChanged)
IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionBoundsChanged,
OnSelectionBoundsChanged)
- IPC_MESSAGE_HANDLER(ViewHostMsg_Snapshot, OnSnapshot)
#if defined(OS_WIN)
IPC_MESSAGE_HANDLER(ViewHostMsg_WindowlessPluginDummyWindowCreated,
OnWindowlessPluginDummyWindowCreated)
@@ -1188,24 +1187,6 @@ void RenderWidgetHostImpl::InvalidateScreenInfo() {
screen_info_.reset();
}
-void RenderWidgetHostImpl::GetSnapshotFromRenderer(
- const gfx::Rect& src_subrect,
- const base::Callback<void(bool, const SkBitmap&)>& callback) {
- TRACE_EVENT0("browser", "RenderWidgetHostImpl::GetSnapshotFromRenderer");
- if (!view_) {
- callback.Run(false, SkBitmap());
- return;
- }
-
- pending_snapshots_.push(callback);
-
- gfx::Rect copy_rect = src_subrect.IsEmpty() ?
- gfx::Rect(view_->GetViewBounds().size()) : src_subrect;
-
- gfx::Rect copy_rect_in_pixel = ConvertViewRectToPixel(view_, copy_rect);
- Send(new ViewMsg_Snapshot(GetRoutingID(), copy_rect_in_pixel));
-}
-
void RenderWidgetHostImpl::OnSelectionChanged(const base::string16& text,
size_t offset,
const gfx::Range& range) {
@@ -1220,26 +1201,6 @@ void RenderWidgetHostImpl::OnSelectionBoundsChanged(
}
}
-void RenderWidgetHostImpl::OnSnapshot(bool success,
- const SkBitmap& bitmap) {
- if (pending_snapshots_.size() == 0) {
- LOG(ERROR) << "RenderWidgetHostImpl::OnSnapshot: "
- "Received a snapshot that was not requested.";
- return;
- }
-
- base::Callback<void(bool, const SkBitmap&)> callback =
- pending_snapshots_.front();
- pending_snapshots_.pop();
-
- if (!success) {
- callback.Run(success, SkBitmap());
- return;
- }
-
- callback.Run(success, bitmap);
-}
-
void RenderWidgetHostImpl::UpdateVSyncParameters(base::TimeTicks timebase,
base::TimeDelta interval) {
Send(new ViewMsg_UpdateVSyncParameters(GetRoutingID(), timebase, interval));
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.h ('k') | content/common/view_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698