| 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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 (item_iterator->second->GetState() == DownloadItem::CANCELLED)) { | 377 (item_iterator->second->GetState() == DownloadItem::CANCELLED)) { |
| 378 // If the download is no longer known to the DownloadManager, then it was | 378 // If the download is no longer known to the DownloadManager, then it was |
| 379 // removed after it was resumed. Ignore. If the download is cancelled | 379 // removed after it was resumed. Ignore. If the download is cancelled |
| 380 // while resuming, then also ignore the request. | 380 // while resuming, then also ignore the request. |
| 381 info->request_handle->CancelRequest(); | 381 info->request_handle->CancelRequest(); |
| 382 if (!on_started.is_null()) | 382 if (!on_started.is_null()) |
| 383 on_started.Run(NULL, DOWNLOAD_INTERRUPT_REASON_USER_CANCELED); | 383 on_started.Run(NULL, DOWNLOAD_INTERRUPT_REASON_USER_CANCELED); |
| 384 return; | 384 return; |
| 385 } | 385 } |
| 386 download = item_iterator->second; | 386 download = item_iterator->second; |
| 387 DCHECK_EQ(download->GetState(), DownloadItem::IN_PROGRESS); | 387 DCHECK_EQ(DownloadItem::INTERRUPTED, download->GetState()); |
| 388 download->MergeOriginInfoOnResume(*info); | 388 download->MergeOriginInfoOnResume(*info); |
| 389 } | 389 } |
| 390 | 390 |
| 391 base::FilePath default_download_directory; | 391 base::FilePath default_download_directory; |
| 392 if (delegate_) { | 392 if (delegate_) { |
| 393 base::FilePath website_save_directory; // Unused | 393 base::FilePath website_save_directory; // Unused |
| 394 bool skip_dir_check = false; // Unused | 394 bool skip_dir_check = false; // Unused |
| 395 delegate_->GetSaveDir(GetBrowserContext(), &website_save_directory, | 395 delegate_->GetSaveDir(GetBrowserContext(), &website_save_directory, |
| 396 &default_download_directory, &skip_dir_check); | 396 &default_download_directory, &skip_dir_check); |
| 397 } | 397 } |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 747 if (delegate_) | 747 if (delegate_) |
| 748 delegate_->OpenDownload(download); | 748 delegate_->OpenDownload(download); |
| 749 } | 749 } |
| 750 | 750 |
| 751 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) { | 751 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) { |
| 752 if (delegate_) | 752 if (delegate_) |
| 753 delegate_->ShowDownloadInShell(download); | 753 delegate_->ShowDownloadInShell(download); |
| 754 } | 754 } |
| 755 | 755 |
| 756 } // namespace content | 756 } // namespace content |
| OLD | NEW |