Index: chrome/browser/download/chrome_download_manager_delegate.cc |
diff --git a/chrome/browser/download/chrome_download_manager_delegate.cc b/chrome/browser/download/chrome_download_manager_delegate.cc |
index 5482a50688408594183bc7c0e604e48a4e9fd63e..0ba4300afda1ae4b606507d975e80ca5611353f9 100644 |
--- a/chrome/browser/download/chrome_download_manager_delegate.cc |
+++ b/chrome/browser/download/chrome_download_manager_delegate.cc |
@@ -109,14 +109,12 @@ base::FilePath GetPlatformDownloadPath(Profile* profile, |
// file exits yet, use GetFullPath(). This should only happen during |
// ShowDownloadInShell(). |
// - Not Complete, and there's no intermediate file: GetFullPath() will be |
- // empty. This shouldn't happen since CanShowInFolder() returns false and |
- // this function shouldn't have been called. |
+ // empty. |
if (download->IsComplete()) { |
DCHECK(!download->GetTargetFilePath().empty()); |
return download->GetTargetFilePath(); |
} |
- DCHECK(!download->GetFullPath().empty()); |
return download->GetFullPath(); |
} |
@@ -193,6 +191,7 @@ bool ChromeDownloadManagerDelegate::DetermineDownloadTarget( |
DownloadItem* download, |
const content::DownloadTargetCallback& callback) { |
DownloadTargetDeterminer::Start(download, |
+ GetPlatformDownloadPath(profile_, download), |
download_prefs_.get(), |
last_download_path_, |
this, |
@@ -372,14 +371,18 @@ void ChromeDownloadManagerDelegate::OpenDownload(DownloadItem* download) { |
DCHECK(download->IsComplete()); |
if (!download->CanOpenDownload()) |
return; |
- platform_util::OpenItem(GetPlatformDownloadPath(profile_, download)); |
+ base::FilePath platform_path(GetPlatformDownloadPath(profile_, download)); |
+ DCHECK(!platform_path.empty()); |
+ platform_util::OpenItem(platform_path); |
} |
void ChromeDownloadManagerDelegate::ShowDownloadInShell( |
DownloadItem* download) { |
if (!download->CanShowInFolder()) |
return; |
- platform_util::ShowItemInFolder(GetPlatformDownloadPath(profile_, download)); |
+ base::FilePath platform_path(GetPlatformDownloadPath(profile_, download)); |
+ DCHECK(!platform_path.empty()); |
+ platform_util::ShowItemInFolder(platform_path); |
} |
void ChromeDownloadManagerDelegate::CheckForFileExistence( |