summaryrefslogtreecommitdiffstats
path: root/extensions/browser/guest_view
diff options
context:
space:
mode:
authorwjmaclean <wjmaclean@chromium.org>2016-01-20 18:15:40 -0800
committerCommit bot <commit-bot@chromium.org>2016-01-21 02:17:37 +0000
commit5b8cdcc82fc9da7bab15fd3dbf65df843dc73589 (patch)
treeb4fd4078a5b3687c283ccca3ffd48187e81423fa /extensions/browser/guest_view
parent9f37598bee12fd9c1400921061b46300e439e341 (diff)
downloadchromium_src-5b8cdcc82fc9da7bab15fd3dbf65df843dc73589.zip
chromium_src-5b8cdcc82fc9da7bab15fd3dbf65df843dc73589.tar.gz
chromium_src-5b8cdcc82fc9da7bab15fd3dbf65df843dc73589.tar.bz2
Implement webview.captureVisibleRegion()
This CL implements webview.captureVisibleRegion(), an extension/apps API to allow WebView users to capture screenshots of the contents displayed in a WebView. The surfaces contents capture has been plumbed via RenderWidgetHostViewChildFrame so this implementation should not require changes when WebView switches to using OOPIF. As part of the implementation, there are two notable refactors: 1) CaptureWebContentsFunction has been refactored into WebContentsCaptureClient to remove the extensions::AsyncExtensionFunction dependence so that this code can be used by both tabs.captureVisibleTab and webview.captureVisibleRegion, and 2) common code from DelegatedFrameHost has ben moved to content/browser/compositor/surface_utils.* in order to avoid duplication as both DelegatedFrameHost and RenderWidgetHostViewChildFrame now use the code. BUG=326755 Review URL: https://codereview.chromium.org/1582053002 Cr-Commit-Position: refs/heads/master@{#370565}
Diffstat (limited to 'extensions/browser/guest_view')
-rw-r--r--extensions/browser/guest_view/web_view/web_view_apitest.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/extensions/browser/guest_view/web_view/web_view_apitest.cc b/extensions/browser/guest_view/web_view/web_view_apitest.cc
index 9896e13..89bbf05 100644
--- a/extensions/browser/guest_view/web_view/web_view_apitest.cc
+++ b/extensions/browser/guest_view/web_view/web_view_apitest.cc
@@ -736,5 +736,8 @@ IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestWebViewInsideFrame) {
LaunchApp("web_view/inside_iframe");
}
+IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestCaptureVisibleRegion) {
+ RunTest("testCaptureVisibleRegion", "web_view/apitest");
+}
} // namespace extensions