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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 // If the download is no longer known to the DownloadManager, then it was | 391 // If the download is no longer known to the DownloadManager, then it was |
392 // removed after it was resumed. Ignore. If the download is cancelled | 392 // removed after it was resumed. Ignore. If the download is cancelled |
393 // while resuming, then also ignore the request. | 393 // while resuming, then also ignore the request. |
394 info->request_handle.CancelRequest(); | 394 info->request_handle.CancelRequest(); |
395 if (!on_started.is_null()) | 395 if (!on_started.is_null()) |
396 on_started.Run(NULL, net::ERR_ABORTED); | 396 on_started.Run(NULL, net::ERR_ABORTED); |
397 return; | 397 return; |
398 } | 398 } |
399 download = item_iterator->second; | 399 download = item_iterator->second; |
400 DCHECK_EQ(DownloadItem::INTERRUPTED, download->GetState()); | 400 DCHECK_EQ(DownloadItem::INTERRUPTED, download->GetState()); |
| 401 download->MergeOriginInfoOnResume(*info); |
401 } | 402 } |
402 | 403 |
403 base::FilePath default_download_directory; | 404 base::FilePath default_download_directory; |
404 if (delegate_) { | 405 if (delegate_) { |
405 base::FilePath website_save_directory; // Unused | 406 base::FilePath website_save_directory; // Unused |
406 bool skip_dir_check = false; // Unused | 407 bool skip_dir_check = false; // Unused |
407 delegate_->GetSaveDir(GetBrowserContext(), &website_save_directory, | 408 delegate_->GetSaveDir(GetBrowserContext(), &website_save_directory, |
408 &default_download_directory, &skip_dir_check); | 409 &default_download_directory, &skip_dir_check); |
409 } | 410 } |
410 | 411 |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 if (delegate_) | 708 if (delegate_) |
708 delegate_->OpenDownload(download); | 709 delegate_->OpenDownload(download); |
709 } | 710 } |
710 | 711 |
711 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) { | 712 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) { |
712 if (delegate_) | 713 if (delegate_) |
713 delegate_->ShowDownloadInShell(download); | 714 delegate_->ShowDownloadInShell(download); |
714 } | 715 } |
715 | 716 |
716 } // namespace content | 717 } // namespace content |
OLD | NEW |