From 14ce83fb15ddb2dbd3c8a6d81a78435209359ff8 Mon Sep 17 00:00:00 2001 From: "estade@chromium.org" Date: Thu, 28 May 2009 18:35:24 +0000 Subject: Generalize the code that checks for user actions in the render view to work on all platforms. Also, on linux, assume the user denies every download which we would have prompted him with. BUG=12709 TEST=windows is still carpet-bombing resilient and linux can download from the same page more than once. Review URL: http://codereview.chromium.org/113925 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17089 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/download/download_request_manager.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'chrome/browser/download') diff --git a/chrome/browser/download/download_request_manager.cc b/chrome/browser/download/download_request_manager.cc index 4364700..d779b66 100644 --- a/chrome/browser/download/download_request_manager.cc +++ b/chrome/browser/download/download_request_manager.cc @@ -66,10 +66,15 @@ void DownloadRequestManager::TabDownloadState::PromptUserForDownload( if (is_showing_prompt()) return; // Already showing prompt. - if (DownloadRequestManager::delegate_) + if (DownloadRequestManager::delegate_) { NotifyCallbacks(DownloadRequestManager::delegate_->ShouldAllowDownload()); - else + } else { dialog_delegate_ = DownloadRequestDialogDelegate::Create(tab, this); + // TODO(estade): the dialog delegate isn't yet implemented on linux. Just + // assume we shouldn't allow the download. + if (dialog_delegate_ == NULL) + NotifyCallbacks(false); + } } void DownloadRequestManager::TabDownloadState::Cancel() { -- cgit v1.1