Index: content/renderer/render_view_impl.cc |
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc |
index d2b9103753568d8f999c49beca4f585786c57ef5..f0191a593af1e43e9c211fda367d89b7348c17a0 100644 |
--- a/content/renderer/render_view_impl.cc |
+++ b/content/renderer/render_view_impl.cc |
@@ -6578,4 +6578,26 @@ void RenderViewImpl::OnReleaseDisambiguationPopupDIB( |
RenderProcess::current()->ReleaseTransportDIB(dib); |
} |
+#if defined(OS_ANDROID) |
+void RenderViewImpl::SetCapturePictureCallback( |
+ const CapturePictureCallback& callback) { |
+ if (CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnableWebViewCapturePictureAPI)) |
+ capture_picture_callback_ = callback; |
+} |
+ |
+skia::RefPtr<SkPicture> RenderViewImpl::CapturePicture() { |
+ return web_layer_tree_view_ && CommandLine::ForCurrentProcess()->HasSwitch( |
Leandro Graciá Gil
2013/01/11 13:11:33
This patch depends on https://codereview.chromium.
|
+ switches::kEnableWebViewCapturePictureAPI) ? |
+ web_layer_tree_view_->capturePicture() : |
+ skia::RefPtr<SkPicture>(); |
+} |
+ |
+void RenderViewImpl::didBecomeReadyForAdditionalInput() { |
joth
2013/01/11 21:41:17
I propose we should separate out the two different
jamesr
2013/01/11 21:53:26
why are you hooking on didBecomeReadyForAdditional
Leandro Graciá Gil
2013/01/12 00:26:09
The intention is to trigger the callback on every
|
+ RenderWidget::didBecomeReadyForAdditionalInput(); |
+ if (web_layer_tree_view_ && !capture_picture_callback_.is_null()) |
+ capture_picture_callback_.Run(web_layer_tree_view_->capturePicture()); |
+} |
+#endif |
+ |
} // namespace content |