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

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: Sync'd to LKGR (r162700) Created 8 years, 2 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 f7d2d12c593c50fea8f14c6a2b65e624fe8b3d04..c727ea5430dc7d5d3be803a1c8dd474599bbdf09 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,18 +25,28 @@ void DownloadItemImplDelegate::Detach() {
--count_;
}
+void DownloadItemImplDelegate::DetermineDownloadTarget(
+ DownloadItemImpl* download, const 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);
+}
+
void DownloadItemImplDelegate::ReadyForDownloadCompletion(
DownloadItemImpl* download,
const base::Closure& complete_callback) {
complete_callback.Run();
}
-bool DownloadItemImplDelegate::ShouldOpenFileBasedOnExtension(
- const FilePath& path) {
+bool DownloadItemImplDelegate::ShouldOpenDownload(DownloadItemImpl* download) {
return false;
}
-bool DownloadItemImplDelegate::ShouldOpenDownload(DownloadItemImpl* download) {
+bool DownloadItemImplDelegate::ShouldOpenFileBasedOnExtension(
+ const FilePath& path) {
return false;
}
« no previous file with comments | « content/browser/download/download_item_impl_delegate.h ('k') | content/browser/download/download_item_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698