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_manager_impl.h" | 5 #include "content/browser/download/download_manager_impl.h" |
6 | 6 |
7 #include <iterator> | 7 #include <iterator> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 // DownloadItemImplDelegate::DownloadTargetCallback and | 253 // DownloadItemImplDelegate::DownloadTargetCallback and |
254 // DownloadManagerDelegate::DownloadTargetCallback having the same | 254 // DownloadManagerDelegate::DownloadTargetCallback having the same |
255 // type. If the types ever diverge, gasket code will need to | 255 // type. If the types ever diverge, gasket code will need to |
256 // be written here. | 256 // be written here. |
257 if (!delegate_ || !delegate_->DetermineDownloadTarget(item, callback)) { | 257 if (!delegate_ || !delegate_->DetermineDownloadTarget(item, callback)) { |
258 base::FilePath target_path = item->GetForcedFilePath(); | 258 base::FilePath target_path = item->GetForcedFilePath(); |
259 // TODO(asanka): Determine a useful path if |target_path| is empty. | 259 // TODO(asanka): Determine a useful path if |target_path| is empty. |
260 callback.Run(target_path, | 260 callback.Run(target_path, |
261 DownloadItem::TARGET_DISPOSITION_OVERWRITE, | 261 DownloadItem::TARGET_DISPOSITION_OVERWRITE, |
262 DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, | 262 DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, |
263 target_path); | 263 target_path, |
| 264 false); |
264 } | 265 } |
265 } | 266 } |
266 | 267 |
267 bool DownloadManagerImpl::ShouldCompleteDownload( | 268 bool DownloadManagerImpl::ShouldCompleteDownload( |
268 DownloadItemImpl* item, const base::Closure& complete_callback) { | 269 DownloadItemImpl* item, const base::Closure& complete_callback) { |
269 if (!delegate_ || | 270 if (!delegate_ || |
270 delegate_->ShouldCompleteDownload(item, complete_callback)) { | 271 delegate_->ShouldCompleteDownload(item, complete_callback)) { |
271 return true; | 272 return true; |
272 } | 273 } |
273 // Otherwise, the delegate has accepted responsibility to run the | 274 // Otherwise, the delegate has accepted responsibility to run the |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 if (delegate_) | 726 if (delegate_) |
726 delegate_->OpenDownload(download); | 727 delegate_->OpenDownload(download); |
727 } | 728 } |
728 | 729 |
729 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) { | 730 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) { |
730 if (delegate_) | 731 if (delegate_) |
731 delegate_->ShowDownloadInShell(download); | 732 delegate_->ShowDownloadInShell(download); |
732 } | 733 } |
733 | 734 |
734 } // namespace content | 735 } // namespace content |
OLD | NEW |