diff options
author | jackhou <jackhou@chromium.org> | 2015-05-28 23:36:46 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-29 06:37:19 +0000 |
commit | ae8e6e5c1e0916bee7403acb12888a55774bcc76 (patch) | |
tree | c543820cf5268283e17f57a16b1796deb593df87 /chrome/browser/app_controller_mac.mm | |
parent | 38394241b2f6a04fc1296394ccae91931628c21e (diff) | |
download | chromium_src-ae8e6e5c1e0916bee7403acb12888a55774bcc76.zip chromium_src-ae8e6e5c1e0916bee7403acb12888a55774bcc76.tar.gz chromium_src-ae8e6e5c1e0916bee7403acb12888a55774bcc76.tar.bz2 |
[Mac] Cancel downloads when quitting with apps open.
When the user tries to quit Chrome and there are both pending downloads
and open packaged apps, we first prompt whether to cancel downloads or
cancel quitting Chrome. If the user chooses to cancel downloads, we
close all browser windows but leave Chrome running to serve apps.
If the user tries to quit again,
BrowserCloseManager::ConfirmCloseWithPendingDownloads crashes
because there are no browsers with which to show a prompt.
This CL skips ConfirmCloseWithPendingDownloads on Mac since
app_controller_mac already prompts about this in
shouldQuitWithInProgressDownloads.
In the above case, downloads should also be cancelled to be consistent with
the user's choice, and the concept of the browser side of Chrome having
quit.
TEST=See bug.
BUG=491106
Review URL: https://codereview.chromium.org/1148953007
Cr-Commit-Position: refs/heads/master@{#331929}
Diffstat (limited to 'chrome/browser/app_controller_mac.mm')
-rw-r--r-- | chrome/browser/app_controller_mac.mm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm index 40245a0..137a060 100644 --- a/chrome/browser/app_controller_mac.mm +++ b/chrome/browser/app_controller_mac.mm @@ -451,6 +451,12 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver { content::NotificationService::NoDetails()); // This will close all browser sessions. chrome::CloseAllBrowsers(); + + // At this point, the user has already chosen to cancel downloads. If we + // were to shut down as usual, the downloads would be cancelled in + // DownloadService::Shutdown(). + DownloadService::CancelAllDownloads(); + return NO; } |