diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-16 16:50:37 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-16 16:50:37 +0000 |
commit | 7a22201cc3fa0f0dd33504aded3df89b14a14aff (patch) | |
tree | ca645cc2a0437e8afd5dc6cf9d42928c7f726fe5 /chrome/browser/browser.cc | |
parent | 903db6c6ec1042a98ffde56981ede58d574c7dba (diff) | |
download | chromium_src-7a22201cc3fa0f0dd33504aded3df89b14a14aff.zip chromium_src-7a22201cc3fa0f0dd33504aded3df89b14a14aff.tar.gz chromium_src-7a22201cc3fa0f0dd33504aded3df89b14a14aff.tar.bz2 |
A recent change to the way we close tabs (http://codereview.chromium.org/235050)
causes Browser::CanCloseContentsAt() to be called several times for the same tab.
This was triggering a DCHECK in the "download in progress" warning.
BUG=24974
TEST=See bug. Test thoroughly the "dowload in progress" warning: start a big
download, then close Chrome (by closing all tabs, by using the top window
close button). Make sure both behaviors (continue/abort closing) work as
expected.
Review URL: http://codereview.chromium.org/273076
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29289 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser.cc')
-rw-r--r-- | chrome/browser/browser.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index f0c6624..865f932 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -2674,8 +2674,11 @@ void Browser::ClearUnloadState(TabContents* tab) { bool Browser::CanCloseWithInProgressDownloads() { if (cancel_download_confirmation_state_ != NOT_PROMPTED) { - // This should probably not happen. - DCHECK(cancel_download_confirmation_state_ != WAITING_FOR_RESPONSE); + if (cancel_download_confirmation_state_ == WAITING_FOR_RESPONSE) { + // We need to hear from the user before we can close. + return false; + } + // RESPONSE_RECEIVED case, the user decided to go along with the closing. return true; } |