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 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 FOR_EACH_OBSERVER(Observer, observers_, | 517 FOR_EACH_OBSERVER(Observer, observers_, |
518 OnSavePackageSuccessfullyFinished(this, download_item)); | 518 OnSavePackageSuccessfullyFinished(this, download_item)); |
519 } | 519 } |
520 | 520 |
521 // Resume a download of a specific URL. We send the request to the | 521 // Resume a download of a specific URL. We send the request to the |
522 // ResourceDispatcherHost, and let it send us responses like a regular | 522 // ResourceDispatcherHost, and let it send us responses like a regular |
523 // download. | 523 // download. |
524 void DownloadManagerImpl::ResumeInterruptedDownload( | 524 void DownloadManagerImpl::ResumeInterruptedDownload( |
525 scoped_ptr<content::DownloadUrlParameters> params, | 525 scoped_ptr<content::DownloadUrlParameters> params, |
526 uint32 id) { | 526 uint32 id) { |
| 527 RecordDownloadSource(INITIATED_BY_RESUMPTION); |
527 BrowserThread::PostTask( | 528 BrowserThread::PostTask( |
528 BrowserThread::IO, | 529 BrowserThread::IO, |
529 FROM_HERE, | 530 FROM_HERE, |
530 base::Bind(&BeginDownload, base::Passed(¶ms), id)); | 531 base::Bind(&BeginDownload, base::Passed(¶ms), id)); |
531 } | 532 } |
532 | 533 |
533 void DownloadManagerImpl::SetDownloadItemFactoryForTesting( | 534 void DownloadManagerImpl::SetDownloadItemFactoryForTesting( |
534 scoped_ptr<DownloadItemFactory> item_factory) { | 535 scoped_ptr<DownloadItemFactory> item_factory) { |
535 item_factory_ = item_factory.Pass(); | 536 item_factory_ = item_factory.Pass(); |
536 } | 537 } |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 if (delegate_) | 683 if (delegate_) |
683 delegate_->OpenDownload(download); | 684 delegate_->OpenDownload(download); |
684 } | 685 } |
685 | 686 |
686 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) { | 687 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) { |
687 if (delegate_) | 688 if (delegate_) |
688 delegate_->ShowDownloadInShell(download); | 689 delegate_->ShowDownloadInShell(download); |
689 } | 690 } |
690 | 691 |
691 } // namespace content | 692 } // namespace content |
OLD | NEW |