| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/download/download_item_impl_delegate.h" | 5 #include "content/browser/download/download_item_impl_delegate.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "content/browser/download/download_item_impl.h" | 8 #include "content/browser/download/download_item_impl.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 ++count_; | 22 ++count_; |
| 23 } | 23 } |
| 24 | 24 |
| 25 void DownloadItemImplDelegate::Detach() { | 25 void DownloadItemImplDelegate::Detach() { |
| 26 DCHECK_LT(0, count_); | 26 DCHECK_LT(0, count_); |
| 27 --count_; | 27 --count_; |
| 28 } | 28 } |
| 29 | 29 |
| 30 void DownloadItemImplDelegate::DetermineDownloadTarget( | 30 void DownloadItemImplDelegate::DetermineDownloadTarget( |
| 31 DownloadItemImpl* download, const DownloadTargetCallback& callback) { | 31 DownloadItemImpl* download, const DownloadTargetCallback& callback) { |
| 32 // TODO(rdsmith/asanka): Do something useful if forced file path is null. | 32 // TODO(qinmin): Do something useful if both forced file path and |
| 33 base::FilePath target_path(download->GetForcedFilePath()); | 33 // target file path are null. |
| 34 base::FilePath target_path = download->GetForcedFilePath().empty() ? |
| 35 download->GetTargetFilePath() : download->GetForcedFilePath(); |
| 34 callback.Run(target_path, | 36 callback.Run(target_path, |
| 35 DownloadItem::TARGET_DISPOSITION_OVERWRITE, | 37 DownloadItem::TARGET_DISPOSITION_OVERWRITE, |
| 36 DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, | 38 DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, |
| 37 target_path); | 39 target_path); |
| 38 } | 40 } |
| 39 | 41 |
| 40 bool DownloadItemImplDelegate::ShouldCompleteDownload( | 42 bool DownloadItemImplDelegate::ShouldCompleteDownload( |
| 41 DownloadItemImpl* download, | 43 DownloadItemImpl* download, |
| 42 const base::Closure& complete_callback) { | 44 const base::Closure& complete_callback) { |
| 43 return true; | 45 return true; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 77 |
| 76 void DownloadItemImplDelegate::ShowDownloadInShell(DownloadItemImpl* download) { | 78 void DownloadItemImplDelegate::ShowDownloadInShell(DownloadItemImpl* download) { |
| 77 } | 79 } |
| 78 | 80 |
| 79 void DownloadItemImplDelegate::DownloadRemoved(DownloadItemImpl* download) {} | 81 void DownloadItemImplDelegate::DownloadRemoved(DownloadItemImpl* download) {} |
| 80 | 82 |
| 81 void DownloadItemImplDelegate::AssertStateConsistent( | 83 void DownloadItemImplDelegate::AssertStateConsistent( |
| 82 DownloadItemImpl* download) const {} | 84 DownloadItemImpl* download) const {} |
| 83 | 85 |
| 84 } // namespace content | 86 } // namespace content |
| OLD | NEW |