| 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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 // dangerous downloads which will remain in history if they aren't explicitly | 338 // dangerous downloads which will remain in history if they aren't explicitly |
| 339 // accepted or discarded. Canceling will remove the intermediate download | 339 // accepted or discarded. Canceling will remove the intermediate download |
| 340 // file. | 340 // file. |
| 341 for (DownloadMap::iterator it = downloads_.begin(); it != downloads_.end(); | 341 for (DownloadMap::iterator it = downloads_.begin(); it != downloads_.end(); |
| 342 ++it) { | 342 ++it) { |
| 343 DownloadItemImpl* download = it->second; | 343 DownloadItemImpl* download = it->second; |
| 344 if (download->GetState() == DownloadItem::IN_PROGRESS) | 344 if (download->GetState() == DownloadItem::IN_PROGRESS) |
| 345 download->Cancel(false); | 345 download->Cancel(false); |
| 346 } | 346 } |
| 347 STLDeleteValues(&downloads_); | 347 STLDeleteValues(&downloads_); |
| 348 downloads_.clear(); | |
| 349 | 348 |
| 350 // We'll have nothing more to report to the observers after this point. | 349 // We'll have nothing more to report to the observers after this point. |
| 351 observers_.Clear(); | 350 observers_.Clear(); |
| 352 | 351 |
| 353 if (delegate_) | 352 if (delegate_) |
| 354 delegate_->Shutdown(); | 353 delegate_->Shutdown(); |
| 355 delegate_ = NULL; | 354 delegate_ = NULL; |
| 356 } | 355 } |
| 357 | 356 |
| 358 void DownloadManagerImpl::StartDownload( | 357 void DownloadManagerImpl::StartDownload( |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 if (delegate_) | 716 if (delegate_) |
| 718 delegate_->OpenDownload(download); | 717 delegate_->OpenDownload(download); |
| 719 } | 718 } |
| 720 | 719 |
| 721 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) { | 720 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) { |
| 722 if (delegate_) | 721 if (delegate_) |
| 723 delegate_->ShowDownloadInShell(download); | 722 delegate_->ShowDownloadInShell(download); |
| 724 } | 723 } |
| 725 | 724 |
| 726 } // namespace content | 725 } // namespace content |
| OLD | NEW |