On browser close, the browser checks to see if there are any pending downloads.
commit422a7d10525d877558ca91916d1e51064abc23bb
authorfelt@chromium.org <felt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Mon, 21 Oct 2013 12:10:42 +0000 (21 12:10 +0000)
committerfelt@chromium.org <felt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Mon, 21 Oct 2013 12:10:42 +0000 (21 12:10 +0000)
tree07c4b14c86f198348420135b57b572f227f06862
parent9f661b0d1bf31cdf8d587ccdffbdd3270f85625b
On browser close, the browser checks to see if there are any pending downloads.

Currently: If there are any pending downloads, it halts the download and asks the user to keep or save the download.

New behavior: The user won't be prompted for pending downloads that are malicious (DANGEROUS_HOST, DANGEROUS_URL, DANGEROUS_CONTENT). Instead, they'll just be automatically cleaned up on exit. Note that if a user is prompted for *other* downloads, they may still be taken to the chrome://downloads page and see the malicious download while they're there.
Added a new test in chrome/browser/lifetime/browser_close_manager_browsertest.cc.

BUG=306230, 305387
TEST=
1. Download a malicious file (e.g., http://download.safebrowsingtest.com/download/test)
2. Quit the browser
3. The browser should close without a warning
4. Download a dangerous file like a SWF
5. Quit the browser
6. The browser should pop up a dialog asking you whether you should save the file

R=asanka@chromium.org, benjhayden@chromium.org, joi@chromium.org, pkasting@chromium.org, thakis@chromium.org

Review URL: https://codereview.chromium.org/26938003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@229784 0039d316-1c4b-4281-b951-d872f2087c98
17 files changed:
chrome/browser/app_controller_mac.mm
chrome/browser/download/download_browsertest.cc
chrome/browser/download/download_item_model.cc
chrome/browser/download/download_service.cc
chrome/browser/download/download_service.h
chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc
chrome/browser/lifetime/application_lifetime.cc
chrome/browser/lifetime/browser_close_manager.cc
chrome/browser/lifetime/browser_close_manager_browsertest.cc
chrome/browser/ui/browser.cc
chrome/browser/ui/browser_close_browsertest.cc
content/browser/download/download_manager_impl.cc
content/browser/download/download_manager_impl.h
content/public/browser/download_manager.h
content/public/test/download_test_observer.cc
content/public/test/download_test_observer.h
content/public/test/mock_download_manager.h