• Jeremy Roman's avatar
    Drop downloads in portals. · f1d8608b
    Jeremy Roman authored
    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: default avatarLucas Gadani <lfg@chromium.org>
    Reviewed-by: default avatarCharlie Reis <creis@chromium.org>
    Commit-Queue: Jeremy Roman <jbroman@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#775843}
    f1d8608b
download_manager_delegate.cc 3.32 KB