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

Unified Diff: content/browser/download/download_item_impl_delegate.cc

Issue 10912173: Replace the DownloadFileManager with direct ownership of DownloadFileImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporated comments and sync'd to r158560 Created 8 years, 3 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: content/browser/download/download_item_impl_delegate.cc
diff --git a/content/browser/download/download_item_impl_delegate.cc b/content/browser/download/download_item_impl_delegate.cc
index 4a889f77d24e5dc68b198fa70e16b162aeb9bd38..fb0f4f7da113f8d8e126dc0629fbd161777ebb26 100644
--- a/content/browser/download/download_item_impl_delegate.cc
+++ b/content/browser/download/download_item_impl_delegate.cc
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/logging.h"
#include "content/browser/download/download_item_impl_delegate.h"
-class DownloadItemImpl;
+#include "base/logging.h"
+#include "content/browser/download/download_item_impl.h"
// Infrastructure in DownloadItemImplDelegate to assert invariant that
// delegate always outlives all attached DownloadItemImpls.
@@ -25,15 +25,25 @@ void DownloadItemImplDelegate::Detach() {
--count_;
}
-bool DownloadItemImplDelegate::ShouldOpenFileBasedOnExtension(
- const FilePath& path) {
- return false;
+void DownloadItemImplDelegate::DetermineDownloadTarget(
+ DownloadItemImpl* download, DownloadTargetCallback callback) {
+ // TODO(rdsmith/asanka): Do something useful if forced file path is null.
+ FilePath target_path(download->GetForcedFilePath());
+ callback.Run(target_path,
+ content::DownloadItem::TARGET_DISPOSITION_OVERWRITE,
+ content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
+ target_path);
}
bool DownloadItemImplDelegate::ShouldOpenDownload(DownloadItemImpl* download) {
return false;
}
+bool DownloadItemImplDelegate::ShouldOpenFileBasedOnExtension(
+ const FilePath& path) {
+ return false;
+}
+
void DownloadItemImplDelegate::CheckForFileRemoval(
DownloadItemImpl* download_item) {}

Powered by Google App Engine
This is Rietveld 408576698