Drop downloads in portals.
We don't want portals to be an avenue for download spam, and we aren't presently aware of uses that require downloads in portals. This is largely straightforward, but the non-chrome DownloadManagerDelegate was unfortunately left as a stub that never calls WebContentsDelegate::CanDownload (like the chrome/ one does). Accordingly, this CL expands it to a simplified version of what the chrome/ one does. The post-task was left because the TODO comment there insinuates that not doing so is risky. It would be straightforward to inline the posted task in the future if one wished to. This strategy is used instead of a NavigationThrottle, because NavigationThrottle only covers downloads that are initiated by navigation, but <a download> and other renderer-initiated downloads do not fire navigation throttles. AwWebContentsDelegate::CanDownload is removed because it was previously unreachable but is now reachable (because AwDownloadManagerDelegate does not override CheckDownloadAllowed), but behavior is otherwise preserved. Android WebView relies on AwDownloadManagerDelegate::InterceptDownloadIfApplicable for its download interception features. Bug: 967202 Change-Id: Ic019688aab81ebc92728bfd715bb10a5de3f36d2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2229463Reviewed-by:Lucas Gadani <lfg@chromium.org> Reviewed-by:
Charlie Reis <creis@chromium.org> Commit-Queue: Jeremy Roman <jbroman@chromium.org> Cr-Commit-Position: refs/heads/master@{#775843}
Showing
Please register or sign in to comment