|
|
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.
Finally, this CL adds a surface-drawn callback to
RenderWidgetHostViewChildFrame, to allow deferring a
screen capture request until a frame has actually been
drawn. This callback can be used to simplify some
existing tests.
BUG= 326755
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation
Committed: https://crrev.com/f89035216b627283b79731c3e6a7957707ed9034
Cr-Commit-Position: refs/heads/master@{#372799}
Total comments: 15
Total comments: 2
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+584 lines, -468 lines) |
Patch |
 |
M |
chrome/browser/extensions/api/tabs/tabs_api.h
|
View
|
|
2 chunks |
+12 lines, -4 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/extensions/api/tabs/tabs_api.cc
|
View
|
1
2
3
|
2 chunks |
+38 lines, -0 lines |
0 comments
|
Download
|
 |
M |
chrome/common/extensions/api/webview_tag.json
|
View
|
|
1 chunk |
+22 lines, -0 lines |
0 comments
|
Download
|
 |
M |
content/browser/compositor/delegated_frame_host.h
|
View
|
1
2
3
|
1 chunk |
+0 lines, -15 lines |
0 comments
|
Download
|
 |
M |
content/browser/compositor/delegated_frame_host.cc
|
View
|
1
2
3
|
3 chunks |
+5 lines, -153 lines |
0 comments
|
Download
|
 |
M |
content/browser/compositor/surface_utils.h
|
View
|
|
2 chunks |
+10 lines, -0 lines |
0 comments
|
Download
|
 |
M |
content/browser/compositor/surface_utils.cc
|
View
|
1
2
3
4
5
|
3 chunks |
+174 lines, -0 lines |
0 comments
|
Download
|
 |
M |
content/browser/frame_host/render_widget_host_view_child_frame.h
|
View
|
1
2
3
|
4 chunks |
+23 lines, -0 lines |
0 comments
|
Download
|
 |
M |
content/browser/frame_host/render_widget_host_view_child_frame.cc
|
View
|
1
2
3
4
|
4 chunks |
+50 lines, -6 lines |
0 comments
|
Download
|
 |
M |
content/browser/frame_host/render_widget_host_view_guest.cc
|
View
|
1
2
3
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
content/browser/renderer_host/render_widget_host_view_android.cc
|
View
|
1
2
3
4
|
1 chunk |
+5 lines, -0 lines |
0 comments
|
Download
|
 |
D |
extensions/browser/api/capture_web_contents_function.h
|
View
|
|
1 chunk |
+0 lines, -67 lines |
0 comments
|
Download
|
 |
D |
extensions/browser/api/capture_web_contents_function.cc
|
View
|
1
2
3
|
1 chunk |
+0 lines, -150 lines |
0 comments
|
Download
|
 |
M |
extensions/browser/api/guest_view/extension_view/extension_view_internal_api.h
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
M |
extensions/browser/api/guest_view/web_view/web_view_internal_api.h
|
View
|
|
2 chunks |
+24 lines, -1 line |
0 comments
|
Download
|
 |
M |
extensions/browser/api/guest_view/web_view/web_view_internal_api.cc
|
View
|
|
1 chunk |
+56 lines, -0 lines |
0 comments
|
Download
|
 |
A + |
extensions/browser/api/web_contents_capture_client.h
|
View
|
|
2 chunks |
+14 lines, -23 lines |
0 comments
|
Download
|
 |
A + |
extensions/browser/api/web_contents_capture_client.cc
|
View
|
1
2
3
|
6 chunks |
+39 lines, -45 lines |
0 comments
|
Download
|
 |
M |
extensions/browser/guest_view/web_view/web_view_apitest.cc
|
View
|
1
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
 |
M |
extensions/common/api/_api_features.json
|
View
|
|
1 chunk |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
extensions/common/api/web_view_internal.json
|
View
|
|
1 chunk |
+27 lines, -0 lines |
0 comments
|
Download
|
 |
M |
extensions/extensions.gypi
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
extensions/renderer/dispatcher.cc
|
View
|
|
2 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
extensions/renderer/resources/extensions_renderer_resources.grd
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
extensions/renderer/resources/guest_view/web_view/web_view.js
|
View
|
|
2 chunks |
+9 lines, -0 lines |
0 comments
|
Download
|
 |
A |
extensions/renderer/resources/guest_view/web_view/web_view_experimental.js
|
View
|
|
1 chunk |
+24 lines, -0 lines |
0 comments
|
Download
|
 |
M |
extensions/test/data/web_view/apitest/main.js
|
View
|
1
|
2 chunks |
+32 lines, -1 line |
0 comments
|
Download
|
Total messages: 43 (14 generated)
|