| 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 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 mime_type, | 511 mime_type, |
| 512 request_handle.Pass(), | 512 request_handle.Pass(), |
| 513 bound_net_log); | 513 bound_net_log); |
| 514 downloads_[download_item->GetId()] = download_item; | 514 downloads_[download_item->GetId()] = download_item; |
| 515 FOR_EACH_OBSERVER(Observer, observers_, OnDownloadCreated( | 515 FOR_EACH_OBSERVER(Observer, observers_, OnDownloadCreated( |
| 516 this, download_item)); | 516 this, download_item)); |
| 517 if (!item_created.is_null()) | 517 if (!item_created.is_null()) |
| 518 item_created.Run(download_item); | 518 item_created.Run(download_item); |
| 519 } | 519 } |
| 520 | 520 |
| 521 void DownloadManagerImpl::OnSavePackageSuccessfullyFinished( | 521 void DownloadManagerImpl::OnSavePackageFinished( |
| 522 DownloadItem* download_item) { | 522 bool success, DownloadItem* download_item) { |
| 523 FOR_EACH_OBSERVER(Observer, observers_, | 523 FOR_EACH_OBSERVER(Observer, observers_, |
| 524 OnSavePackageSuccessfullyFinished(this, download_item)); | 524 OnSavePackageFinished(success, this, download_item)); |
| 525 } | 525 } |
| 526 | 526 |
| 527 // Resume a download of a specific URL. We send the request to the | 527 // Resume a download of a specific URL. We send the request to the |
| 528 // ResourceDispatcherHost, and let it send us responses like a regular | 528 // ResourceDispatcherHost, and let it send us responses like a regular |
| 529 // download. | 529 // download. |
| 530 void DownloadManagerImpl::ResumeInterruptedDownload( | 530 void DownloadManagerImpl::ResumeInterruptedDownload( |
| 531 scoped_ptr<content::DownloadUrlParameters> params, | 531 scoped_ptr<content::DownloadUrlParameters> params, |
| 532 uint32 id) { | 532 uint32 id) { |
| 533 RecordDownloadSource(INITIATED_BY_RESUMPTION); | 533 RecordDownloadSource(INITIATED_BY_RESUMPTION); |
| 534 BrowserThread::PostTask( | 534 BrowserThread::PostTask( |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 if (delegate_) | 708 if (delegate_) |
| 709 delegate_->OpenDownload(download); | 709 delegate_->OpenDownload(download); |
| 710 } | 710 } |
| 711 | 711 |
| 712 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) { | 712 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) { |
| 713 if (delegate_) | 713 if (delegate_) |
| 714 delegate_->ShowDownloadInShell(download); | 714 delegate_->ShowDownloadInShell(download); |
| 715 } | 715 } |
| 716 | 716 |
| 717 } // namespace content | 717 } // namespace content |
| OLD | NEW |