OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 it != saved_failed_items_.end(); ++it) | 680 it != saved_failed_items_.end(); ++it) |
681 save_ids.push_back(it->second->save_id()); | 681 save_ids.push_back(it->second->save_id()); |
682 | 682 |
683 BrowserThread::PostTask( | 683 BrowserThread::PostTask( |
684 BrowserThread::FILE, FROM_HERE, | 684 BrowserThread::FILE, FROM_HERE, |
685 NewRunnableMethod(file_manager_, | 685 NewRunnableMethod(file_manager_, |
686 &SaveFileManager::RemoveSavedFileFromFileMap, | 686 &SaveFileManager::RemoveSavedFileFromFileMap, |
687 save_ids)); | 687 save_ids)); |
688 | 688 |
689 download_->OnAllDataSaved(all_save_items_count_); | 689 download_->OnAllDataSaved(all_save_items_count_); |
| 690 download_->MarkAsComplete(); |
690 // Notify download observers that we are complete (the call | 691 // Notify download observers that we are complete (the call |
691 // to OnAllDataSaved() set the state to complete but did not notify). | 692 // to OnReadyToFinish() set the state to complete but did not notify). |
692 download_->UpdateObservers(); | 693 download_->UpdateObservers(); |
693 | 694 |
694 NotificationService::current()->Notify( | 695 NotificationService::current()->Notify( |
695 NotificationType::SAVE_PACKAGE_SUCCESSFULLY_FINISHED, | 696 NotificationType::SAVE_PACKAGE_SUCCESSFULLY_FINISHED, |
696 Source<SavePackage>(this), | 697 Source<SavePackage>(this), |
697 Details<GURL>(&page_url_)); | 698 Details<GURL>(&page_url_)); |
698 } | 699 } |
699 | 700 |
700 // Called for updating end state. | 701 // Called for updating end state. |
701 void SavePackage::SaveFinished(int32 save_id, int64 size, bool is_success) { | 702 void SavePackage::SaveFinished(int32 save_id, int64 size, bool is_success) { |
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1369 } | 1370 } |
1370 | 1371 |
1371 // SelectFileDialog::Listener interface. | 1372 // SelectFileDialog::Listener interface. |
1372 void SavePackage::FileSelected(const FilePath& path, | 1373 void SavePackage::FileSelected(const FilePath& path, |
1373 int index, void* params) { | 1374 int index, void* params) { |
1374 ContinueSave(path, index); | 1375 ContinueSave(path, index); |
1375 } | 1376 } |
1376 | 1377 |
1377 void SavePackage::FileSelectionCanceled(void* params) { | 1378 void SavePackage::FileSelectionCanceled(void* params) { |
1378 } | 1379 } |
OLD | NEW |