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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 11861008: Expose the capturePicture feature in RenderView for Android WebView legacy API support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 6560 matching lines...) Expand 10 before | Expand all | Expand 10 after
6571 return true; 6571 return true;
6572 } 6572 }
6573 #endif 6573 #endif
6574 6574
6575 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( 6575 void RenderViewImpl::OnReleaseDisambiguationPopupDIB(
6576 TransportDIB::Handle dib_handle) { 6576 TransportDIB::Handle dib_handle) {
6577 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); 6577 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle);
6578 RenderProcess::current()->ReleaseTransportDIB(dib); 6578 RenderProcess::current()->ReleaseTransportDIB(dib);
6579 } 6579 }
6580 6580
6581 #if defined(OS_ANDROID)
6582 void RenderViewImpl::SetCapturePictureCallback(
6583 const CapturePictureCallback& callback) {
6584 if (CommandLine::ForCurrentProcess()->HasSwitch(
6585 switches::kEnableWebViewCapturePictureAPI))
6586 capture_picture_callback_ = callback;
6587 }
6588
6589 skia::RefPtr<SkPicture> RenderViewImpl::CapturePicture() {
6590 return web_layer_tree_view_ && CommandLine::ForCurrentProcess()->HasSwitch(
Leandro Graciá Gil 2013/01/11 13:11:33 This patch depends on https://codereview.chromium.
6591 switches::kEnableWebViewCapturePictureAPI) ?
6592 web_layer_tree_view_->capturePicture() :
6593 skia::RefPtr<SkPicture>();
6594 }
6595
6596 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
6597 RenderWidget::didBecomeReadyForAdditionalInput();
6598 if (web_layer_tree_view_ && !capture_picture_callback_.is_null())
6599 capture_picture_callback_.Run(web_layer_tree_view_->capturePicture());
6600 }
6601 #endif
6602
6581 } // namespace content 6603 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698