| 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 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 } | 475 } |
| 476 | 476 |
| 477 void DownloadManagerImpl::OnSavePackageSuccessfullyFinished( | 477 void DownloadManagerImpl::OnSavePackageSuccessfullyFinished( |
| 478 DownloadItem* download_item) { | 478 DownloadItem* download_item) { |
| 479 FOR_EACH_OBSERVER(Observer, observers_, | 479 FOR_EACH_OBSERVER(Observer, observers_, |
| 480 OnSavePackageSuccessfullyFinished(this, download_item)); | 480 OnSavePackageSuccessfullyFinished(this, download_item)); |
| 481 } | 481 } |
| 482 | 482 |
| 483 void DownloadManagerImpl::CancelDownload(int32 download_id) { | 483 void DownloadManagerImpl::CancelDownload(int32 download_id) { |
| 484 DownloadItem* download = GetDownload(download_id); | 484 DownloadItem* download = GetDownload(download_id); |
| 485 if (!download || !download->IsInProgress()) | 485 if (!download || !download->IsPartialDownload()) |
| 486 return; | 486 return; |
| 487 download->Cancel(true); | 487 download->Cancel(true); |
| 488 } | 488 } |
| 489 | 489 |
| 490 // Resume a download of a specific URL. We send the request to the | 490 // Resume a download of a specific URL. We send the request to the |
| 491 // ResourceDispatcherHost, and let it send us responses like a regular | 491 // ResourceDispatcherHost, and let it send us responses like a regular |
| 492 // download. | 492 // download. |
| 493 void DownloadManagerImpl::ResumeInterruptedDownload( | 493 void DownloadManagerImpl::ResumeInterruptedDownload( |
| 494 scoped_ptr<content::DownloadUrlParameters> params, | 494 scoped_ptr<content::DownloadUrlParameters> params, |
| 495 content::DownloadId id) { | 495 content::DownloadId id) { |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 if (delegate_) | 647 if (delegate_) |
| 648 delegate_->OpenDownload(download); | 648 delegate_->OpenDownload(download); |
| 649 } | 649 } |
| 650 | 650 |
| 651 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) { | 651 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) { |
| 652 if (delegate_) | 652 if (delegate_) |
| 653 delegate_->ShowDownloadInShell(download); | 653 delegate_->ShowDownloadInShell(download); |
| 654 } | 654 } |
| 655 | 655 |
| 656 } // namespace content | 656 } // namespace content |
| OLD | NEW |