summaryrefslogtreecommitdiff
path: root/content/browser/download/download_item_impl_delegate.cc
diff options
context:
space:
mode:
authorTorne (Richard Coles) <torne@google.com>2012-11-14 11:43:16 +0000
committerTorne (Richard Coles) <torne@google.com>2012-11-14 11:43:16 +0000
commit5821806d5e7f356e8fa4b058a389a808ea183019 (patch)
treee19f4793aac92e2c0d9a01087019a60d6657d838 /content/browser/download/download_item_impl_delegate.cc
parent8e79a8efe247f109aafd917a69e8a392961b3687 (diff)
downloadchromium_org-5821806d5e7f356e8fa4b058a389a808ea183019.tar.gz
Merge from Chromium at DEPS revision r167172
This commit was generated by merge_to_master.py. Change-Id: Ib8d56fd5ae39a2d7e8c91dcd76cc6d13f25f2aab
Diffstat (limited to 'content/browser/download/download_item_impl_delegate.cc')
-rw-r--r--content/browser/download/download_item_impl_delegate.cc82
1 files changed, 82 insertions, 0 deletions
diff --git a/content/browser/download/download_item_impl_delegate.cc b/content/browser/download/download_item_impl_delegate.cc
new file mode 100644
index 0000000000..048b35bedc
--- /dev/null
+++ b/content/browser/download/download_item_impl_delegate.cc
@@ -0,0 +1,82 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/browser/download/download_item_impl_delegate.h"
+
+#include "base/logging.h"
+#include "content/browser/download/download_item_impl.h"
+
+namespace content {
+
+// Infrastructure in DownloadItemImplDelegate to assert invariant that
+// delegate always outlives all attached DownloadItemImpls.
+DownloadItemImplDelegate::DownloadItemImplDelegate()
+ : count_(0) {}
+
+DownloadItemImplDelegate::~DownloadItemImplDelegate() {
+ DCHECK_EQ(0, count_);
+}
+
+void DownloadItemImplDelegate::Attach() {
+ ++count_;
+}
+
+void DownloadItemImplDelegate::Detach() {
+ DCHECK_LT(0, count_);
+ --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,
+ DownloadItem::TARGET_DISPOSITION_OVERWRITE,
+ DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
+ target_path);
+}
+
+void DownloadItemImplDelegate::ReadyForDownloadCompletion(
+ DownloadItemImpl* download,
+ const base::Closure& complete_callback) {
+ complete_callback.Run();
+}
+
+bool DownloadItemImplDelegate::ShouldOpenDownload(
+ DownloadItemImpl* download, const ShouldOpenDownloadCallback& callback) {
+ return false;
+}
+
+bool DownloadItemImplDelegate::ShouldOpenFileBasedOnExtension(
+ const FilePath& path) {
+ return false;
+}
+
+void DownloadItemImplDelegate::CheckForFileRemoval(
+ DownloadItemImpl* download_item) {}
+
+BrowserContext* DownloadItemImplDelegate::GetBrowserContext() const {
+ return NULL;
+}
+
+void DownloadItemImplDelegate::UpdatePersistence(DownloadItemImpl* download) {}
+
+void DownloadItemImplDelegate::DownloadStopped(DownloadItemImpl* download) {}
+
+void DownloadItemImplDelegate::DownloadCompleted(DownloadItemImpl* download) {}
+
+void DownloadItemImplDelegate::DownloadOpened(DownloadItemImpl* download) {}
+
+void DownloadItemImplDelegate::DownloadRemoved(DownloadItemImpl* download) {}
+
+void DownloadItemImplDelegate::DownloadRenamedToIntermediateName(
+ DownloadItemImpl* download) {}
+
+void DownloadItemImplDelegate::DownloadRenamedToFinalName(
+ DownloadItemImpl* download) {}
+
+void DownloadItemImplDelegate::AssertStateConsistent(
+ DownloadItemImpl* download) const {}
+
+} // namespace content