| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/save_package.h" | 5 #include "content/browser/download/save_package.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 BrowserThread::FILE, FROM_HERE, | 619 BrowserThread::FILE, FROM_HERE, |
| 620 NewRunnableMethod(file_manager_, | 620 NewRunnableMethod(file_manager_, |
| 621 &SaveFileManager::RemoveSavedFileFromFileMap, | 621 &SaveFileManager::RemoveSavedFileFromFileMap, |
| 622 save_ids)); | 622 save_ids)); |
| 623 | 623 |
| 624 finished_ = true; | 624 finished_ = true; |
| 625 wait_state_ = FAILED; | 625 wait_state_ = FAILED; |
| 626 | 626 |
| 627 // Inform the DownloadItem we have canceled whole save page job. | 627 // Inform the DownloadItem we have canceled whole save page job. |
| 628 if (download_) { | 628 if (download_) { |
| 629 download_->Cancel(false); | 629 download_->Cancel(); |
| 630 FinalizeDownloadEntry(); | 630 FinalizeDownloadEntry(); |
| 631 } | 631 } |
| 632 } | 632 } |
| 633 | 633 |
| 634 void SavePackage::CheckFinish() { | 634 void SavePackage::CheckFinish() { |
| 635 if (in_process_count() || finished_) | 635 if (in_process_count() || finished_) |
| 636 return; | 636 return; |
| 637 | 637 |
| 638 FilePath dir = (save_type_ == SAVE_AS_COMPLETE_HTML && | 638 FilePath dir = (save_type_ == SAVE_AS_COMPLETE_HTML && |
| 639 saved_success_items_.size() > 1) ? | 639 saved_success_items_.size() > 1) ? |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1280 StopObservation(); | 1280 StopObservation(); |
| 1281 } | 1281 } |
| 1282 | 1282 |
| 1283 void SavePackage::FinalizeDownloadEntry() { | 1283 void SavePackage::FinalizeDownloadEntry() { |
| 1284 DCHECK(download_); | 1284 DCHECK(download_); |
| 1285 DCHECK(download_manager_); | 1285 DCHECK(download_manager_); |
| 1286 | 1286 |
| 1287 download_manager_->SavePageDownloadFinished(download_); | 1287 download_manager_->SavePageDownloadFinished(download_); |
| 1288 StopObservation(); | 1288 StopObservation(); |
| 1289 } | 1289 } |
| OLD | NEW |