Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4836)

Unified Diff: chrome/browser/download/chrome_download_manager_delegate.cc

Issue 14640020: [Resumption 9/11] Handle filename determination for resumed downloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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(

Powered by Google App Engine
This is Rietveld 408576698