| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/download/save_package.h" | 5 #include "chrome/browser/download/save_package.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/i18n/file_util_icu.h" | 10 #include "base/i18n/file_util_icu.h" |
| (...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 it != saved_failed_items_.end(); ++it) | 644 it != saved_failed_items_.end(); ++it) |
| 645 save_ids.push_back(it->second->save_id()); | 645 save_ids.push_back(it->second->save_id()); |
| 646 | 646 |
| 647 ChromeThread::PostTask( | 647 ChromeThread::PostTask( |
| 648 ChromeThread::FILE, FROM_HERE, | 648 ChromeThread::FILE, FROM_HERE, |
| 649 NewRunnableMethod(file_manager_, | 649 NewRunnableMethod(file_manager_, |
| 650 &SaveFileManager::RemoveSavedFileFromFileMap, | 650 &SaveFileManager::RemoveSavedFileFromFileMap, |
| 651 save_ids)); | 651 save_ids)); |
| 652 | 652 |
| 653 download_->Finished(all_save_items_count_); | 653 download_->Finished(all_save_items_count_); |
| 654 // Notify download observers that we are complete (the call to Finished() set |
| 655 // the state to complete but did not notify). |
| 656 download_->UpdateObservers(); |
| 654 | 657 |
| 655 NotificationService::current()->Notify( | 658 NotificationService::current()->Notify( |
| 656 NotificationType::SAVE_PACKAGE_SUCCESSFULLY_FINISHED, | 659 NotificationType::SAVE_PACKAGE_SUCCESSFULLY_FINISHED, |
| 657 Source<SavePackage>(this), | 660 Source<SavePackage>(this), |
| 658 Details<GURL>(&page_url_)); | 661 Details<GURL>(&page_url_)); |
| 659 } | 662 } |
| 660 | 663 |
| 661 // Called for updating end state. | 664 // Called for updating end state. |
| 662 void SavePackage::SaveFinished(int32 save_id, int64 size, bool is_success) { | 665 void SavePackage::SaveFinished(int32 save_id, int64 size, bool is_success) { |
| 663 // Because we might have canceled this saving job before, | 666 // Because we might have canceled this saving job before, |
| (...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1261 int index, void* params) { | 1264 int index, void* params) { |
| 1262 SavePackageParam* save_params = reinterpret_cast<SavePackageParam*>(params); | 1265 SavePackageParam* save_params = reinterpret_cast<SavePackageParam*>(params); |
| 1263 ContinueSave(save_params, path, index); | 1266 ContinueSave(save_params, path, index); |
| 1264 delete save_params; | 1267 delete save_params; |
| 1265 } | 1268 } |
| 1266 | 1269 |
| 1267 void SavePackage::FileSelectionCanceled(void* params) { | 1270 void SavePackage::FileSelectionCanceled(void* params) { |
| 1268 SavePackageParam* save_params = reinterpret_cast<SavePackageParam*>(params); | 1271 SavePackageParam* save_params = reinterpret_cast<SavePackageParam*>(params); |
| 1269 delete save_params; | 1272 delete save_params; |
| 1270 } | 1273 } |
| OLD | NEW |